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

seeking clarity regarding the 'world_frame' parameter in ekf_localization node

asked 2021-02-17 15:47:06 -0500

updated 2021-02-18 10:02:20 -0500

I have spawned two husky bots (namespaced husky_1 and husky_2) in the Gazebo world. I am using two ekf_localization nodes (from the robot_localization package) to produce the husky_1/odom -> husky_1/base_link and husky_2/odom -> husky_2/base_link transform.

The ekf_localization node loads the parameters from a localization.yaml file.

This file has 2 parameters named odom_frame and world_frame. I understand what I need to set as odom_frame.

I am seeking clarity regarding what needs to be go in the world_frame parameter - when should we use odom and when should we use map?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2021-02-21 23:36:13 -0500

updated 2021-02-21 23:36:32 -0500

Strictly, per rep-105, the odom frame must be continuous whereas the map frame does not need to be. This is also explained by Tom Moore himself in his talk about robot_localization (around ~4:21)

edit flag offensive delete link more

Comments

exactly this. Problem with map as the world frame is, that the transformation between map and odom can jump based on localization algorithms.

Tristan9497 gravatar image Tristan9497  ( 2021-02-22 11:03:42 -0500 )edit

@Akhil Kurup what is the difference between the map_frame and the world_frame? If we are running a turtlebot simulation in Gazebo, what would be the values of map_frame and world_frame ?

skpro19 gravatar image skpro19  ( 2021-02-22 13:09:19 -0500 )edit

Agreed on your point, but is this what the question asked for?

JackB gravatar image JackB  ( 2021-02-22 13:21:23 -0500 )edit

@skpro19 take a look at the examples in their gihub repo They have a complete section about when you need to set which frame.

And like @JackB said u use /map for the world frame only if you want robot_localization to build the map->odom transform (This is usually the case when using gps). Then something else needs to build odom->base like another robot_localization instance with different inputs (like encoder, imu etc.).

Map_frame odom_frame and base_link_frame gives robot localization the base structure like defined in rep105, meaning map is the fixed frame that contains your map, odom is the frame where your robot publishes the odometry data base_link is obviously the base of your robot to which most sensors will be attached.

The additional world_frame specifies the frame to which robot_localization builds the transform and in your case probably odom

Tristan9497 gravatar image Tristan9497  ( 2021-02-22 15:38:06 -0500 )edit

@skpro19 the map frame and the world frame "can" be the same for a turtlebot sim in gazebo, but this depends on your application. Unfortunately, without knowing your use case, I cannot give you a generic answer. In larger applications, ones using GPS for example, the world frame can be something like utm whereas the map frame is the gps frame and the odom frame can be from robot_localization (continuous fusion).

@JackB I believe the last part of the question when should we use odom and when should we use map? is asking for clarification on when either frames are being used.

Akhil Kurup gravatar image Akhil Kurup  ( 2021-02-22 16:09:07 -0500 )edit
1

answered 2021-02-18 08:51:43 -0500

JackB gravatar image

It should be odom when when you want to generate the odom->base_link tf and it should be map when you want to generate the map->odom tf.

This is spelled out in the docs.

Cheers! JB

edit flag offensive delete link more

Comments

Would be there be a difference in the transform published by the ekf_localization node in the two cases? What I mean is, would the ekf_localization node publish odom ->base_link transform in one case, and map -> base_link transform in the other?

skpro19 gravatar image skpro19  ( 2021-02-18 10:34:39 -0500 )edit

By convention you should never publish map -> base link directly. I answered that exactly in my answer.

It should be odom when when you want to generate the odom->base_link tf and it should be map when you want to generate the map->odom tf.
JackB gravatar image JackB  ( 2021-02-18 10:36:18 -0500 )edit
1

The docs say the following about the publish_tf parameter -

If true, the state estimation node will publish the transform from the frame specified by the world_frame parameter to the frame specified by the base_link_frame parameter. Defaults to true.

So, if we set the world_frame as /map, then the ekf_localization node would (by default) publish the /map -> /base_link transform.

skpro19 gravatar image skpro19  ( 2021-02-19 09:23:34 -0500 )edit
1

That is a very good point. I could be 2000% wrong, but in my experience that is not how it works OR is intended to work. I made a PR to the docs That either is correct, or will get rejected with an explanation that makes clear what actually happens or why it works this way.

JackB gravatar image JackB  ( 2021-02-19 09:43:49 -0500 )edit
  • There's also a map_frame parameter defined in the docs. I understand that it doesn't need to be used when we are operating our bot in the odom frame.

  • What happens in the case of navigation using a map? Do we need to define both the map_frame and the world_frame parameters? If yes, do we set both of them to map ?

skpro19 gravatar image skpro19  ( 2021-02-19 10:23:32 -0500 )edit
1

@skpro19 see the updated docs regarding the publish_tf parameter.

JackB gravatar image JackB  ( 2021-02-22 07:59:24 -0500 )edit

@JackB okay :-) So, if we have set the world_frame as map_frame, we would need to use another instance of ekf_localization to produce the odom -> base_link transform?

skpro19 gravatar image skpro19  ( 2021-02-22 13:06:57 -0500 )edit

Also, I think, I would post a new question seeking clarification regarding world_frame vs map_frame parameters in the case of ekf_localization.

skpro19 gravatar image skpro19  ( 2021-02-22 13:07:52 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-02-17 15:47:06 -0500

Seen: 165 times

Last updated: Feb 21 '21