get wall time in callback function of publisher in ROS2
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.
"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.