DukeRobotics / robosub-ros

ROS system to control a robot for the RoboSub Competition.
https://duke-robotics.com
29 stars 26 forks source link

Fix crashing GUI on launch shutdown #360

Closed ShaanGondalia closed 1 year ago

ShaanGondalia commented 1 year ago

Background

311 Added a gui to our software stack to add a ui for managing our robot. Part of this ui is the systems plugin, which can be used to start/stop launch files and ROS nodes. We encountered a bug that causes the entire gui to crash under certain circumstances when stopping launch files. The error message looks like:

[gui-1] process has died [pid 4351, exit code -11, cmd /opt/ros/noetic/lib/rqt_gui/rqt_gui --perspective-file /root/dev/robosub-ros/landside/catkin_ws/src/gui/config/robosub_ros_gui.perspective __name:=gui __log:=/root/.ros/log/361052e6-4f06-11ed-9358-0242c0a80101/gui-1.log].
log file: /root/.ros/log/361052e6-4f06-11ed-9358-0242c0a80101/gui-1*.log

We need to investigate why this is happening and resolve it. It currently doesn't break any functionality, but is very unfriendly for users.

Important Notes

How to recreate the bug (taken from this discussion):

This happens when running certain launch files. I haven't been able to find the root cause, but it doesn't seem to be an issue with the remote_launch.py script. The process shuts down correctly and delete_launch is also successful, but somewhere later down the line the gui segfaults. I really have no clue what it is. To reproduce:

  1. Run roslaunch system_utils remote_launch.launch
  2. Run roslaunch gui gui.launch
  3. Run simulation and enable simulation mode in gui
  4. Start motion.launch from gui
  5. Publish a desired pose from gui
  6. Enable & disable controls
  7. Attempting to stop motion.launch crashes the gui

Something similar happens to tasks.launch. The only lead I have is that if there is an [error] message in the roslaunch system_utils remote_launch.launch tab during shutdown the gui is more likely to crash, but this isn't always the case.

For starters, take a look at remote_launch.py and system_widget.py

Tasks

vedarshshah commented 1 year ago

Task planning GUI has been sparingly used, so we don't know if this issue still exists or has been fixed. We are now moving away from RQT and rebuilding the GUI in Foxglove, so this issue is not relevant.