12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ import os
16
+
15
17
import launch
16
18
from launch .actions import DeclareLaunchArgument
17
19
from launch .actions import GroupAction
@@ -33,26 +35,42 @@ def launch_setup(context, *args, **kwargs):
33
35
vehicle_info_param_path = LaunchConfiguration ("vehicle_info_param_file" ).perform (context )
34
36
with open (vehicle_info_param_path , "r" ) as f :
35
37
vehicle_info_param = yaml .safe_load (f )["/**" ]["ros__parameters" ]
36
- lat_controller_param_path = LaunchConfiguration ("lat_controller_param_path" ).perform (context )
38
+
39
+ lat_controller_param_path = os .path .join (
40
+ LaunchConfiguration ("tier4_control_launch_param_path" ).perform (context ),
41
+ "trajectory_follower" ,
42
+ "lateral_controller.param.yaml" ,
43
+ )
37
44
with open (lat_controller_param_path , "r" ) as f :
38
45
lat_controller_param = yaml .safe_load (f )["/**" ]["ros__parameters" ]
39
- lon_controller_param_path = LaunchConfiguration ("lon_controller_param_path" ).perform (context )
46
+
47
+ lon_controller_param_path = os .path .join (
48
+ LaunchConfiguration ("tier4_control_launch_param_path" ).perform (context ),
49
+ "trajectory_follower" ,
50
+ "longitudinal_controller.param.yaml" ,
51
+ )
40
52
with open (lon_controller_param_path , "r" ) as f :
41
53
lon_controller_param = yaml .safe_load (f )["/**" ]["ros__parameters" ]
42
- vehicle_cmd_gate_param_path = LaunchConfiguration ("vehicle_cmd_gate_param_path" ).perform (
43
- context
54
+
55
+ vehicle_cmd_gate_param_path = os .path .join (
56
+ LaunchConfiguration ("tier4_control_launch_param_path" ).perform (context ),
57
+ "vehicle_cmd_gate" ,
58
+ "vehicle_cmd_gate.param.yaml" ,
44
59
)
45
60
with open (vehicle_cmd_gate_param_path , "r" ) as f :
46
61
vehicle_cmd_gate_param = yaml .safe_load (f )["/**" ]["ros__parameters" ]
62
+
47
63
lane_departure_checker_param_path = LaunchConfiguration (
48
64
"lane_departure_checker_param_path"
49
65
).perform (context )
50
66
with open (lane_departure_checker_param_path , "r" ) as f :
51
67
lane_departure_checker_param = yaml .safe_load (f )["/**" ]["ros__parameters" ]
52
68
53
- operation_mode_transition_manager_param_path = LaunchConfiguration (
54
- "operation_mode_transition_manager_param_path"
55
- ).perform (context )
69
+ operation_mode_transition_manager_param_path = os .path .join (
70
+ LaunchConfiguration ("tier4_control_launch_param_path" ).perform (context ),
71
+ "operation_mode_transition_manager" ,
72
+ "operation_mode_transition_manager.param.yaml" ,
73
+ )
56
74
with open (operation_mode_transition_manager_param_path , "r" ) as f :
57
75
operation_mode_transition_manager_param = yaml .safe_load (f )["/**" ]["ros__parameters" ]
58
76
@@ -247,8 +265,17 @@ def add_launch_arg(name: str, default_value=None, description=None):
247
265
DeclareLaunchArgument (name , default_value = default_value , description = description )
248
266
)
249
267
250
- # lateral controller
268
+ # parameter
269
+ add_launch_arg (
270
+ "tier4_control_launch_param_path" ,
271
+ [
272
+ FindPackageShare ("tier4_control_launch" ),
273
+ "/config" ,
274
+ ],
275
+ "tier4_control_launch parameter path" ,
276
+ )
251
277
278
+ # lateral controller
252
279
add_launch_arg (
253
280
"lateral_controller_mode" ,
254
281
"mpc_follower" ,
@@ -264,42 +291,10 @@ def add_launch_arg(name: str, default_value=None, description=None):
264
291
"path to the parameter file of vehicle information" ,
265
292
)
266
293
267
- add_launch_arg (
268
- "lat_controller_param_path" ,
269
- [
270
- FindPackageShare ("tier4_control_launch" ),
271
- "/config/trajectory_follower/lateral_controller.param.yaml" ,
272
- ],
273
- "path to the parameter file of lateral controller" ,
274
- )
275
- add_launch_arg (
276
- "lon_controller_param_path" ,
277
- [
278
- FindPackageShare ("tier4_control_launch" ),
279
- "/config/trajectory_follower/longitudinal_controller.param.yaml" ,
280
- ],
281
- "path to the parameter file of longitudinal controller" ,
282
- )
283
- add_launch_arg (
284
- "vehicle_cmd_gate_param_path" ,
285
- [
286
- FindPackageShare ("tier4_control_launch" ),
287
- "/config/vehicle_cmd_gate/vehicle_cmd_gate.param.yaml" ,
288
- ],
289
- "path to the parameter file of vehicle_cmd_gate" ,
290
- )
291
294
add_launch_arg (
292
295
"lane_departure_checker_param_path" ,
293
296
[FindPackageShare ("lane_departure_checker" ), "/config/lane_departure_checker.param.yaml" ],
294
297
)
295
- add_launch_arg (
296
- "operation_mode_transition_manager_param_path" ,
297
- [
298
- FindPackageShare ("tier4_control_launch" ),
299
- "/config/operation_mode_transition_manager/operation_mode_transition_manager.param.yaml" ,
300
- ],
301
- "path to the parameter file of vehicle_cmd_gate" ,
302
- )
303
298
304
299
# velocity controller
305
300
add_launch_arg ("show_debug_info" , "false" , "show debug information" )
0 commit comments