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

Revision history [back]

click to hide/show revision 1
initial version

The second node's task is to estimate distance to each of detected objects. It subscribes to the first node but it also needs sensor information (Lidar scan and RBGD image) in order to estimate distance. That's why I need a Cache: to be able to store sensor data and retrieve a sample that corresponds to the timestamp of analyzed image.

So if I understand you correctly, you have:

  • node 1: takes in camera image, outputs (a list of) detected/identified objects
  • node 2: takes in laserscan, rgbd and (lists of) detected/identified objects, outputs: estimated distances

if this is correct, wouldn't it make sense to:

  • have node 1 publish its messages with the timestamp of the incoming image (in which the objects were detected)
  • have node 2 synch all three topics (ie: laserscan, rgbd and (lists of) detected/identified objects) and always process the three-tuple?

No Cache needed, and you still have access to the LaserScan and RGBD data which corresponds to the RGB image's stamps in which the objects were detected.


The main point here is: if processing sensor data, think carefully about which timestamp you should associate with the results of that processing. For things like object recognition based on images (or laserscans, lidar, pointclouds, whatever) it's often desirable to associate the timestamp of the original sensor data with the output, as it allows matching the objects with other sensor data captured at the same time.