How to configure Nav2 for a non-circular robot?
I am currently working with a rather rectangular AGV and would like to use Nav2 in ROS2/Foxy to drive it around safely. I started in simulation with the turtle-bot world and adapted mainly the footprint-parameter to describe the robot. I can load the simulation and the footprint is visualized, however the AGV ignores it when turning.
Video of the whole sequence: robot starts from below, drives between the two obstacles, is the ordered to turn left and by doing so, moves its tail straight through an obstacle. (the simulated robot is small so that there is no collision detected) https://vimeo.com/user127468110/revie...
These are my costmap parameters:
I only replaced the robot_radius with the footprint, but this seems not to be enough to use the footprint. (Or am I missing something completely different?)
local_costmap:
local_costmap:
ros__parameters:
update_frequency: 5.0
publish_frequency: 2.0
global_frame: odom
robot_base_frame: base_footprint
use_sim_time: True
rolling_window: true
width: 5
height: 5
resolution: 0.02
footprint: '[ [0.35, 0.35], [-0.7, 0.35], [-0.7, -0.35], [0.35, -0.35] ]'
plugins: ["voxel_layer", "inflation_layer"]
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
voxel_layer:
plugin: "nav2_costmap_2d::VoxelLayer"
enabled: True
publish_voxel_map: True
origin_z: 0.0
z_resolution: 0.05
z_voxels: 16
max_obstacle_height: 2.0
mark_threshold: 0
observation_sources: scan
scan:
topic: /safety_scanner_left
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: "LaserScan"
static_layer:
map_subscribe_transient_local: True
always_send_full_costmap: True
global_costmap:
global_costmap:
ros__parameters:
update_frequency: 1.0
publish_frequency: 1.0
global_frame: map
robot_base_frame: base_footprint
use_sim_time: True
footprint: '[ [0.35, 0.35], [-0.7, 0.35], [-0.7, -0.35], [0.35, -0.35] ]'
resolution: 0.02
plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
obstacle_layer:
plugin: "nav2_costmap_2d::ObstacleLayer"
enabled: True
observation_sources: scan
footprint_clearing_enabled: False
scan:
topic: /safety_scanner_left
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: "LaserScan"
static_layer:
plugin: "nav2_costmap_2d::StaticLayer"
map_subscribe_transient_local: True
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
always_send_full_costmap: True
I'm not sure this is the issue but you should try to add the ObstacleLayer plugin to the local costmap