import signal signal.signal(signal.SIGTERM, my_shutdown_handler) If that handler calls sys.exit() without cleaning up rqt , you’ll see rqtclose errors. Modify your rqt plugin’s shutdown_plugin() method:
Introduction: When Your ROS GUI Vanishes If you are a robotics software engineer working with the Robot Operating System (ROS), you have likely mastered the rqt suite—a powerful framework for graphical user interfaces (GUIs) that includes tools like rqt_graph , rqt_plot , and rqt_console . However, an obscure but critical error has been appearing in forums and debug logs: "odin rqtclose" .
trap cleanup EXIT rosrun rqt_gui rqt_gui & rqt_pid=$! wait $rqt_pid Example of a safe shutdown in a Python rqt plugin:
rosnode kill /rqt_gui_py_node_xxxx Then improve your shutdown logic to call rosnode kill on itself (not recommended) or fix the plugin. Fix 1 – Correct the Odin Wrapper Replace any kill -9 with kill -TERM and add a wait loop:
<node name="odin_gui" pkg="odin_viz" type="odin_rqt.py" /> Check odin_rqt.py for any custom signal handling. Specifically, search for:
rqt --force-discover --close-with-master The --close-with-master flag ensures rqt exits if the ROS master dies, preventing hangs. Outdated python-qt-binding or ros-kinetic-rqt-gui (or Melodic/Noetic) can cause shutdown deadlocks. Update:
rosnode list After rqtclose fails, run again. If the rqt node still appears, it’s still alive. Force-kill it:
def shutdown_plugin(self): rospy.loginfo("odin rqtclose: Starting shutdown sequence") # Disconnect callbacks self.pub.unregister() rospy.loginfo("odin rqtclose: Publishers unregistered") # Call parent super().shutdown_plugin() rospy.loginfo("odin rqtclose: Complete") If you see the first log but not the last, you’ve found a hang. Attach strace to the stuck rqt process (find PID via ps aux | grep rqt ):
import signal signal.signal(signal.SIGTERM, my_shutdown_handler) If that handler calls sys.exit() without cleaning up rqt , you’ll see rqtclose errors. Modify your rqt plugin’s shutdown_plugin() method:
Introduction: When Your ROS GUI Vanishes If you are a robotics software engineer working with the Robot Operating System (ROS), you have likely mastered the rqt suite—a powerful framework for graphical user interfaces (GUIs) that includes tools like rqt_graph , rqt_plot , and rqt_console . However, an obscure but critical error has been appearing in forums and debug logs: "odin rqtclose" .
trap cleanup EXIT rosrun rqt_gui rqt_gui & rqt_pid=$! wait $rqt_pid Example of a safe shutdown in a Python rqt plugin:
rosnode kill /rqt_gui_py_node_xxxx Then improve your shutdown logic to call rosnode kill on itself (not recommended) or fix the plugin. Fix 1 – Correct the Odin Wrapper Replace any kill -9 with kill -TERM and add a wait loop:
<node name="odin_gui" pkg="odin_viz" type="odin_rqt.py" /> Check odin_rqt.py for any custom signal handling. Specifically, search for:
rqt --force-discover --close-with-master The --close-with-master flag ensures rqt exits if the ROS master dies, preventing hangs. Outdated python-qt-binding or ros-kinetic-rqt-gui (or Melodic/Noetic) can cause shutdown deadlocks. Update:
rosnode list After rqtclose fails, run again. If the rqt node still appears, it’s still alive. Force-kill it:
def shutdown_plugin(self): rospy.loginfo("odin rqtclose: Starting shutdown sequence") # Disconnect callbacks self.pub.unregister() rospy.loginfo("odin rqtclose: Publishers unregistered") # Call parent super().shutdown_plugin() rospy.loginfo("odin rqtclose: Complete") If you see the first log but not the last, you’ve found a hang. Attach strace to the stuck rqt process (find PID via ps aux | grep rqt ):