ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Mon, 29 Oct 2018 10:21:53 -0500Why is inverse transform tf so wrong?https://answers.ros.org/question/307041/why-is-inverse-transform-tf-so-wrong/While trying to get the base_link footprint of the robot in utm coordinates, we discovered hughe jumps in the utm position. But in the simulation, the real change was only in the millimeter range.
We finally found the issue to be that we asked the inverse transform instead of the transform as it was published. Why is the inverse transform so wrong and not precise at all?
Below are the two transforms
$ rosrun tf tf_echo utm base_footprint
At time 6573.400
- Translation: [-691212.171, -5333943.315, -0.000]
- Rotation: in Quaternion [-0.000, -0.000, 0.036, 0.999]
in RPY (radian) [-0.000, -0.000, 0.071]
in RPY (degree) [-0.000, -0.000, 4.076]
At time 6574.400
- Translation: [-691212.169, -5333943.315, 0.000]
- Rotation: in Quaternion [-0.000, -0.000, 0.036, 0.999]
in RPY (radian) [-0.000, -0.000, 0.071]
in RPY (degree) [-0.000, -0.000, 4.076]
At time 6575.400
- Translation: [-691212.168, -5333943.315, 0.000]
- Rotation: in Quaternion [-0.000, -0.000, 0.036, 0.999]
in RPY (radian) [-0.000, -0.000, 0.071]
in RPY (degree) [-0.000, -0.000, 4.076]
$ rosrun tf tf_echo base_footprint utm
At time 6578.400
- Translation: [1068621.327, 5271316.154, 0.000]
- Rotation: in Quaternion [0.000, -0.000, -0.036, 0.999]
in RPY (radian) [0.000, 0.000, -0.071]
in RPY (degree) [0.000, 0.000, -4.076]
At time 6579.400
- Translation: [1068617.849, 5271316.859, -0.000]
- Rotation: in Quaternion [-0.000, 0.000, -0.036, 0.999]
in RPY (radian) [-0.000, 0.000, -0.071]
in RPY (degree) [-0.000, 0.000, -4.076]
At time 6580.400
- Translation: [1068614.338, 5271317.570, -0.000]
- Rotation: in Quaternion [-0.000, 0.000, -0.036, 0.999]
in RPY (radian) [-0.000, 0.000, -0.071]
in RPY (degree) [-0.000, 0.000, -4.076]
The same issue persists when using f2_tools echo.py.
Any ideas how to fix this?
**EDIT**
Afer checking the ideas in the comments of @lucaw, I got these results:
$ rosrun tf2_ros static_transform_publisher -691212.171 -5333943.5 -0.000 -0.000 -0.000 0.036 0.999 a b
$ rosrun tf tf_echo a b
At time 0.000
- Translation: [-691212.171, -5333943.500, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.036, 0.999]
in RPY (radian) [0.000, -0.000, 0.072]
in RPY (degree) [0.000, -0.000, 4.128]
$ rosrun tf tf_echo b a
At time 0.000
- Translation: [1072594.515, 5266650.647, 0.000]
- Rotation: in Quaternion [0.000, 0.000, -0.036, 0.999]
in RPY (radian) [0.000, 0.000, -0.072]
in RPY (degree) [0.000, 0.000, -4.128]
And using euler:
$ rosrun tf2_ros static_transform_publisher -691212.171 -5333943.5 -0.000 -0.000 -0.000 0.036 a b
$ rosrun tf tf_echo a b
At time 0.000
- Translation: [-691212.171, -5333943.500, 0.000]
- Rotation: in Quaternion [0.018, 0.000, 0.000, 1.000]
in RPY (radian) [0.036, -0.000, 0.000]
in RPY (degree) [2.063, -0.000, 0.000]
$ rosrun tf tf_echo b a
At time 0.000
- Translation: [691212.171, 5330487.478, -191980.492]
- Rotation: in Quaternion [-0.018, 0.000, 0.000, 1.000]
in RPY (radian) [-0.036, 0.000, 0.000]
in RPY (degree) [-2.063, 0.000, 0.000]
**RESULT: Eulers DO work, quaterions do NOT work.**
Any ideas how to fix the quaterions problem?123aaMon, 29 Oct 2018 10:21:53 -0500https://answers.ros.org/question/307041/