Hello good work, I can get the package to work properly. But I have a problem, the obstacle that appears in the inflation layer does not inflate around it. Therefore it is moving too close to the target. What do you suggest for this? Also, is there a problem if I add it to both local and global costmap? I think you only added it to global_costmap. Below are the parameters and an example image:
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.599, -0.389], [-0.599, 0.389], [0.599, 0.389], [0.599, -0.389]]"
resolution: 0.05
track_unknown_space: true
plugins: ["static_layer", "depth_camera", "obstacle_layer", "voxel_layer", "inflation_layer"]
static_layer:
plugin: "nav2_costmap_2d::StaticLayer"
map_subscribe_transient_local: True
depth_camera:
plugin: "nav2_costmap_2d::DepthCameraObstacleLayer"
use_global_frame_to_mark: True
forced_clearing_distance: 0.3 #0.1
ec_seg_distance: 0.1 # 0.2
ec_cluster_min_size: 6 # 5
size_of_cluster_rejection: 6 # 5
voxel_resolution: 0.2
check_radius: 0.2 # 0.1
number_clearing_threshold: 2 #2
enable_near_blocked_protection: False #False
number_points_considered_as_blocked: 6 # 5
use_voxelized_observation: False
observation_sources: top_depth_cam bottom_depth_cam rear_depth_cam
top_depth_cam:
sensor_frame: front_top_link #front_top_bottom_screw_frame
topic: /front_top/depth/color/points/voxel_grid
expected_update_rate: 20.0
FOV_W: 1.3962 #FOV_W: 1.3962
FOV_V: 0.9599 #FOV_V: 0.9599
min_detect_distance: 0.15 # 0.15
max_detect_distance: 2.5 # 4.0
min_obstacle_height: 0.1 # 0.2
obstacle_range: 4.0
raytrace_range: 4.0
clearing: True
inf_is_valid: False
marking: True
bottom_depth_cam:
sensor_frame: front_bottom_link
topic: /front_bottom/depth/color/points/voxel_grid
expected_update_rate: 20.0
FOV_W: 1.0
FOV_V: 0.9
min_detect_distance: 0.05
max_detect_distance: 3.0
min_obstacle_height: 0.085
obstacle_range: 4.0
raytrace_range: 4.0
clearing: True
inf_is_valid: True
marking: True
rear_depth_cam:
sensor_frame: rear_link #front_top_bottom_screw_frame
topic: /rear/depth/color/points/voxel_grid
expected_update_rate: 20.0
FOV_W: 1.3962 #FOV_W: 1.3962
FOV_V: 0.9599 #FOV_V: 0.9599
min_detect_distance: 0.15 # 0.15
max_detect_distance: 2.5 # 4.0
min_obstacle_height: 0.1 # 0.2
obstacle_range: 4.0
raytrace_range: 4.0
clearing: True
inf_is_valid: False
marking: True
obstacle_layer:
plugin: "nav2_costmap_2d::ObstacleLayer"
enabled: True
observation_sources: scan
scan:
topic: /scan
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: "LaserScan"
raytrace_max_range: 3.0
raytrace_min_range: 0.0
obstacle_max_range: 2.5
obstacle_min_range: 0.0
# scan:
# topic: /depth_scan
# max_obstacle_height: 2.0
# clearing: True
# marking: True
# data_type: "LaserScan"
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: /scan
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: "LaserScan"
raytrace_max_range: 3.0
raytrace_min_range: 0.0
obstacle_max_range: 2.5
obstacle_min_range: 0.0
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 7.58 # 5.0 , 6.58
inflation_radius: 0.45
inflate_around_unknown: True
inflate_unknown: true
always_send_full_costmap: True
global_costmap_client:
ros__parameters:
use_sim_time: False
global_costmap_rclcpp_node:
ros__parameters:
use_sim_time: False
planner_server:
ros__parameters:
expected_planner_frequency: 20.0
use_sim_time: False
planner_plugins: ["GridBased"]
GridBased:
plugin: "nav2_navfn_planner/NavfnPlanner"
tolerance: 0.2
use_astar: false
allow_unknown: true
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: False
rolling_window: true
width: 10
height: 10
resolution: 0.05
footprint: "[[-0.599, -0.389], [-0.599, 0.389], [0.599, 0.389], [0.599, -0.389]]"
plugins: ["depth_camera", "obstacle_layer", "voxel_layer", "inflation_layer"]
depth_camera:
plugin: "nav2_costmap_2d::DepthCameraObstacleLayer"
use_global_frame_to_mark: False
forced_clearing_distance: 0.3 #0.1
ec_seg_distance: 0.1 # 0.2
ec_cluster_min_size: 6 # 5
size_of_cluster_rejection: 6 # 5
voxel_resolution: 0.2
check_radius: 0.2 # 0.1
number_clearing_threshold: 2 #2
enable_near_blocked_protection: False #False
number_points_considered_as_blocked: 6 # 5
use_voxelized_observation: False
observation_sources: top_depth_cam bottom_depth_cam rear_depth_cam
top_depth_cam:
sensor_frame: front_top_link #front_top_bottom_screw_frame
topic: /front_top/depth/color/points/voxel_grid
expected_update_rate: 20.0
FOV_W: 1.3962 #FOV_W: 1.3962
FOV_V: 0.9599 #FOV_V: 0.9599
min_detect_distance: 0.15 # 0.15
max_detect_distance: 2.5 # 4.0
min_obstacle_height: 0.1 # 0.2
obstacle_range: 4.0
raytrace_range: 4.0
clearing: True
inf_is_valid: True
marking: True
bottom_depth_cam:
sensor_frame: front_bottom_link
topic: /front_bottom/depth/color/points/voxel_grid
expected_update_rate: 20.0
FOV_W: 1.0
FOV_V: 0.9
min_detect_distance: 0.05
max_detect_distance: 3.0
min_obstacle_height: 0.085
obstacle_range: 4.0
raytrace_range: 4.0
clearing: True
inf_is_valid: True
marking: True
rear_depth_cam:
sensor_frame: rear_link #front_top_bottom_screw_frame
topic: /rear/depth/color/points/voxel_grid
expected_update_rate: 20.0
FOV_W: 1.3962 #FOV_W: 1.3962
FOV_V: 0.9599 #FOV_V: 0.9599
min_detect_distance: 0.15 # 0.15
max_detect_distance: 2.5 # 4.0
min_obstacle_height: 0.1 # 0.2
obstacle_range: 4.0
raytrace_range: 4.0
clearing: True
inf_is_valid: False
marking: True
obstacle_layer:
plugin: "nav2_costmap_2d::ObstacleLayer"
enabled: True
observation_sources: scan
scan:
topic: /scan
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: "LaserScan"
# scan:
# topic: /depth_scan
# max_obstacle_height: 2.0
# clearing: True
# marking: True
# data_type: "LaserScan"
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: /scan
max_obstacle_height: 2.0
clearing: True
marking: True
data_type: "LaserScan"
raytrace_max_range: 6.0
raytrace_min_range: 0.0
obstacle_max_range: 2.5
obstacle_min_range: 0.0
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
inflation_radius: 0.3 # 0.3 , 0.2
cost_scaling_factor: 7.58 # 5.0 , 6.58
static_layer:
map_subscribe_transient_local: True
always_send_full_costmap: True
local_costmap_client:
ros__parameters:
use_sim_time: False
local_costmap_rclcpp_node:
ros__parameters:
use_sim_time: False