Ask Your Question

move_base receiving empty plan

asked 2018-12-04 08:26:32 -0500

RuiLoureiro gravatar image

I'm trying to write a global planner to use with move_base. I'm printing the path in the console and it looks good, but I'm getting a warn from move_base telling me the plan is empty, even though I'm checking in the end of makePlan that it isn't.

This is the part of makePlan that adds the poses to the plan vector:

if (bestPath.size() > 0){
        for (int i = bestPath.size()-1; i >=0; i--){
          GridCell current = bestPath[i];

          GridCell previous;

          if (i != (bestPath.size()-1))
            previous = bestPath[i + 1];

            previous = current;

          //Orient the bot towards target
          tf::Vector3 vectorToTarget;
          vectorToTarget.setValue(current.x - previous.x, current.y - previous.y, 0.0);
          float angle = atan2((double)vectorToTarget.y(), (double)vectorToTarget.x());

          geometry_msgs::PoseStamped pose = goal;

          pose.pose.position.x = current.x;
          pose.pose.position.y = current.y;
          pose.pose.position.z = 0.0;

          pose.pose.orientation = tf::createQuaternionMsgFromYaw(angle);


      ROS_DEBUG("Plan empty: %d", plan.empty());

      return true;

And the warning I'm getting is: [WARN]: Received an empty transformed plan.

Any help will be greatly appreciated.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-05-15 10:32:27 -0500

fherrero gravatar image

That warning can also show up when, while using dwa_local_planner with the parameter prune_plan set to true, the robot gets away from the path more than 1 meter. In this case, it's the prunePlan function which returns the empty path. I don't know why such a thing is done, though.

edit flag offensive delete link more

answered 2018-12-06 09:49:23 -0500

David Lu gravatar image

That error will result when your global plan does not overlap with the local costmap.

edit flag offensive delete link more


Could you please elaborate a bit more on "your global plan does not overlap with the local costmap" or point to more detailed information?

Roberto Z. gravatar image Roberto Z.  ( 2020-11-23 08:10:28 -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-12-04 08:26:32 -0500

Seen: 440 times

Last updated: May 15 '19