Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Subscribe to gazebo topic on ROS topic connection
We are currently subscribing to the /gazebo/performance_metrics topic even if there are no subscribers to the ROS topic forwarding this data. This changes gazebo_ros_init to only subscribe to the gazebo topic if there are any subscribers to the corresponding ROS topic. While advertiser callbacks are used in ROS 1 but are not yet in ROS2, here we use polling in the GazeboRosInitPrivate::PublishSimTime callback to check for subscribers since it is called for each Gazebo time step. This also helps workaround the deadlock documented in ros-simulation#1175 and gazebosim/gazebo-classic#2902. Signed-off-by: Steve Peters <scpeters@openrobotics.org>
- Loading branch information