ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
They should be passed in relative to the parent frame.
For example, you have base_link, located at (0, 0, 0) with a roll, pitch, and yaw of (0, 0, 0). Let's say that your sensor is located 1 meter in front of your robot, and it is inverted (upside down). Then, you would set the transform origin to (1, 0, 0) with RPY of (0, M_PI, 0).
tf::Transform xform;
xform.setOrigin(tf::Vector3(1.0, 0, 0));
xform.setRotation(tf::createQuaternionFromRPY(0, M_PI, 0));
If the sensor were located behind the robot, it would be:
tf::Transform xform;
xform.setOrigin(tf::Vector3(-1.0, 0, 0));
xform.setRotation(tf::createQuaternionFromRPY(0, M_PI, 0));