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 templated tf2::Stamped<> template is basically the same as tf::Stamped<> template.

I think what you're looking for is the tf2::TransformStorage (link) to compare with the tf::StampedTransform (link)

geometry_msgs::TransformStamped tf = ...;
tf2::toMsg(tf2::fromMsg(tf)) == tf // doesn't hold

This is a bug in the converters, conversions should hold bidirectionally. I don't know which implemenation you're including but guessing it's the default one. It looks like that implementation should really be using the tf2::TransformStorage not the templated version as that isn't the fully value. https://github.com/ros/geometry2/blob/d714a6534d9d1f81df8d460c1615f854faf7882e/tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.h#L684

If you could double check that you're using the default implementation in your includes and then open an issue that would be great. Or even better a PR. I think that the best approach would be to add a warning due to the data loss and deprecation note to the existing implementations and create a new parallel template specialization for the TransformStorage.

I'll need to do some checking about how to bias the template selection in cases like your example above where it's not specified both ways so that we can get the new implementation first if the value is not entirely there.