store transforms for offline/batch usage

asked 2019-05-24 20:02:25 -0500

sisyphus gravatar image

My robot is publishing kinect imagery, localization info, and transforms. I would like to record a bagfile for offline image processing and I need to publish/store/compute the transforms for each image (i.e., the transform from the camera frame to the map frame at the exact time the image was captured)

I found an old python module (tf_bags) that claims to do what I want. However, cannot seem to incorporate my static transform. I tried to manually construct a TransformerROS object using the /tf and /tf_static messages, populating new StampedTransform objects - didn't work. I tried doing the matrix multiplications myself, but I was unable to sanity check my results (e.g. make baselink->odom * odom->map = baselink->odom->map).

I tried creating a node that subscribes to the image topic and publishes the transform at TransformListener.lookupTransform at the timestamp of each. I actually get some output but it is missing a ton of values, anywhere from 30-90% frames dropped by varying things like --rate/cache/waitForTransform values. (image topic is 20hz QHD, if it matters)

Any ideas? I'm a ROS-novice but it seems like this should be easy to solve because the data is all there.

edit retag flag offensive close merge delete