0
$\begingroup$

Rosanswers logo

The node_interfaces (https://github.com/ros2/rclcpp/tree/master/rclcpp/include/rclcpp/node_interfaces) are really useful for dependency injection allowing much nicer tests. There however does not seem to be an interface that provides the method now. Is there a way to call that method without a node interface?


Originally posted by tylerjw on ROS Answers with karma: 83 on 2021-07-19

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I found that you can get a NodeClockInterface and gen call now like this: node_clock_interface->get_clock()->now()


Originally posted by tylerjw with karma: 83 on 2021-07-19

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.