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

tf2 cannot support non-linear transforms. No coordinate frames are special for it, they're all expected to be euclidian space with SO3 rotation.

It is possible to transform to a non-euclidian space, and transform back. However when you do that you cannot rely on any of the existing transform methods as they would all have to have logic to operate in the non-euclidian space for all datatypes defined, and have knowlege of what projection they are operating in which is not available generically.

The toMsg()/fromMsg() constructs are for converting equivalent datatypes and require a bijective transformation. THis is for converting datatypes(like from a Point message to a bullet::Vector3, and not transforming the data.

Going to and from a non-euclidian space cannot be done without external references knowing things like the shape of the manifold etc.

The simplest way to do this conversion is to just have a function that converts your projection into an Earth Centered Earth Fixed (ECEF) coordinate frame and make sure to publish that transform into the tf system. If you want to go the other way you would have to converted to your ECEF frame and run the inverse transform function.

As an improvement for ease of use, you could add a transform listener/buffer inside a class which provides the above and possibly even lets you select other target frames for the output and apply the appropriate transform via a query to the buffer. Going the other way it could ingest any incoming point apply the transform automatically to take it to ECEF and then convert it to your preferred projection.