Ask Your Question

How to use pose for `move_base` to produce `cmd_vel`?

asked 2018-06-19 16:43:02 -0500

alex_f224 gravatar image

updated 2018-06-19 16:59:20 -0500

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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-06-20 06:07:11 -0500

mathsci gravatar image

updated 2018-06-20 06:34:43 -0500

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 :

edit flag offensive delete link 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.

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-06-19 16:43:02 -0500

Seen: 551 times

Last updated: Jun 20 '18