
Based on your nav2 settings from your github issue (https://github.com/ros-planning/navigation2/issues/2537), it looks to me like the sensor data is not set up correctly.
Maps don't make anything by themselves, they use plugins to fill the data, which in turn use sensor data to fill plugins. The total result is the stack of data of all plugins, from any sensor input. It's a very elegant system imo, but requires some setup.
It looks to me like you have a lidar on your robot which you want to use for mapping. Since the global map seems to work, we can use this as a template and work from there.
In your local costmap, the plugins are a VoxelLayer and an inflation layer. Voxels are used for 3d mapping, and I would think that you are looking for an ObstacleLayer, same as you use for your global map. You can copy the obstacle layer from your global costmap onto your local costmap, and remove the voxel layer. I suggest the following:
local_costmap:
local_costmap:
ros__parameters:
update_frequency: 5.0
publish_frequency: 2.0
global_frame: odom
robot_base_frame: base_link
use_sim_time: False
rolling_window: true
width: 3
height: 3
resolution: 0.05
robot_radius: 1.0
plugins: ["obstacle_layer", "inflation_layer"]
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
inflation_radius: 0.55
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"
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
The local costmap is necessary for autonomous driving, so I hope that you can get your robot working with this fix.
Originally posted by Per Edwardsson with karma: 501 on 2021-08-26
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Mk-_- on 2021-08-26:
Thank you so much.
Unfortunately I misunderstood the documentation
Comment by Gianstiff on 2022-02-25:
I'm not fully sure if I got the solution.
Asking because I'm having the same issue working with a Turtlebot3 robot