Robotics StackExchange | Archived questions

Global costmap becomes distorted after resizing itself

Dear all,

I am running the Navigation stack with Cartographer SLAM, and am having an issue where the global costmap gets distorted after resizing itself automatically. For example, here is the output after I launch move_base:

And here's the bash output upon launch:

[ INFO] [1596549941.092785775]: Using plugin "static_map"
[ INFO] [1596549941.104525793]: Requesting the map...
[ INFO] [1596549941.807625313]: Resizing costmap to 253 X 121 at 0.050000 m/pix
[ INFO] [1596549941.907431151]: Received a 253 X 121 map at 0.050000 m/pix
[ INFO] [1596549941.912233971]: Using plugin "inflation_layer"
[ INFO] [1596549942.010675365]: Using plugin "obstacle_laser_layer"
[ INFO] [1596549942.012708436]:     Subscribed to Topics: front_laser rear_laser
[ INFO] [1596549942.061514494]: Using plugin "inflation_layer"
[ INFO] [1596549942.132655815]: Created local_planner teb_local_planner/TebLocalPlannerROS
[ INFO] [1596549942.274159488]: Footprint model 'line' (line_start: [-0.035,0]m, line_end: [0.035,0]m) loaded for trajectory optimization.
[ INFO] [1596549942.274513507]: Parallel planning in distinctive topologies disabled.
[ INFO] [1596549942.306794861]: Costmap conversion plugin costmap_converter::CostmapToPolygonsDBSMCCH loaded.
[ INFO] [1596549942.733048726]: Recovery behavior will clear layer obstacle_laser_layer
[ INFO] [1596549942.736876785]: Recovery behavior will clear layer obstacle_laser_layer
[ INFO] [1596549942.790454163]: odom received!
[ INFO] [1596549954.794210541]: Resizing static layer to 254 X 121 at 0.050000 m/pix

Now, the moment the last line above appears, the global costmap changes, somewhat dramatically...

Note that this sudden distortion/resize can also happen after several tens of seconds of movement. However, the occurrence of the distortion is simultaneous with the appearance of the message "Resizing static layer to ...", which makes it look like a cause/effect relationship.

Here are my configs:

#### costmap_common_params.yaml ####
footprint: [[0.875, -0.34], [0.875, 0.34], [-0.375,0.34], [-0.375, -0.34]]

# width: 20  # Tried adding this but to no effect
# height: 20  # Tried adding this but to no effect
publish_frequency: 1.0

inflation_layer:
  inflation_radius: 0.05

obstacle_laser_layer:
  obstacle_range: 2.5
  raytrace_range: 5.5
  observation_sources: front_laser rear_laser
  front_laser:
    data_type: LaserScan
    topic: $(arg front_scan_topic)
    marking: true
    clearing: true
  rear_laser:
    data_type: LaserScan
    topic: $(arg rear_scan_topic)
    marking: true
    clearing: true

#### global_costmap_params_map.yaml ####
global_costmap:
  global_frame: $(arg global_frame)
  robot_base_frame: $(arg base_frame)
  update_frequency: 5.0
  static_map: false
  # rolling_window: true
  width: 20  # Tried adding this but to no effect
  height: 20  # Tried adding this but to no effect

  plugins:
    - name: static_map
      type: "costmap_2d::StaticLayer"
    - name: inflation_layer
      type: "costmap_2d::InflationLayer"

  static_map:
      static_map: false
      map_topic: map
      lethal_cost_threshold: 94
      unknown_cost_value: 1
      trinary_costmap: false
      use_maximum: false
      first_map_only: false
      track_unknown_space: true
      # width: 20  # Tried adding this but to no effect
      # height: 20  # Tried adding this but to no effect

#### local_costmap_params.yaml ####
local_costmap:
  global_frame: $(arg odom_frame)
  robot_base_frame: $(arg base_frame)
  update_frequency: 5.0
  static_map: false
  rolling_window: true
  width: 7.0
  height: 7.0
  resolution: 0.05

  footprint_padding: 0.0

  plugins:
    - name: obstacle_laser_layer
      type: "costmap_2d::ObstacleLayer"
    - name: inflation_layer
      type: "costmap_2d::InflationLayer"

With the rollingwindow parameter set to true the distortion does not happen, but we do want the global costmap to include the entire SLAM map at runtime. I tried setting the staticmap parameter(s) to false, but to no avail. Also, I'm not sure of the redundancy of the staticmap parameter under globalcostmap and static_layer... Do they control the same thing? Any pointers would be much appreciated! :)

Asked by JunTuck on 2020-08-04 10:54:41 UTC

Comments

Answers