File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -360,18 +360,24 @@ def shutdown(sig, frame):
360360 time .sleep (2 )
361361 robot_interface .destroy_node ()
362362 if ros_available and rclpy_instance is not None :
363- rclpy_instance .shutdown ()
363+ try :
364+ rclpy_instance .shutdown ()
365+ except RuntimeError :
366+ pass
364367 if httpd is not None :
365368 httpd .server_close ()
366369 httpd .shutdown ()
367370 if server_thread is not None and threading .current_thread () != server_thread :
368371 server_thread .join ()
369- running_loop = asyncio .get_running_loop ()
370- print (" Cancelling asyncio tasks" )
371- for task in asyncio .all_tasks (loop = running_loop ):
372- task .cancel ()
373- print (" Requested stopping asyncio loop" )
374- running_loop .stop ()
372+ try :
373+ running_loop = asyncio .get_running_loop ()
374+ print (" Cancelling asyncio tasks" )
375+ for task in asyncio .all_tasks (loop = running_loop ):
376+ task .cancel ()
377+ print (" Requested stopping asyncio loop" )
378+ running_loop .stop ()
379+ except RuntimeError :
380+ pass
375381 print (" Attempting to close pipe_descriptor" )
376382 if pipe_descriptor is not None :
377383 ## Need to write something to unblock the read
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments