[ROS2][Nav2] Is there a way to expand the global costmap ?
I am working in ros2 foxy in ubuntu 20.04 with a custom made robot.
In my current setup i use an imu and odmotry (produced by diff_drive) and a localisaton system outside of the robot (like gps). My goal is to map an environment using only the footprint of the robot ( as i don't have any other source of information ). To do that, the only way i found was to publish a large empty static map using a map server as global costmap and have the robot move around. This leaves a tray of "free cell" in my global costmap. I then go around the area i want to map and then save it and fill the inside with a python script. This leaves me with a map containing "free cells" and "unnown cells".
The only issue I have with that is that I don't know how to expand my global costmap : If my robot goes to far, it's radius won't be "printed" on any map and won't be saved.
Is there a way to expand the global costmap in a more dynamic way ?
my nav2 global costmap config :
global_costmap:
global_costmap:
ros__parameters:
publish_frequency: 1.0
update_frequency: 5.0
global_frame: map
robot_base_frame: base_link
use_sim_time: False
robot_radius: 0.5
resolution: 0.05
track_unknown_space: true
plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
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:
plugin: "nav2_costmap_2d::StaticLayer"
map_subscribe_transient_local: True
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
inflation_radius: 0.55
always_send_full_costmap: True
global_costmap_client:
ros__parameters:
use_sim_time: False
global_costmap_rclcpp_node:
ros__parameters:
use_sim_time: False
I use an obstacle layer in the config file but I don't have anything publishing on the /scan topic, I just use this layer to "print" the footprint of my robot on the map.