You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ros2: Only subscribe to /gazebo/performance_metrics when necessary (#1205)
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 #1175 and
gazebosim/gazebo-classic#2902.
This also adds a macro to reduce duplication of the version checking
logic.
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
0 commit comments