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

Default transform direction if tf2?

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

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.

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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

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

Related: https://answers.ros.org/question/2294...

edit flag offensive delete link more

Comments

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 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 309 times

Last updated: Dec 17 '20