# How to use pose for move_base to produce cmd_vel?

From the Wiki page of move_base, it seems that move_base obtains the pose estimation of a robot by a tf from map to odom, which is often published by amcl. However, in my application, I use a motion predictor to predict the future pose of the robot, and I want to use that future pose as a basis for my move_base computation (i.e. use the future pose instead of the current pose estimated by amcl).

The message of my future pose is geometry_msgs/PoseWithCovarianceStamped, which is not a tf. How do I control the robot using geometry_msgs/PoseWithCovarianceStamped instead of tf for move_base?

There are several solutions that I have tried:

1. One alternative is to replace the tf publisher in amcl with a custom tf publisher (from map to odom) using the future pose, but it causes the laser scan misaligned.

2. Another alternative is to keep the original amcl code unchanged, and write a tf publisher (from map to odom_future frame) using the future pose . This approach seems realistic, because it does not affect localization and sensor readings, but I could not find the pieces of code in move_base to expect the frame odom_future instead of odom.

Could somebody provide me some guidance?

edit retag close merge delete

Sort by » oldest newest most voted

Your second approach seems to be the better one. move_base (or more precisely the navigation_stack) utilizes costmap_2d for its planning "computation", and it uses the robot's base frame as the current pose of the robot. Fortunately you can adjust that by setting the robot_base_frame parameter of both the global and local costmap configuration, or by simply include it in the common configuration. Just set robot_base_frame to your odom_future and that should be it.

See here for more detail : http://wiki.ros.org/navigation/Tutori...

more

Hi @mathsci, your suggestion works fine at the end. However, I wonder how to compute the tf from map to odom based on a pose estimation? I've searched online for quite a while, but couldn't find how it is done. I looked at the amcl_node.cpp file but it doesn't make much sense.

( 2018-06-21 16:18:04 -0500 )edit