Ask Your Question

Header stamp: When is/should this be from?

asked 2019-11-22 05:36:09 -0600

Many messages in ROS include the header, which includes the timestamp.

What is best/expected practice for this? Should the stamp be the time at which the message is sent or the time of the event it is describing.

In particular most nav_msgs and sensor_msgs have headers. It would be my assumption that nav_msgs/odom would be stamped with the instant at which data were taken from the wheel encoders. Likewise, sensor_msgs/LaserScan would be stamped with some time consistently offset with the start of the rev of the scanner. This would then allow odometry and sensor data to be accurately fused.

Is this the case?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-11-22 06:32:48 -0600

gvdhoorn gravatar image

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).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-11-22 05:36:09 -0600

Seen: 199 times

Last updated: Nov 22 '19