@@ -286,7 +286,7 @@ def on_launch_world(self, event):
286286
287287 self .robot_launcher = LauncherRobot (** cfg .model_dump ())
288288 LogManager .logger .info (str (self .robot_launcher ))
289- self .robot_launcher .run ()
289+ self .robot_launcher .run (robot_cfg [ 'start_pose' ] )
290290 LogManager .logger .info ("Launch transition finished" )
291291
292292 def prepare_custom_universe (self , cfg_dict ):
@@ -313,10 +313,15 @@ def on_prepare_visualization(self, event):
313313
314314 LogManager .logger .info ("Visualization transition started" )
315315
316- self .visualization_type = event .kwargs .get ("data" , {})
316+ cfg_dict = event .kwargs .get ("data" , {})
317+ self .visualization_type = cfg_dict ['type' ]
318+ config_file = cfg_dict ['file' ]
319+
317320 self .visualization_launcher = LauncherVisualization (
318- visualization = self .visualization_type
321+ visualization = self .visualization_type ,
322+ visualization_config_path = config_file
319323 )
324+
320325 self .visualization_launcher .run ()
321326
322327 if self .visualization_type in ["gazebo_rae" , "gzsim_rae" ]:
@@ -801,6 +806,9 @@ def unpause_sim(self):
801806 self .call_service ("/unpause_physics" , "std_srvs/srv/Empty" )
802807
803808 def reset_sim (self ):
809+ if self .robot_launcher :
810+ self .robot_launcher .terminate ()
811+
804812 if self .visualization_type in ["gzsim_rae" , "bt_studio_gz" ]:
805813 if self .is_ros_service_available ("/drone0/platform/state_machine/_reset" ):
806814 self .call_service ("/drone0/platform/state_machine/_reset" , "std_srvs/srv/Trigger" , "{}" )
@@ -809,10 +817,9 @@ def reset_sim(self):
809817 self .call_service ("/drone0/controller/_reset" , "std_srvs/srv/Trigger" , "{}" )
810818 else :
811819 self .call_service ("/reset_world" , "std_srvs/srv/Empty" )
812-
820+
813821 if self .robot_launcher :
814822 try :
815- self .robot_launcher .terminate ()
816823 self .robot_launcher .run ()
817824 except Exception as e :
818825 LogManager .logger .exception ("Exception terminating world launcher" )
0 commit comments