ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

When use_sim_time is enabled, RCL_ROS_TIME type clock will use time source from topic /clock.

But we have to attach the rcrclcpp::Clock(RCL_ROS_TIME) to one ros node(and furthor one executor) to be able subscibe to topic /clock and update simulated time stored in RCL_ROS_TIME clock instance. According to this understanding, we can also conclude that, as long as the attached node and executor is not spin()ing, the simulated clock won't be updated.

That's the behavior of node_->get_clock().

A standalone rcrclcpp::Clock(RCL_ROS_TIME) have no way to subscribe to topic /clock, then as a fallback strategy, it will behave like a RCL_SYSTEM_TIME type clock.