Cannot shutdown the node from terminal.
kyuhyong opened this issue · comments
kyuhyong commented
The node is working ok but I cannot shut the node down by Ctrl+C but only by "kill" command.
I tried to add a button to shut it down from web
ui.button('shutdown', on_click=lambda: self.shutdown())
def shutdown(self):
self.destroy_node()
But this does not work either.
Asked to destroy handle, but it was already destroyed
Traceback (most recent call last):
File "/home/kyu/.local/lib/python3.8/site-packages/nicegui/events.py", line 400, in handle_event
result = handler(arguments) if expects_arguments else handler()
File "/home/kyu/uds_mmu_workspace/build/uds_gcs_commander/uds_gcs_commander/gcs_ui.py", line 78, in <lambda>
ui.button('shutdown', on_click=lambda: self.shutdown())
File "/home/kyu/uds_mmu_workspace/build/uds_gcs_commander/uds_gcs_commander/gcs_ui.py", line 82, in shutdown
self.destroy_node()
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/node.py", line 1533, in destroy_node
self.handle.destroy()
File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/handle.py", line 92, in destroy
raise InvalidHandle('Asked to destroy handle, but it was already destroyed')
rclpy.handle.InvalidHandle: Asked to destroy handle, but it was already destroyed
How can I terminate with Ctrl+c as usual?
Falko Schindler commented
Hi @kyuhyong,
It looks like your problem has been solved by installing ROS Humble, as mentioned here: zauberzeug/nicegui#2356 (comment).
Is that correct?
kyuhyong commented
@falkoschindler Yes that is correct.