ros / geometry2

A set of ROS packages for keeping track of coordinate transforms.
190 stars 275 forks source link

Implementation of doTransform for tf2 datatypes #398

Open timonegk opened 5 years ago

timonegk commented 5 years ago

Apparently, it is not possible to transform the tf2::Quaternion, tf2::Vector3, tf2::Pose, etc. data types via doTransform (or transform). Is there a specific reason for that? I see that for many applications, especially those using a large amount of linear algebra, the usage of a library like Eigen makes sense. But an extra library should not be necessary to use the basic functionality, I guess? The implementation would basically be what is done in tf2_geometry_msgs.h, but without the fromMsg/toMsg parts. But maybe there is a reason for the current state that I just don't see?

tfoote commented 5 years ago

It would be possible to add the doTransform abstraction but if you're already in tf2 datatypes you can just use the * operator.

tf2::Vector3 out = tf2::Transform foo * tf2::Vector3 in

In general the tf2 datatypes were targeted to be used mostly internally and externally it was recommended to use your own datatypes, eigen, bullet etc. But I wouldn't be opposed to adding support for the abstraction as that cat has gotten out of the bag quite completely. And then people could use the same patterns for the tf2 datatypes as well.