Robotics StackExchange | Archived questions

move_base receiving empty plan

I'm trying to write a global planner to use with movebase. I'm printing the path in the console and it looks good, but I'm getting a warn from movebase 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];

          else
            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);

          plan.push_back(pose);
      }

      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.

Asked by RuiLoureiro on 2018-12-04 09:26:32 UTC

Comments

Answers

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

Asked by David Lu on 2018-12-06 10:49:23 UTC

Comments

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

Asked by Roberto Z. on 2020-11-23 09:10:28 UTC

The warning can also be related to the footprint of the robot. Try to check the footprint of the robot in costmap_common_params.yaml and make sure your robot radius is in the footprint.

Asked by Trayach_ on 2022-05-21 07:00:51 UTC

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.

Asked by fherrero on 2019-05-15 10:32:27 UTC

Comments

This was really helpful. Not sure why this happens though

Asked by xaru8145 on 2022-03-03 04:03:55 UTC