34
34
35
35
36
36
def generate_launch_description ():
37
- husarion_ugv_desctiption_pkg = FindPackageShare ("husarion_ugv_description" )
38
37
husarion_ugv_controller_common_dir = PathJoinSubstitution (
39
38
["/config" , "husarion_ugv_controller" ]
40
39
)
41
40
41
+ robot_model = LaunchConfiguration ("robot_model" )
42
+ robot_model_dict = {"LNX" : "lynx" , "PTH" : "panther" }
43
+ robot_model_env = os .environ .get ("ROBOT_MODEL" , default = "PTH" )
44
+
45
+ robot_description_pkg = PythonExpression (["'" , robot_model , "_description'" ])
46
+ robot_description_common_dir = PathJoinSubstitution (["/config" , robot_description_pkg ])
47
+
48
+ declare_robot_model_arg = DeclareLaunchArgument (
49
+ "robot_model" ,
50
+ default_value = robot_model_dict [robot_model_env ],
51
+ description = "Specify robot model" ,
52
+ choices = ["lynx" , "panther" ],
53
+ )
54
+
42
55
battery_config_path = LaunchConfiguration ("battery_config_path" )
43
56
declare_battery_config_path_arg = DeclareLaunchArgument (
44
57
"battery_config_path" ,
@@ -53,7 +66,7 @@ def generate_launch_description():
53
66
declare_components_config_path_arg = DeclareLaunchArgument (
54
67
"components_config_path" ,
55
68
default_value = PathJoinSubstitution (
56
- [husarion_ugv_desctiption_pkg , "config" , "components.yaml" ]
69
+ [robot_description_common_dir , "config" , "components.yaml" ]
57
70
),
58
71
description = (
59
72
"Additional components configuration file. Components described in this file "
@@ -99,16 +112,6 @@ def generate_launch_description():
99
112
choices = ["True" , "true" , "False" , "false" ],
100
113
)
101
114
102
- robot_model = LaunchConfiguration ("robot_model" )
103
- robot_model_dict = {"LNX" : "lynx" , "PTH" : "panther" }
104
- robot_model_env = os .environ .get ("ROBOT_MODEL" , default = "PTH" )
105
- declare_robot_model_arg = DeclareLaunchArgument (
106
- "robot_model" ,
107
- default_value = robot_model_dict [robot_model_env ],
108
- description = "Specify robot model" ,
109
- choices = ["lynx" , "panther" ],
110
- )
111
-
112
115
use_sim = LaunchConfiguration ("use_sim" )
113
116
declare_use_sim_arg = DeclareLaunchArgument (
114
117
"use_sim" ,
@@ -122,14 +125,14 @@ def generate_launch_description():
122
125
"wheel_config_path" ,
123
126
default_value = PathJoinSubstitution (
124
127
[
125
- FindPackageShare (husarion_ugv_desctiption_pkg ),
128
+ FindPackageShare (robot_description_pkg ),
126
129
"config" ,
127
130
PythonExpression (["'" , wheel_type , ".yaml'" ]),
128
131
]
129
132
),
130
133
description = (
131
134
"Path to wheel configuration file. By default, it is located in "
132
- "'husarion_ugv_description /config/{wheel_type}.yaml'. You can also specify the path "
135
+ "'panther_description /config/{wheel_type}.yaml'. You can also specify the path "
133
136
"to your custom wheel configuration file here. "
134
137
),
135
138
)
@@ -160,7 +163,7 @@ def generate_launch_description():
160
163
" " ,
161
164
PathJoinSubstitution (
162
165
[
163
- FindPackageShare (husarion_ugv_desctiption_pkg ),
166
+ FindPackageShare (robot_description_pkg ),
164
167
"urdf" ,
165
168
robot_description_file ,
166
169
]
0 commit comments