Time Synchronization with headerless messages
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!
Asked by roskinetic on 2018-10-04 14:05:53 UTC
Answers
rospy has an allow_headerless
option that uses the time of message arrival according to http://wiki.ros.org/message_filters#ApproximateTime_Policy, 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).
Asked by lucasw on 2021-10-31 14:20:15 UTC
Comments