ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Should the stamp be the time at which the message is sent

No, typically not.

("typically, as in some cases you actually do want to know when something was published, such as when you're writing a benchmark of the ROS middleware (essentially doing stamp(received)-stamp(sent)).

or the time of the event it is describing.

That would make the most sense when dealing with sensor data, yes.

I would make it slightly more generic: you'd set the field to the time at which something was generated or captured (not all publications have sensors as there sources).

And in case of algorithms that process sensor data, it's typically the case you'd copy the stamp field of the incoming message to the outgoing one, as that would allow you to correlate processed (or derived) data to other messages that were published at the time of the original data (example: correlating processed laser scans to odometry data).