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

Revision history [back]

click to hide/show revision 1
initial version

If you're looking to integrate your new global planner with move_base, you should check out the code for navfn and carrot_planner. carrot_planner is much simpler for a global planner and it would be a really good place to start. There's only one source file and it's essentially a straight-line planner.

Essentially, your planner must implement two methods to fit the BaseGlobalPlanner interface:

void initialize(std::string name, costmap_2d::Costmap2DROS* costmap_ros);
bool makePlan(const geometry_msgs::PoseStamped& start, const geometry_msgs::PoseStamped& goal, std::vector<
  geometry_msgs::PoseStamped>& plan);

The initialize() method acts as a replacement for the constructor. You should do all of your construction in this method instead of in the actual constructor.

The makePlan() method is the one that is called when move_base asks for a new plan.