Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gazebo_ros scripts signal handling and do not load the gazebo_ros_api_plugin into the gzclient #1452

Open
wants to merge 3 commits into
base: noetic-devel
Choose a base branch
from

Conversation

meyerj
Copy link
Contributor

@meyerj meyerj commented Feb 2, 2023

  • Use exec where appropriate, such that signals send by roslaunch are received directly by the gzserver or gzclient processes and do not have to be forwarded by the shell explicitly.

  • Apply the $gzserver_pid variable saved earlier instead of $! in the all-in-one gazeboscript to kill the server process once the client terminates. The old version should also have been fine, because$!is the pid of the last _background_ process. Before, variablegzserver_pid` was unused.

  • With the gzclient script the gazebo_ros_api_plugin was also loaded into the client process. That plugin creates the /gazebo ROS node, and hence two identical nodes are spawned. Launching the client like that broke the ROS API of Gazebo for us, including /clock publishing, at least once the GUI would be closed.

    The gzclient script is also what is executed by the launch files in package gazebo_ros if argument gui:=true (the default). In this case the node names do not clash because roslaunch overwrites the default node name with /gazebo_gui, but still it is probably unintended to load the plugin into the GUI at all, I assume.

This patch eventually fixes #751?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gzserver not dying after killing the simulation
1 participant