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

Time Synchronization with headerless messages

asked 2018-10-04 14:05:53 -0600

roskinetic gravatar image

updated 2021-10-31 14:22:03 -0600

lucasw gravatar image

Hi, I am new to ROS and have a question about time synchronization.

I am trying to synchronize Velodyne Lidar data with other data collected from multiple sensors (all float data).

I created a node to receive the multiple data and each data is a single float number.

As Time Synchronizer in ros takes specific data type such as PointCloud2 and Image with timestamp header, it doesn't take std_msgs type. (Initially, I read the multiple data in std_msgs in a single node but it can't synchronize due to the data type)

I was wondering how to synchronize those multiple data. Can I still use PointCloud2 or Image without creating custom message?

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-10-31 14:20:15 -0600

lucasw gravatar image

rospy has an allow_headerlessoption that uses the time of message arrival according to http://wiki.ros.org/message_filters#A..., but I suspect you want C++ to handle lidar data.

Ideally you could modify the publishers of the floats to use marti_common_msgs/Float64Stamped or similarly stamped messages, or you would introduce intervening nodes that listen to the regular std_msgs Floats and then republish them with headers with the current time. You may want to add a rosparam or better yet dynamic reconfigure param to subtract a little time from arrival time as a manual tuning mechanism, though that is hacky and brittle if you change your system and more or less latency is introduced, otherwise put the conversion nodes as close to the originator of the float data as possible (on the same computer).

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2018-10-04 14:05:53 -0600

Seen: 893 times

Last updated: Oct 31 '21