Velodyne UDP packets, ROS messages, and PCD files: Where does the time go?
Here is what I understand about the tool chain that turns Velodyne UDP packets into PCD files:
- (input.cc) ROS sits in a poll() loop and collects Velodyne UDP packets from the network. It wraps each packet payload in a VelodynePacket object and sets the time stamp on the new object to the time the payload was received.
- (driver.cc) Many VelodynePacket objects are buffered before sending them on as a VelodyneScan object. The new object gets the time stamp of the last VelodynePacket that it holds.
- (convert.cc, transform.cc) Various subscribers receive the VelodyneScan objects and re-publish them as PointCloud2 objects, one per scan. They all do pretty much the same thing: Iterate over the scan -- oldest to newest -- while calling RawData::unpack() on every VelodynePacket. The final PointCloud2 objects contain points ordered from oldest to newest -- minus some filtering; see next -- and are guaranteed not to contain any partial UDP payloads. Their time stamps are copied from their respective VelodyneScan objects.
- (rawdata.cc) The unpack() method is where the UDP payloads actually get parsed. The payloads contain each laser return in terms of distance, and unpack() turns distance into (x, y, z) location. Not all the points in each payload are reported as some violate angle and range constraints.
- (bag_to_pcd.cc) This executable pulls PointCloud2 messages off a ROS bag and turns them into PCD files. No substantive processing is involved; it's all I/O. Each PCD file represents a single PointCloud2 message, with its time stamp given in the PCD file name.
Questions
- Have I misunderstood anything in here?
- How meaningful are the PCD file names -- eg, the VelodyneScan time stamps -- in a realtime sense?