ROS path planner and inflation

asked 2014-02-12 02:43:52 -0500

Jbot gravatar image

updated 2014-02-17 00:33:04 -0500

I have recently made a node to compute a path for my robot using lidar sensor. To do this, I use a costmap ( costmap_2d::Costmap2DROS ) and a planner ( navfn::NavfnROS ). I have configured the inflation radius but it seems that the planner don't take the correct value every time. For your information, I use ROS HYDRO (when I used Groovy, I haven't this issue).

You can find a part of my config file here :

  inflater:
    robot_radius: 0.139
    inflation_radius: 0.14
    cost_scaling_factor: 10.0

  plugins:
    - 
      name: obstacles
      type: "costmap_2d::ObstacleLayer"
    - 
      name: inflater
      type: "costmap_2d::InflationLayer"

Here is a video of the problem : http://www.youtube.com/watch?v=_X5llN...

In the video, you can see in gray the unoccupied cells, and in black the occupied/inflated cells. In color (some kind of rainbow) is the potential computed to acheive the asked goal (red arrow). Finally, in green is the computed path every 2 seconds. As you can see, the potential sometime are going on the occupied cells so it seem the inflation radius is changing.

Have you ever seen this problem? Do you have a solution to that ?

The code used to compute the path :

void TrajectoryManager::computePath(void)
{
    std::vector<geometry_msgs::PoseStamped> global_plan;
    nav_msgs::Path tmp_path;

    while (sem < 1) {
            usleep(10000);
    }
    sem = 0;

    //make sure we have a costmap for our planner
    if(planner_costmap_ == NULL){
            ROS_ERROR("move_base cannot make a plan for you because it doesn't have a costmap");
            //return false;
    }

    tf::Stamped<tf::Pose> global_pose;
    if(!planner_costmap_->getRobotPose(global_pose)){
            ROS_ERROR("move_base cannot make a plan for you because it could not get the start pose of the robot");
            //return false;
    }

    geometry_msgs::PoseStamped start;
    //if the user does not specify a start pose, identified by an empty frame id, then use the robot's pose
    //if(req.start.header.frame_id == "")
    tf::poseStampedTFToMsg(global_pose, start);

    current_pose = start;

    if(planner_->makePlan(start, final_pose, global_plan)){
            //ROS_ERROR("planner makes plan");
            if(!global_plan.empty()){
                    global_plan.push_back(final_pose);
                    //ROS_ERROR("globalplan filled");
            }
    }

    tmp_path.header.frame_id = map_name;
    tmp_path.poses = global_plan;

    // lock
    my_path = tmp_path;
    // unlock
    sem = 1;

}

Thanks in advance.

edit retag flag offensive close merge delete