Robotics StackExchange | Archived questions

inaccurate cost value

The cost value of cells inside local costmap is comming inaccurate as a result the robot is considering it has stuck. I'm using neo local planner as localbaseplanner for my robot with move_base. Here the function which is calcuating the cost value of given cell is:

double get_cost(costmap_2d::Costmap2DROS* cost_map_ros, const tf2::Vector3& world_pos)
{
    auto cost_map = cost_map_ros->getCostmap();

    int coords[2] = {};
    cost_map->worldToMapEnforceBounds(world_pos.x(), world_pos.y(), coords[0], coords[1]);

    return cost_map->getCost(coords[0], coords[1]) / 255.;
}

The screenshot of robot being stuck is: image description

The warning msg i'm getting at this time is:

We are stuck: yaw_error=-0.466964, obstacle_dist=-0.350000, obstacle_cost=0.992157, delta_cost_x=2.010893

The source code of neolocalplanner is here.

As i observed after stuck robot is not executing the recoverybehaviour like rotaterecovery. When i list the parameteres of movebase i see the enablerecoverYbehaviour parameter but didn't see which recoverybehaviour is currently set or way to set/change this value. What am i mission?

I am currently testing my robot in gazebo simulator. ROS version: Noetic OS: Ubuntu 20.04

Asked by dinesh on 2021-11-10 03:04:24 UTC

Comments

Answers