How to obtain time stamps for messages with no header
Hi all,
I have a simple question.
My problem is the following. I am listening to the move_base/cancel topic because I want to know the exact time at which a certain goal has been canceled.
The message I get from this topic is not of the stamped type. I guess that a simple solution would to call:
ros::Time stamp = ros::Time::now();
as first line of the callback.
However, I guess that the time this call is executed is not the same when the message has been sent.
For this reason, I was considering the idea of using a timer combined with a waitForMessage call.
Therefore, my question is: does this make sense? If yes, how do I obtain the time stamp?
Thanks.
As far as I'm aware, if a message doesn't have a header (or timestamp anywhere else) then it is not possible to determine when it was sent. Without a header the best you'll be able to do is what you've already got recording the time of receipt.