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

Which frame is better : odom or base

asked 2020-08-17 09:21:54 -0500

luchko gravatar image

updated 2020-08-17 09:27:32 -0500

Hello, I am trying to understand which frame it is better to use in my specific case. I have 3 frames :
- base_link as defined in REP105
- laser_link which is a static TF of the previous
- odom as defined in REP105 and provided by fusing IMU and whell odom data (through EKF)

I am now playing with a leg tracker based on laserscan data (you can find it here. This package output a list of people (X, Y position and twist of persons) based on the laserscan input.

My understansing of odom versus base_link frame is that :
- if my robot is not moving, i can use any frame to compute X,Y coord and twist of people moving around the robot
- if my robot is moving, i have to use the odom frame so the computation of a people data will take into account the motion of my robot

It is pretty clear for me that I have to use odom frame if I am moving... But I can't explain it very clearly... can anyone explain it to me so that there is no more hesitation when I try to explain to someone why am I using the odom frame?

Edit : my goal is to get the coordinates and twist of the closest person and send cmd_vel to "follow" this person. Which frame would you use ?

thank you!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2020-08-18 08:27:10 -0500

fergs gravatar image

updated 2020-08-18 08:30:37 -0500

So, the key here is "tracking". I presume the leg_tracker node is trying to correlate data seen in multiple scans taken over time. When you are moving, the odom frame should generally be pretty consistent over time (assuming you have decent odometry).

Imagine someone is standing 2 meters in front of the robot and that we have just turned on the robot so the transformation from odom->base_link is the Identity matrix (the two frames are on top of each other). The person's coordinates in both frames is x,y = (2,0). Now the robot drives forward 1 meter. The base_link moves with the robot and so the person's coordinates in base_link are (1,0) -- but in the odom frame, the person hasn't moved and so it is still exactly (2,0) if there is no noise in your odometry. It's a whole lot easier to correlate the person's location in the odom frame (where only the person's movement changes the coordinates).

Once you have done the tracking in the odom frame, you can use TF to translate the tracked coordinates of the person into the base_link frame -- because finding the "closest one to the robot" is going to be easier in the base_link frame (since the robot is always at (0,0)). Alternatively you could get the robot pose in the odom frame using TF and compute the distance between the points.

edit flag offensive delete link more


Thank you so much

luchko gravatar image luchko  ( 2020-08-18 15:06:17 -0500 )edit

answered 2020-08-17 23:51:43 -0500

Ahmed_Desoky gravatar image

updated 2020-08-17 23:51:52 -0500

odom is the origin of the global axis, and it is fixed frame on the ground.

base_link is the local axis, it is moving frame and fixed on the robot.

edit flag offensive delete link more


thanks a lot for your answer ! Unfortunately, if I understand what you are saying, I do not understand how it applly to my question. Could you please elaborate a little bit? thank you!

luchko gravatar image luchko  ( 2020-08-18 04:44:28 -0500 )edit

Question Tools

1 follower


Asked: 2020-08-17 09:21:54 -0500

Seen: 657 times

Last updated: Aug 18 '20