tf synchronization
Hi! I am trying to synchronize a camera input with an servo with no feedback and the tf library. More specifically:
1) There is a camera (cameraNode) that asynchronously (with a ros::timer) takes pictures and posts them at a ROS topic with a timestamp.
2) There is a node (servoNode) that controls a servo and some other hardware, that has no feedback.
3) There is a node (armNode) that controls a set of motors (and the servo through servoNode) and publishers tf transforms with their positions.
4) There is a node (visionNode) that processes the images and publishers results about the images (with the image timestamp).
5) There is a node (dataNode) that receives the results and time-travels (with tf) to obtain actual points in a coordinate system.
All these seem to work fine individually, but there are times that the camera takes a picture just before the servoNode returns and the armNode publishes the new tf transformation. Then the dataNode when it uses the lookupTransform (with the camera timestamp) gets a transformation that is not correct. How could these be synchronized? Should the armNode stop broadcasting tf transforms (and if yes, how would that change the dataNode's ability for correct transformation)?
Using a tf::MessageFilter doesn't seem right because tf transforms might be sent just before the servos started moving and the camera might take up to 200ms to take a picture. Any suggestions?