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

order of translation vs rotation in static_transform_publisher

asked 2018-05-31 09:05:58 -0600

Ridhwanluthra gravatar image

updated 2018-06-02 02:49:01 -0600

I am playing a rosbag containing pointclouds on kinetic. I need to set the tf so that it is at a decent location to the Panda robot for some task.

The following is the relevant line from my launch file that set the static transform

<node pkg="tf" type="static_transform_publisher" name="to_panda_base" args="0 0 2 0 0.2 1.92 camera_rgb_optical_frame panda_link0 100" />

When running the code like this (with translation and rotation given) the result is:

At time 1527473959.781
- Translation: [0.397, -1.842, 0.671]
- Rotation: in Quaternion [-0.815, -0.057, 0.082, 0.571]
            in RPY (radian) [-1.914, 0.068, 0.188]
            in RPY (degree) [-109.640, 3.898, 10.784]

The issue is that if both rotation and translation are given which is applied first. one of the comments here mentions that the translation takes place first.

Any help is greatly appreciated. Thank you in advance.

edit retag flag offensive close merge delete

Comments

What is weird about this exactly?

gvdhoorn gravatar image gvdhoorn  ( 2018-05-31 09:59:32 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-05-31 10:58:15 -0600

v4hn gravatar image

This is expected behavior, but I guess you wanted to see the same numbers and just accidentally printed the transform the wrong way around.

rosrun tf tf_echo camera panda vs rosrun tf tf_echo panda camera

edit flag offensive delete link more

Comments

Ya that was one of the issues. The major problem that I had was because I read in a comment on this question that the translation is applied first and then the rotation takes place but that was not the case.

Ridhwanluthra gravatar image Ridhwanluthra  ( 2018-06-02 02:42:23 -0600 )edit

Translation does take place first, where the parent frame is the first frame argument to static_transform_publisher (camera) and the child is the second (panda). You can see the parent child relationship with rostopic echo /tf.

lucasw gravatar image lucasw  ( 2018-06-04 09:38:26 -0600 )edit

Also use the tf plugin in rviz (set fixed frame to the parent), and perhaps experiment with splitting your transform into a translation and a rotation (with a new intermediate frame between them) and play with order that way and observe the results in rviz.

lucasw gravatar image lucasw  ( 2018-06-04 09:39:16 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-05-31 09:05:58 -0600

Seen: 1,281 times

Last updated: Jun 02 '18