how to set planned path away from object?
Hi, All,
the path planner on my robot always plan paths too close to obstacles. each time the robot walks around the obstacle would hit the lethal areas on the costmap and therefore triggers in place rotation action.
here's my costmap settings
obstacle_range: 5.4
raytrace_range: 5.5
transform_tolerance: 2.0
footprint: [[0.75,0.4], [0.8, 0], [0.75, -0.4],[-0.75, -0.4], [-0.75, 0.4]]
inflation_radius: 2.0
footprint_padding: 0.01
cost_scaling_factor: 8
lethal_cost_threshold: 150
how to set the costmap such way that the planned path is distant away from the obstacles? what are the parameters I can play away? I am using TrajectoryPlannerROS for local path planning and NavfnROS for global path planning.
========================================
here's the parameters for move_base, inflation_radius seems set properly
move_base:
NavfnROS: {allow_unknown: false}
TrajectoryPlannerROS: {acc_lim_th: 0.2, acc_lim_theta: 0.2, acc_lim_x: 0.2, acc_lim_y: 0.0,
allow_unknown: false, angular_sim_granularity: 0.3, dwa: false, escape_reset_dist: 0.1,
escape_reset_theta: 1.57079632679, escape_vel: -0.1, gdist_scale: 0.8, global_frame_id: world,
heading_lookahead: 2.0, heading_scoring: false, heading_scoring_timestep: 0.1,
holonomic_robot: false, max_in_place_rotational_vel: 0.1, max_rotational_vel: 0.4,
max_vel_theta: 0.4, max_vel_x: 0.6, min_in_place_rotational_vel: -0.1, min_in_place_vel_theta: 0.1,
min_rotational_vel: -0.4, min_vel_theta: -0.4, min_vel_x: 0.05, occdist_scale: 0.01,
oscillation_reset_dist: 0.05, pdist_scale: 0.6, restore_defaults: false, sim_granularity: 0.3,
sim_time: 4.2, simple_attractor: false, vtheta_samples: 20, vx_samples: 20, xy_goal_tolerance: 0.5,
y_vels: '-0.3,-0.1,0.1,-0.3', yaw_goal_tolerance: 0.5}
aggressive_reset: {reset_distance: 1.84}
base_global_planner: navfn/NavfnROS
base_local_planner: base_local_planner/TrajectoryPlannerROS
clearing_rotation_allowed: false
conservative_reset: {reset_distance: 3.0}
conservative_reset_dist: 3.0
controller_frequency: 20.0
controller_patience: 5.0
global_costmap:
allow_unknown: false
footprint: '[[0.9,0.8],[1,0],[0.9,-0.8],[-0.8,-0.8],[-0.8,0.8]]'
footprint_padding: 0.01
global_frame: /world
height: 200
inflation_layer: {cost_scaling_factor: 7.0, enabled: true, inflation_radius: 3.0,
robot_radius: 0.46}
obstacle_layer:
combination_method: 1
enabled: true
laser_scan_sensor: {clearing: true, data_type: LaserScan, marking: true, sensor_frame: base_laser,
topic: scan}
max_obstacle_height: 2.0
observation_sources: laser_scan_sensor
obstacle_range: 5.4
raytrace_range: 5.5
track_unknown_space: true
obstacle_layer_footprint: {enabled: true}
origin_x: -100.0
origin_y: -100.0
plugins:
- {name: static_layer, type: 'costmap_2d::StaticLayer'}
- {name: obstacle_layer, type: 'costmap_2d::ObstacleLayer'}
- {name: inflation_layer, type: 'costmap_2d::InflationLayer'}
publish_frequency: 0.0
resolution: 0.05
robot_base_frame: base_link
robot_radius: 0.46
static_layer: {enabled: true, lethal_cost_threshold: 160, track_unknown_space: true}
static_map: true
transform_tolerance: 5.0
update_frequency: 0.2
width: 200
local_costmap:
allow_unknown: false
footprint: '[[0.9,0.8],[1,0],[0.9,-0.8],[-0.8,-0.8],[-0.8,0.8]]'
footprint_padding: 0.01
global_frame: /base_odom
height: 12
inflation_layer: {cost_scaling_factor: 7.0, enabled: true, inflation_radius: 3.0,
robot_radius: 0.46}
lethal_cost_threshold: 160
obstacle_layer:
combination_method: 1
enabled: true
laser_scan_sensor: {clearing: true, data_type: LaserScan, marking: true, sensor_frame: base_laser,
topic: scan}
max_obstacle_height: 2.0
observation_sources: laser_scan_sensor
obstacle_range: 5.4
raytrace_range: 5.5
track_unknown_space: false
obstacle_layer_footprint: {enabled: true}
origin_x: -100.0
origin_y: -100.0
plugins:
- {name: obstacle_layer, type: 'costmap_2d::ObstacleLayer'}
- {name: inflation_layer, type: 'costmap_2d::InflationLayer'}
publish_frequency: 5.0
resolution: 0.05
robot_base_frame: base_link
robot_radius: 0.46
rolling_window: true
static_map: false
transform_tolerance ...
I think the inflation_radius (which in your costmap settings is set to 2 meters) is being overwritten at some point. Could you execute rosparam dump dump.yaml and post the contents of the file dump.yaml that you will get?
I am not sure how to set the format when editing old post. please see the additional inputs above
Could you post a picture of how the global, local costmap layout and global path looks like in rviz? Also try to set occdist_scale to a higher value. It basically weights how much the robot should avoid obstacles.