@@ -324,7 +324,7 @@ def on_prepare_visualization(self, event):
324
324
325
325
self .visualization_launcher .run ()
326
326
327
- if self .visualization_type in ["gazebo_rae" , "gzsim_rae" ]:
327
+ if self .visualization_type in ["gazebo_rae" , "gzsim_rae" , "console" ]:
328
328
self .gui_server = Server (2303 , self .update )
329
329
self .gui_server .start ()
330
330
elif self .visualization_type in ["bt_studio" , "bt_studio_gz" ]:
@@ -675,6 +675,7 @@ def terminate_harmonic_processes(self):
675
675
"""
676
676
Terminate all processes within the Docker container whose command line contains 'gz' or 'launch'.
677
677
"""
678
+ LogManager .logger .info ("Terminate Harmonic process" )
678
679
keywords = ['gz' , 'launch' ]
679
680
for keyword in keywords :
680
681
try :
@@ -734,6 +735,7 @@ def on_terminate_universe(self, event):
734
735
self .world_launcher .terminate ()
735
736
if self .robot_launcher != None :
736
737
self .robot_launcher .terminate ()
738
+ self .terminate_harmonic_processes ()
737
739
738
740
def on_disconnect (self , event ):
739
741
self .terminate_harmonic_processes ()
@@ -796,13 +798,13 @@ def on_resume(self, msg):
796
798
def pause_sim (self ):
797
799
if self .visualization_type in ["gzsim_rae" , "bt_studio_gz" ]:
798
800
self .call_gzservice ("$(gz service -l | grep '^/world/\w*/control$')" ,"gz.msgs.WorldControl" ,"gz.msgs.Boolean" ,"3000" ,"pause: true" )
799
- else :
801
+ elif not self . visualization_type in [ "console" ] :
800
802
self .call_service ("/pause_physics" , "std_srvs/srv/Empty" )
801
803
802
804
def unpause_sim (self ):
803
805
if self .visualization_type in ["gzsim_rae" , "bt_studio_gz" ]:
804
806
self .call_gzservice ("$(gz service -l | grep '^/world/\w*/control$')" ,"gz.msgs.WorldControl" ,"gz.msgs.Boolean" ,"3000" ,"pause: false" )
805
- else :
807
+ elif not self . visualization_type in [ "console" ] :
806
808
self .call_service ("/unpause_physics" , "std_srvs/srv/Empty" )
807
809
808
810
def reset_sim (self ):
@@ -815,7 +817,7 @@ def reset_sim(self):
815
817
self .call_gzservice ("$(gz service -l | grep '^/world/\w*/control$')" ,"gz.msgs.WorldControl" ,"gz.msgs.Boolean" ,"3000" ,"reset: {all: true}" )
816
818
if self .is_ros_service_available ("/drone0/controller/_reset" ):
817
819
self .call_service ("/drone0/controller/_reset" , "std_srvs/srv/Trigger" , "{}" )
818
- else :
820
+ elif not self . visualization_type in [ "console" ] :
819
821
self .call_service ("/reset_world" , "std_srvs/srv/Empty" )
820
822
821
823
if self .robot_launcher :
0 commit comments