Ask Your Question
0

makePlan of GlobalPlanner plugin

asked 2017-08-08 13:39:13 -0500

Timo1804 gravatar image

I have saved a few PoseStamped in a file to describe a fixed path in a fixed map, now I want to make a plan out of them and send it to move_base. I wrote my own globalplanner-plugin for move_base, and stacked all my Poses in the vector plan of makePlan(). When I am starting the navigation, everything starts fine but after the robot passes the first Pose, he starts driving forwards and backwards around that point...

This is my makePlan(), where poses is a vector and contains the different PoseStampeds:

  bool MyGlobalPlanner::makePlan(const geometry_msgs::PoseStamped& start, 
  const geometry_msgs::PoseStamped& goal, std::vector<geometry_msgs::PoseStamped>& plan){

if(!initialized_){
  ROS_ERROR("The planner has not been initialized, please call initialize() to use the planner");
  return false;
}

plan.clear();


plan.push_back(start);
for(int i=0; i<poses.size();i++){
plan.push_back(poses[i]);
} 
return true;

}

edit retag flag offensive close merge delete

Comments

It would help to publish the plan also so you can visualise in rviz if it is what you expect.

naveedhd gravatar image naveedhd  ( 2017-08-09 02:57:10 -0500 )edit

I have published it as nav_msgs::Path and it looks fine. Also the plan of the LocalPlanner looks good until he passes the first Pose after start-pose.

Timo1804 gravatar image Timo1804  ( 2017-08-09 06:53:08 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-08-09 10:19:47 -0500

Timo1804 gravatar image

I have solved that problem. You mustn't put all poses in your vector plan. I think makePlan() is called every time when the robot passes the next PoseStamped and you only have to put start, your next pose and the goal into it. I changed the makePlan() to:

plan.clear();

plan.push_back(start);
if(pose_num <= pose_num_max) plan.push_back(poses[pose_num]);
plan.push_back(goal);
pose_num++;

return true;
}

The start and goal argument is sent by move_base.

edit flag offensive delete link more

Comments

This doesn't seems to be the case. Publishing just the plan from standard global planner is a list of all the poses, and if the robot doesn't get stuck, this is only called once by move_base.

naveedhd gravatar image naveedhd  ( 2017-08-11 09:40:33 -0500 )edit

I am trying to solve a similar issue, do you have a repo that you may share for this?

aarontan gravatar image aarontan  ( 2018-06-29 12:17:49 -0500 )edit

try setting the planner_frequency to 0 in move_base dynamic reconfigure. This way move base will not feed plan again and avoid robot oscillating.

naveedhd gravatar image naveedhd  ( 2018-07-02 02:34:40 -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

2 followers

Stats

Asked: 2017-08-08 13:39:13 -0500

Seen: 487 times

Last updated: Aug 09 '17