get wall time in callback function of publisher in ROS2

asked 2019-08-06 02:39:57 -0500

I want to use the time in the callback function to publish a pre-determined (interpolated table). The Node should provide a now() function but I am doing something wrong . How to get the time ? if I define Time ros_time and then do ros_time = now() or ros_time = this->now() it does not work.

edit retag flag offensive close merge delete

Comments

"does not work" is not a sufficient description of a problem. We cannot help you like this.

Does it not compile? If so: show a verbatim copy-paste of the compilation error.

Does it not return the (correct) time at runtime? If so: show an MWE that exhibits the problem.

gvdhoorn gravatar image gvdhoorn  ( 2019-08-06 10:09:27 -0500 )edit