ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Default transform direction if tf2?

asked 2020-12-17 16:54:26 -0600

rblilja gravatar image

I'm instantiating a tf2::Quaternion from a custom quaternion (scalar first) defined as the rotation of a vector from inertial to body coordinate system. In the next step I'm instantiating a tf2::Matrix3x3 from said tf2::Quaternion. The DCM I obtain seems to have the opposite coordinate transform direction i.e. going from body to inertial. Is this transform direction default in tf2?

I have tracked down the 'setRotation(const Quaternion& q)' function in Matrix3x3.h that is used in the tf2::Matrix3x3 constructor taking a tf2::Quaternion as an argument. But I'm not sure how to deduce the coordinate transform direction. Perhaps someone can shed some light on this - or just point out if have gotten everything backwards.

I'm on ROS2 Foxy if that matters.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-12-17 19:09:24 -0600

tfoote gravatar image

The api is defined using the source and target frames. The result will transform data from the source frame to the target frame.

This is the inverse of the transform to take the source frame to the target frame


edit flag offensive delete link more


As a clarification I'm not using any transform function (as discussed in the link). Just multiplication i.e. Vt = Rts * Vs, where Vs and Vt are column vectors and Rts the rotation matrix taking a vector with coordinates in the s-system and expressing it with coordinates in the t-system.

rblilja gravatar image rblilja  ( 2020-12-18 02:11:02 -0600 )edit

Question Tools

1 follower


Asked: 2020-12-17 16:54:12 -0600

Seen: 232 times

Last updated: Dec 17 '20