Buffed messages get the same timestamp

asked 2020-06-30 05:45:21 -0500

thanasis_t gravatar image


I am publishing cartesian coordinates expressed in a camera frame into a topic (let's call it cart_topic) and a subscriber receives the coordinates and transforms them into a base_link frame. The subscriber node creates a Listener object which receives the transformation from the camera frame to the base_link frame using the waitForTransform() function. This function gets called inside the callback and therefore it blocks the functionality till the transformation is available (let us assume that the transformation exists and no exception occurs). In the meantime data is published into the cart_topic and is stored in the buffer till the tf transformation is available and the callback is no longer blocked. In each transformed point, a timestamp is given using ros::Time::now(). The problem is that the data stored in the buffer get the same timestamp while the rest get different timestamps, as expected. My question is why would a delay inside the callback affect the output of the ros::Time::now() for the stored points? Do stored points get processed simultaneously in different threads and therefore the exact same timestamp is received or something similar? Furthermore, is there any way to resolve this issue? Thank you a lot in advance and let me know if there is any additional information I could provide.

edit retag flag offensive close merge delete