Robot doesn't avoid obstacles Move Base

Hello,

I try to make my real robot navigate through some narrow passways (70cm) (robot 40cm wide), but no matter what paramaters i change the robot doesnt respect the inflation and doesnt correct it’s course when near walls

My odom and amcl although not perfect, i think are pretty good odom (test by setting the decay time for the laser e.q 20) ideally the scans should align

bump into wall test (move base):

P.S with dwa local planner which is the defacto the robot rotates so i use Trajectory planner, maybe by fixing this problem i can use dwa after P.S also the local costmap i can visualize only with map scheme or raw but no costmap? weird ,i think i can see the inflation layer of new obstacles

Any help to increase the robustness of move base to navigate in tight corridors welcome

Thanks so much for your time!!

config of move base and amcl code below:

Base global planner

    recovery_behaviour_enabled: true
    #controller_frequency: 2 
    NavfnROS:
    allow_unknown: false # Specifies whether or not to allow navfn to create plans that traverse unknown space.
    default_tolerance: 0.2 # A tolerance on the goal point for the planner.

Base local planner

    recovery_behaviour_enabled: true

    TrajectoryPlannerROS:
    # Robot Configuration Parameters
    acc_lim_x: 0.5
    acc_lim_theta:  0.5
    max_vel_x: 0.17
    min_vel_x: 0.11
    max_vel_theta: 0.11
    min_vel_theta: 0.075
    max_in_place_vel_theta: 0.11
    min_in_place_vel_theta: 0.075
    holonomic_robot: false
    escape_vel: -0.1
    # Goal Tolerance Parameters
    yaw_goal_tolerance: 0.15
    xy_goal_tolerance: 0.15
    latch_xy_goal_tolerance: true
    # Forward Simulation Parameters
    sim_time: 2
    sim_granularity: 0.02
    angular_sim_granularity: 0.02
    vx_samples: 10
    vtheta_samples: 25
    controller_frequency: 20.0
    # Trajectory scoring parameters
    meter_scoring: true # Whether the gdist_scale and pdist_scale parameters should assume that 
    goal_distance and  path_distance are expressed in units of meters or cells. Cells are assumed by default (false).
    occdist_scale:  0.2 #The weighting for how much the controller should attempt to avoid obstacles. default 0.01
    pdist_scale: 1.5  #     The weighting for how much the controller should stay close to the path it was given . default 0.6
    gdist_scale: 1.5 #     The weighting for how much the controller should attempt to reach its local goal, also controls speed  default 0.8
    heading_lookahead: 0.1  #How far to look ahead in meters when scoring different in-place-rotation trajectories
    heading_scoring: false  #Whether to score based on the robot's heading to the path or its distance from the path. default false
    heading_scoring_timestep: 0.4   #How far to look ahead in time in seconds along the simulated trajectory when using   heading scoring
    dwa: false #Whether to use the Dynamic Window Approach (DWA)_ or whether to use Trajectory Rollout
    simple_attractor: false
    publish_cost_grid_pc: true  
    # Oscillation Prevention Parameters
    oscillation_reset_dist: 0.1 #How far the robot must travel in meters before oscillation flags are reset (double, default: 0.05)
    escape_reset_dist: 0.2
    escape_reset_theta: 0.2

Costmap common Paramaters

    footprint: [[-0.175, -0.175], [-0.175, 0.175], [0.175, 0.175], [0.175, -0.175]]
    footprint_padding: 0.05
    map_type: costmap

    obstacle_range: 3
    raytrace_range: 3.5

    transform_tolerance: 0.5

    min_obstacle_height: 0.0
    max_obstacle_height: 0.3

    #layer definitions
    static:
        enable: true
        map_topic: /map

    obstacles_laser:
        enabled: true
        observation_sources: laser
        laser: {data_type: LaserScan, clearing: true, marking: true, topic: /scan, inf_is_valid: true}

    inflation:
        enabled: true
        inflation_radius: 0.25
        cost_scaling_factor: 1

Global costmap paramaters

    global_costmap:
        global_frame: map
        robot_base_frame: robot_footprint
        update_frequency: 5
        publish_frequency: 0.5
        width: 20.0
        height: 20.0
        resolution: 0.05
        static_map: true
        track_unknown_space: false
        rolling_window: false
        plugins:
            - {name: static,                  type: "costmap_2d::StaticLayer"}
            - {name: obstacles_laser,         type: "costmap_2d::VoxelLayer"}
            - {name: inflation,               type: "costmap_2d::InflationLayer"}

Local costmap paramaters

    local_costmap:
        global_frame: odom
        robot_base_frame: robot_footprint
        update_frequency: 10
        publish_frequency: 4.0
        width: 2.0
        height: 2.0
        resolution: 0.02
        static_map: false
        rolling_window: true

       plugins:
           - {name: obstacles_laser,           type: "costmap_2d::ObstacleLayer"}
           - {name: inflation,                 type: "costmap_2d::InflationLayer"}

Hi,
confusing problem you have there!

I barely understand what you mean. Very confusing information. I understand that you want to make a robot move along a corridor with is very narrow so you cannot avoid the robot crashing.

It is going to be difficult to solve your problem like this. Let’s do one thing: in order to do quick tests and be able to reproduce your results, please create a rosject with the code and a very simple simulation showing a small corridor and your robot with the navigation packages launches using your configuration. Then share the rosject with me and I’ll take personal responsibility to check what happens.

It is very difficult to find your problem just looking at your configuration files.

Hello,

sorry about the vagueness of my question
i tried to make a rosject (building a gazebo world and a gmapping map with my urdf), http://www.rosject.io/l/bd4c65c/
by running world.launch , amcl.launch , move_base.launch and rviz theoretically it should work
but my cpu usage is at 100% when i run gazebo
and i dont know how much the simulation will represent my real robot, (i mean when i use teleop the robot flipped) and i had to use mass value of 30kg :stuck_out_tongue: and the skid_steering_controller is not a good representation of how my robot behaves .

Anyway after some fiddling i managed to find some good paramaters,
mainly with Trajectory planner the robot moves backwards a little (escape_reset_dist) when in the inflation radius which was much benefecial and i couldn’t replicate this recovery behaviour with the other planners… (they clear costmap and rotate in place) so i didnt use them if you can help me here?
also for the global planner i used orientation mode: 3

for me the problem is solved, you can take a look at the rosject but i think it’s badly written so don’t give it much time :slight_smile:

Thank you for your support!!!