1313
1414worlds = {
1515 "gazebo" : {
16- "1" : [
17- {
18- "type" : "module" ,
19- "module" : "ros_api" ,
20- "parameters" : [],
21- "launch_file" : [],
22- }
23- ],
2416 "2" : [
2517 {
26- "type" : "module " ,
18+ "type" : "gazebo " ,
2719 "module" : "robot_ros2_api" ,
2820 "parameters" : [],
2921 "launch_file" : [],
3022 }
3123 ],
3224 },
33- "drones" : {
34- "1" : [
35- {
36- "type" : "module" ,
37- "module" : "drones" ,
38- "resource_folders" : [],
39- "model_folders" : [],
40- "plugin_folders" : [],
41- "parameters" : [],
42- "launch_file" : [],
43- }
44- ],
45- "2" : [
46- {
47- "type" : "module" ,
48- "module" : "drones_ros2" ,
49- "resource_folders" : [],
50- "model_folders" : [],
51- "plugin_folders" : [],
52- "parameters" : [],
53- "launch_file" : [],
54- }
55- ],
56- },
57- "gzsimdrones" : {
25+ "gz" : {
5826 "2" : [
5927 {
60- "type" : "module" ,
61- "module" : "drones_gzsim" ,
62- "resource_folders" : [],
63- "model_folders" : [],
64- "plugin_folders" : [],
28+ "type" : "gz" ,
29+ "module" : "robot_ros2_api" ,
6530 "parameters" : [],
6631 "launch_file" : [],
6732 }
@@ -81,13 +46,17 @@ class LauncherRobot(BaseModel):
8146 launchers : Optional [ILauncher ] = []
8247 start_pose : Optional [list ] = []
8348
84- def run (self , start_pose = None ):
49+ def run (self , start_pose = None , extra_config = None ):
8550 """Run the robot launcher with an optional start pose."""
8651 if start_pose is not None :
8752 self .start_pose = start_pose
53+
54+ if extra_config is None :
55+ extra_config = ""
56+
8857 for module in worlds [self .type ][str (self .ros_version )]:
8958 module ["launch_file" ] = self .launch_file_path
90- launcher = self .launch_module (module )
59+ launcher = self .launch_module (module , extra_config )
9160 self .launchers .append (launcher )
9261 LogManager .logger .info (self .launchers )
9362
@@ -99,7 +68,7 @@ def terminate(self):
9968 launcher .terminate ()
10069 self .launchers = []
10170
102- def launch_module (self , configuration ):
71+ def launch_module (self , configuration , extra_config = None ):
10372 """Launch a robot module based on the provided configuration."""
10473
10574 def process_terminated (name , exit_code ):
@@ -117,7 +86,7 @@ def process_terminated(name, exit_code):
11786 launcher_class = get_class (launcher_module )
11887 launcher = launcher_class .from_config (launcher_class , configuration )
11988
120- launcher .run (self .start_pose , process_terminated )
89+ launcher .run (self .start_pose , extra_config , process_terminated )
12190 return launcher
12291
12392 def launch_command (self , configuration ):
0 commit comments