robot_localization: Should the odom_frame be equal to the frame_id field specified in the header of the odometry input message?
Background info:
I am working on a simulated robot in Gazebo and I currently adding odometry noise to the odometry published by the Gazebo plugin and then fusing that noisy odometry with IMU data to get an filtered/fused odometry message and transform using robot_localization.
To publish a noisy odometry I run a custom node that subscribes to the odometry message /odom
from Gazebo, adds noise and publishes a new odometry message to the /noisy_odom
topic. This node can also publish a TF from the robot's base_link
frame to a frame that I call noisy_odom
(but I have disabled that TF since I want since robotlocalization to compute and broadcast as TF from `baselink` as explained below).
Using robotlocalization I set `worldframe: filteredodomframeand
publishtf: true` because I need **robotlocalization** to produce filtered data as a TF in order to be able to input it to AMCL. I also want that TF to have a frame name that is descriptive and distinguishable from other TF frames such as odom and noisy_odom.
I read here that the value of the worldframe parameter must match either the odomframe or the map_frame parameter. Since I want a local estimate I set odom_frame: filtered_odom_frame
.
In summary I am using this configuration:
odom_frame: filtered_odom_frame
world_frame: filtered_odom_frame
publish_tf: true
However this configuration does not match the frame_id
field specified in the header of the odometry input message, which is "noisy_odom".
Therefore my question is: Should the odomframe be equal to the frameid of the odometry input message?
Is is ok that they differ, or am I messing things up?
I am not getting any error messages.
In the example above if it set it equal to the frame_id
field specified in the header of the odometry input message I would need to configure robot_localization like so:
odom_frame: noisy_odom
world_frame: noisy_odom
publish_tf: true
An the TF broadcasted by robotlocalization would be **noisyodom->base_link** which is a missleading frame name because the TF represents filtered/fused data.
So, must comply with the restriction that the odomframe must be equal to the frameid field specified in the header of the odometry input message?
And how do I set a TF frame name that is descriptive and distinguishable from other TF frames in the event that this was true?
I really appreciate any help you can provide.
Asked by Roberto Z. on 2022-07-12 05:48:40 UTC
Answers
This question here:
https://answers.ros.org/question/283090/robot_localization-odom-topics-frame_ids-and-tfs/
states that odometry messages from Gazebo have set frame_id
to odom and therefore this configuration is correct odom_frame: odom
.
In consequence it seems that you cannot have a different TF frame name published by robot_localization
even through the broadcasted TF is not exactly equal tothe original TF since it is a TF that contains fused/filtered data.
Asked by Roberto Z. on 2022-07-12 06:32:37 UTC
Comments