20
20
21
21
from ament_index_python .packages import get_package_share_directory
22
22
from launch import LaunchDescription
23
- from launch .actions import (AppendEnvironmentVariable , DeclareLaunchArgument ,
24
- ExecuteProcess , GroupAction ,
25
- IncludeLaunchDescription , LogInfo , OpaqueFunction ,
26
- RegisterEventHandler )
23
+ from launch .actions import (
24
+ AppendEnvironmentVariable ,
25
+ DeclareLaunchArgument ,
26
+ ExecuteProcess ,
27
+ GroupAction ,
28
+ IncludeLaunchDescription ,
29
+ LogInfo ,
30
+ OpaqueFunction ,
31
+ RegisterEventHandler ,
32
+ )
27
33
from launch .conditions import IfCondition
28
34
from launch .event_handlers import OnShutdown
29
35
from launch .launch_description_sources import PythonLaunchDescriptionSource
@@ -51,12 +57,7 @@ def generate_robot_actions(context, *args, **kwargs):
51
57
group = GroupAction (
52
58
[
53
59
LogInfo (
54
- msg = [
55
- 'Launching namespace=' ,
56
- robot_name ,
57
- ' init_pose=' ,
58
- str (init_pose ),
59
- ]
60
+ msg = ['Launching namespace=' , robot_name , ' init_pose=' , str (init_pose ),]
60
61
),
61
62
IncludeLaunchDescription (
62
63
PythonLaunchDescriptionSource (
@@ -70,8 +71,7 @@ def generate_robot_actions(context, *args, **kwargs):
70
71
),
71
72
IncludeLaunchDescription (
72
73
PythonLaunchDescriptionSource (
73
- os .path .join (bringup_dir , 'launch' ,
74
- 'tb3_simulation_launch.py' )
74
+ os .path .join (bringup_dir , 'launch' , 'tb3_simulation_launch.py' )
75
75
),
76
76
launch_arguments = {
77
77
'namespace' : robot_name ,
@@ -96,8 +96,7 @@ def generate_robot_actions(context, *args, **kwargs):
96
96
)
97
97
98
98
bringup_cmd_group .append (group )
99
- bringup_cmd_group .append (
100
- LogInfo (msg = ['number_of_robots=' , str (len (robots_list ))]))
99
+ bringup_cmd_group .append (LogInfo (msg = ['number_of_robots=' , str (len (robots_list ))]))
101
100
return bringup_cmd_group
102
101
103
102
@@ -217,12 +216,10 @@ def generate_launch_description():
217
216
ld .add_action (remove_temp_sdf_file )
218
217
219
218
ld .add_action (
220
- LogInfo (condition = IfCondition (log_settings ),
221
- msg = ['map yaml: ' , map_yaml_file ])
219
+ LogInfo (condition = IfCondition (log_settings ), msg = ['map yaml: ' , map_yaml_file ])
222
220
)
223
221
ld .add_action (
224
- LogInfo (condition = IfCondition (log_settings ),
225
- msg = ['params yaml: ' , params_file ])
222
+ LogInfo (condition = IfCondition (log_settings ), msg = ['params yaml: ' , params_file ])
226
223
)
227
224
ld .add_action (
228
225
LogInfo (
@@ -237,8 +234,7 @@ def generate_launch_description():
237
234
)
238
235
)
239
236
ld .add_action (
240
- LogInfo (condition = IfCondition (log_settings ),
241
- msg = ['autostart: ' , autostart ])
237
+ LogInfo (condition = IfCondition (log_settings ), msg = ['autostart: ' , autostart ])
242
238
)
243
239
ld .add_action (OpaqueFunction (function = generate_robot_actions ))
244
240
0 commit comments