Skip to content

Commit ece8696

Browse files
author
cobot
committed
apr29
1 parent 2b41460 commit ece8696

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

codebotler.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff 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

server.log

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)