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

Revision history [back]

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).

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.