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 ...
Can you duplicate the issue with a static transform publisher like:
When I enter the transform as rpy it seems fine (the echoed quaternion is -0.035 0 0 0.999 instead though), but using a quaternion as you have gets results like yours.