Ask Your Question

Revision history [back]

Looking at the source code for both, I believe they are the same:

For rcrclcpp::Clock(RCL_ROS_TIME).now() source code: https://docs.ros2.y org/foxy/api/rclcpp/clock_8hpp_source.html

And for node_->get_clock()->now() source code: https://docs.ros2.org/dashing/api/rclcpp/node_8hpp_source.html

Both are declared the same way:

 RCLCPP_PUBLIC
   Time
   now()

The only difference I see is the first one is more direct method .