ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

robot_localization: Should the odom_frame be equal to the frame_id field specified in the header of the odometry input message?

asked 2022-07-12 05:48:40 -0500

Roberto Z. gravatar image

updated 2022-07-12 06:05:48 -0500

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 robot_localization to compute and broadcast as TF from base_link as explained below).

Using robot_localization I set world_frame: filtered_odom_frame and publish_tf: true because I need robot_localization 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 world_frame parameter must match either the odom_frame 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 odom_frame be equal to the frame_id 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 robot_localization would be noisy_odom->base_link which is a missleading frame name because the TF represents filtered/fused data.

So, must comply with the restriction that the odom_frame must be equal to the frame_id 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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-07-12 06:32:37 -0500

Roberto Z. gravatar image

updated 2022-07-12 06:33:39 -0500

This question here:

https://answers.ros.org/question/2830...

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.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2022-07-12 05:48:40 -0500

Seen: 57 times

Last updated: Jul 12 '22