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

ros::time corresponding to message sent

asked 2018-06-02 20:12:49 -0500

Nick30075 gravatar image

updated 2018-06-02 20:39:26 -0500

Is there a way to recover the ROS time when a message was sent? I'm doing some clock synchronization with another package with custom messages that don't include a ros time in the message definition. With network latency and whatnot, I can't get use ros::Time::now() for synchronization.

EDIT: The ros time of receipt within a rosbag would also be a help, if there's a way to recover it.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-06-03 05:24:44 -0500

gvdhoorn gravatar image

No, afaik the time a message was published is only available if the sender has added that to the message (and even then it's an approximation, as they will probably use ros::Time::now().

The MessageEvent class can provide you with some additional information, such as when a message was received (by your node), but not when it was sent unfortunately.

Also see wiki/ROS/Connection Header for some more fields that can be accessed that way.

I'm doing some clock synchronization with another package with custom messages that don't include a ros time in the message definition.

To synchronise data between nodes a Header (or similar structure) is required, and I would say, is actually exactly what it was intended for. But you probably already knew that.

EDIT: The ros time of receipt within a rosbag would also be a help, if there's a way to recover it.

See #q199941.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2018-06-02 20:12:49 -0500

Seen: 1,921 times

Last updated: Jun 03 '18