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

Custom global planner

asked 2012-07-18 02:12:56 -0600

Darkmaster gravatar image

Hello,

I would like to create my own global planner. So far I have created a simple path that should move robot for 0.5m to the left using "nav_msgs::Path mypath", and publish it to the "move_base/NavfnROS/plan" . The path is shown in the rviz, but robot doesn't start to move on it.

What am I missing? Or what would be the easiest way for me to "foward" my custom path to move_base (robot).

I only want to change global plan, I still want for local plan to work normally and avoid obstacles etc.

edit retag flag offensive close merge delete

Comments

I think I need to implement BaseGlobalPlanner. Can you point me more on what to do? I'm still a beginner.

Darkmaster gravatar image Darkmaster  ( 2012-07-18 03:15:43 -0600 )edit

How did you get the path to appear? I am publishing a nav_msgs Path mypath (in Python) but it will not appear in Rviz.

ngoldfarb gravatar image ngoldfarb  ( 2016-01-12 18:28:34 -0600 )edit

@Darkmaster please see this.

skpro19 gravatar image skpro19  ( 2021-06-10 14:02:17 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
6

answered 2012-07-18 03:55:13 -0600

DimitriProsser gravatar image

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.

edit flag offensive delete link more
2

answered 2012-07-18 03:01:48 -0600

dornhege gravatar image

Do you want some method to move the robot forward 0.5m or do you want to create a global planner (and this is just your test code)?

For the first, the easy way would be to construct a move base goal at 0.5m and specify it in the robot's frame.

For the second, did you implement the interface BaseGlobalPlanner and used that in move_base?

edit flag offensive delete link more

Question Tools

4 followers

Stats

Asked: 2012-07-18 02:12:56 -0600

Seen: 3,898 times

Last updated: Jul 18 '12