Meaning of world frame / coordinates in the context of costmaps
I've read a couple of Q&As here regarding the meaning of world
frame, as well as REP 105, "Coordinate Frames for Mobile Platforms". I'm still in need of a clarification, especially in the context of costmaps. Let's use an example:
The WorldModel
and CostmapModel
classes have a member function called footprintCost
(see, e.g., the declaration in baselocalplanner/costmap_model.h) The documentation says:
@param position The position of the robot in world coordinates
What is the world
frame in this case? Is it the costmap's global_frame
, e.g., odom
if it's a local costmap? If so, why is there a distinction between world and global?
It seems to me like the world
frame is defined relative to some specific context (e.g. a costmap, or a pose estimation scheme). It's not an actually fixed frame in "the world". Is this a good way to think about it? Thanks!
Asked by spmaniato on 2016-04-27 10:06:00 UTC
Answers
Instead of describing theoretical concepts, I will explain in my intuitive way:
There are 3 special frames that you usually meet whenever working with robots, especially with mobile robots: world
, map
,odom
. Whenever your robot is initialized (for instance, after power-on), will create an odom
frame as "initial position". So that whenever you move the robot around, you can locate your robot w.r.t the initial pose. That is the main purpose of odom
->base_link
transformation.
But you still may want to attach the robot in a specific environment. To do that, you have to "attach" the odom
frame w.r.t some other frame. The most common frame is map
frame (if you want to generate map from sensor) or world
frame (if you work with Gazebo simulation). Basically, map
-> odom
and world
->odom
helps attaching your robot in the environment.
If you want to work with multiple maps, these maps (/map_1
, /map_2
, ...) must be attached to the world
frame to maintain a single environment.
Asked by DangTran on 2021-02-15 22:52:23 UTC
Comments
Let's say that we spawn a bot in the Gazebo
world at (0,0,0)
.
- What would the
world frame
in this case? Would it beodom
or would it bemap
? - Would be needing an
ekf_localization
node tolocalize
the bot in this particular case? I ask this because we already know where we spawned it initially, and odometry would help us know the drift of the bot in the world. So, do we really need anekf_localization
node to publish theodom -> base_link
transform tolocalize
the bot in theworld_frame
?
Asked by skpro19 on 2021-02-17 16:41:13 UTC
- Neither. When running the Gazebo, there will be a
world
frame initialized, position of the robot is already identified by transformation betweenworld
->base_link
. There is noodom
frame at all in simulation unless you add appropriate plugins. In non-simulation,odom
will be created when you start the robot. And there will be nomap
frame unless you run map-generating algorithms (gmapping
for instance) or localization algorithms - Yes. Despite you can use
odom
->base_link
for localization, it is likely that the localization information you get is not accurate. Most localization algorithms will use this transformation (odom
->base_link
) along with sensors reading to make the localization information much more precise.
Asked by DangTran on 2021-02-17 17:01:33 UTC
Comments
I have the same doubt. I was seeing
the'getRobotPose()
function. It's description says - Returns thepose
of the robot in theglobal frame
of thecostmap
.Asked by skpro19 on 2021-01-11 05:46:35 UTC