0
$\begingroup$

Rosanswers logo

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!


Originally posted by rblilja on ROS Answers with karma: 35 on 2020-12-17

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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/229463/confusing-tf-transforms/


Originally posted by tfoote with karma: 58457 on 2020-12-17

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by rblilja on 2020-12-18:
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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.