relationship between tf rotation and translation ?

asked 2016-08-28 22:11:35 -0600

chengwei gravatar image
 $rosrun tf tf_echo /map /odom
 At time 1263248513.809
 - Translation: [2.398, 6.783, 0.000]
 - Rotation: in Quaternion [0.000, 0.000, -0.707, 0.707]
             in RPY [0.000, -0.000, -1.570]
  • For translation value and rotation quaternion value, is translation happening in original frame and then rotation happens? Or, does it rotate first and then the translation happens?
  • What is the convention used by tf system? Which RPY convention is RPY using?
  • For a static_transform_publisher,just as :

    <node pkg="tf" type="static_transform_publisher" name="link_broadcaster" args="0.1 0 0.3 -1.571 0 1.571 base_link laser 25" />,

    can I break it down into two static_transform_publisher as fellows:

    <node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="0.1 0 0.3 0 0 0 temp_link laser 25" />

    <node pkg="tf" type="static_transform_publisher" name="link2_broadcaster" args="0 0 0 -1.571 0 1.571 base_link temp_link 25" />

Is that a right decomposition?

And how about :

<node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="0 0 0 -1.571 0 1.571 temp_link laser 25" />

<node pkg="tf" type="static_transform_publisher" name="link2_broadcaster" args="0.1 0 0.3 0 0 0 base_link temp_link 25" />

Any help is appreciated. Thank you in advance.

edit retag flag offensive close merge delete

Comments

The translation is applied first, then the rotation (as it would be in a standard 4x4 transformation matrix in homogeneous coordinates). Rather than use static_transform_publisher, why not create a URDF and then run robot_state_publisher and joint_state_publisher to publish the transforms?

Mark Rose gravatar image Mark Rose  ( 2016-08-31 10:51:56 -0600 )edit

Hi, Mark Rose, Thanks for your reply ! I'll take a look at URDF,but I still don't understand the defference between overall and decomposition about static_transform_publisher as above. If you know the difference ,would you tell me something about it.Thank you in advance!

chengwei gravatar image chengwei  ( 2016-09-08 02:01:15 -0600 )edit

If you create a URDF model, you then use robot_state_publisher and joint_state_publisher to jointly publish the status transforms. You don't need static_transform_publisher unless you have some other transform that isn't reflected in the URDF. The standard frame is X forward, Y left, Z up.

Mark Rose gravatar image Mark Rose  ( 2016-09-08 02:48:05 -0600 )edit

Hi,Mark Rose,I have tried to use robot_state_publisher in stead of static_transform_publisher . I learned the urdf tutorial, but I have some question about the robot_state_publisher .

chengwei gravatar image chengwei  ( 2016-09-11 01:58:54 -0600 )edit

my test.urdf

<robot name="test_robot">
              <link name="base_link" />
              <link name="optical_link" />     
          <joint name="joint1" type="fixed">
            <parent link="base_link"/>
            <child link="optical_link"/>
            <origin xyz="0 0 0" rpy="0 1.57 0.5"
chengwei gravatar image chengwei  ( 2016-09-11 01:59:29 -0600 )edit

my launch file is as fellows:

<launch>
              <param name="robot_description" command="cat $(find r2d2)/test.urdf" />
             <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />

      </launch>
chengwei gravatar image chengwei  ( 2016-09-11 02:02:22 -0600 )edit

I run the launch file rosrun r2d2 test.launch , but I don't get the TF use rostopic echo /tf,The screen output as follows

transforms: []

transforms: []

transforms: []

chengwei gravatar image chengwei  ( 2016-09-11 02:08:29 -0600 )edit

hey mark, from my understanding the rotation is applied first and then the translation takes place on the new axis.

Ridhwanluthra gravatar image Ridhwanluthra  ( 2018-06-02 02:39:40 -0600 )edit