@@ -211,6 +211,7 @@ def __init__(self, host: str, port: int):
211211 self .world_launcher = None
212212 self .world_type = None
213213 self .robot_launcher = None
214+ self .robot_pose = None
214215 self .tools_launcher = None
215216 self .application_process = None
216217 self .running = True
@@ -349,7 +350,8 @@ def on_launch_world(self, event):
349350
350351 self .robot_launcher = LauncherRobot (** cfg .model_dump ())
351352 LogManager .logger .info (str (self .robot_launcher ))
352- self .robot_launcher .run (robot_cfg ["start_pose" ])
353+ self .robot_pose = robot_cfg ["start_pose" ]
354+ self .robot_launcher .run (self .robot_pose )
353355 LogManager .logger .info ("Launch transition finished" )
354356
355357 def prepare_custom_universe (self , cfg_dict ):
@@ -767,6 +769,7 @@ def on_terminate_universe(self, event):
767769 if self .robot_launcher is not None :
768770 self .robot_launcher .terminate ()
769771 self .robot_launcher = None
772+ self .robot_pose = None
770773
771774 def on_disconnect (self , event ):
772775 """
@@ -790,6 +793,7 @@ def on_disconnect(self, event):
790793 LogManager .logger .exception ("Exception terminating tools launcher" )
791794
792795 if self .robot_launcher :
796+ self .robot_pose = None
793797 try :
794798 self .robot_launcher .terminate ()
795799 except Exception as e :
@@ -873,20 +877,21 @@ def reset_sim(self):
873877 the appropriate ROS or Gazebo services based on the visualization type,
874878 and relaunches the robot if a launcher is available.
875879 """
876- if self .robot_launcher :
877- self .robot_launcher .terminate ()
880+ # if self.robot_launcher:
881+ # self.robot_launcher.terminate()
878882
879883 try :
880884 self .tools_launcher .reset ()
881885 except subprocess .TimeoutExpired as e :
882886 self .write_to_tool_terminal (f"{ e } \n \n " )
883887 raise Exception ("Failed to reset simulator" )
884888
885- if self .robot_launcher :
886- try :
887- self .robot_launcher .run ()
888- except Exception as e :
889- LogManager .logger .exception ("Exception terminating world launcher" )
889+ # if self.robot_launcher:
890+ # try:
891+ # LogManager.logger.exception("Relaunching robot launcher")
892+ # self.robot_launcher.run(self.robot_pose)
893+ # except Exception as e:
894+ # LogManager.logger.exception("Exception terminating world launcher")
890895
891896 def start (self ):
892897 """
0 commit comments