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

What time should i use for ros messages?

asked 2019-10-16 16:45:36 -0600

Enmar gravatar image

This is a general question about ROS messages, but for the sake of the question i will use point clouds.

Lets say my lidar obtains a point cloud at time t=0 sec.

Now i do some processing on the point cloud (apply some transforms and filtering) and my code returns the modified point cloud at time t=1 sec (time delay due to processing exaggerated). For my first cloud the header time reads "0 sec" should my new cloud (which has been processed) have the current time of publishing (t=1) or the time of the original cloud (t=0)? It is essentially the same cloud but from another perspective but I do not know if placing old times on new messages affects ros looking into the past. Putting the current time is also a problem because by "1s" the transforms could have changed and any further processing would be offset in time.

If anyone could share their insight it would be much appreciated

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-10-16 17:32:21 -0600

Jari gravatar image

I would keep the timestamp as 0 in your example (i.e. the time the underlying data was first generated). One big reason for this is TF. Ideally you want other applications that might use your pointcloud to get the correct transforms associated with it, which they would resolve using the TF tree, which in turn would pull up an interpolated transform from a TF buffer. As such keeping the original time stamp is the best strategy and will lead to the least amount of pain down the line.

edit flag offensive delete link more

Comments

1

Yep, typically you want the header time to reflect the time of validity or time of capture for the sensor, which makes integration with other sensors with varying latency possible.

I think if you were interested in instrumenting (say to compute latency) you would want to add an additional timestamp field/message/topic to capture that information.

mjcarroll gravatar image mjcarroll  ( 2019-10-17 11:28:51 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2019-10-16 16:45:36 -0600

Seen: 592 times

Last updated: Oct 16 '19