I'm currently working on a ROS2 project where I'm using a local costmap for robot navigation. The costmap is generated based on a point cloud data obtained from a 3D camera. However, I'm encountering an issue where the local costmap freezes and does not update as the robot moves.
I have configured the local costmap using the following parameters:
$$
local_costmap:
ros__parameters:
update_frequency: 5.0
publish_frequency: 2.0
global_frame: odom
robot_base_frame: base_link
use_sim_time: True
rolling_window: true
width: 10
height: 10
resolution: 0.05
footprint: "[ [0.4665, 0.2890], [0.4665, -0.2890], [-0.4665, -0.2890], [-0.4665, 0.2890] ]"
footprint_padding: 0.02
plugins: ["voxel_layer", "inflation_layer"]
voxel_layer:
plugin: "nav2_costmap_2d::VoxelLayer"
enabled: True
footprint_clearing_enabled: true
publish_voxel_map: True
origin_z: 0.0
z_resolution: 0.05
z_voxels: 16
max_obstacle_height: 2.0
unknown_threshold: 15
mark_threshold: 0
observation_sources: pointcloud
combination_method: 1
pointcloud:
topic: /stereo/points
sensor_frame: oak_rgb_camera_optical_frame
max_obstacle_height: 2.0
min_obstacle_height: 0.0
obstacle_max_range: 9.5
obstacle_min_range: 0.0
raytrace_max_range: 10.0
raytrace_min_range: 0.0
clearing: True
marking: True
data_type: "PointCloud2"
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
inflation_radius: 3.0
always_send_full_costmap: True
$$
I have verified that the point cloud topic /stereo/points
is publishing data correctly, and the sensor_frame
parameter is set to match the frame ID of my 3D camera's optical frame.
However, despite these configurations, the local costmap freezes after receiving the first data from the point cloud and does not update as the robot moves. I suspect there may be an issue with the configuration or some missing parameters.
I would appreciate any insights or suggestions on how to resolve this problem. Thank you in advance for your help!