Skip to content

Turning radius gets downsampled/adapted even when "downsample_costmap" param is deactivated. #2686

@salmagro

Description

@salmagro

Bug report

Required Info:

  • Operating System:
    • Debian GNU/Linux 10 (buster)
  • ROS2 Version:
    • Rolling
  • Version or commit hash:
    • Branch main: c65532f7e537c05c8d02c45099c42cf7ed8954bb

Steps to reproduce the issue

Assign parameters to:

/planner_server:
    GridBased:
      downsample_costmap: false
      downsampling_factor: 4

The downsampling_factor is applied even though the downsample_costmap is set on False.
See: https://github.com/ros-planning/navigation2/blob/0abd2699e86fc27ed8d1c56931f3441c2208da12/nav2_smac_planner/src/smac_planner_hybrid.cpp#L134-L140

Actual behavior

For testing, I am changing the downsampling_factor while downsample_costmap is disabled. As can be seen in the images, the factor affects the turning radius.

Feature request

Feature description

Check the parameter flag downsample_costmap in L134-L140. Proposed solution:

  // convert to grid coordinates
  const double minimum_turning_radius_global_coords = _search_info.minimum_turning_radius;
  if (!_downsample_costmap)
  {
	  _downsampling_factor = 1;
  }
  _search_info.minimum_turning_radius =
		  _search_info.minimum_turning_radius / (_costmap->getResolution() * _downsampling_factor);
  _lookup_table_dim = static_cast<float>(_lookup_table_size)
		  / static_cast<float>(_costmap->getResolution() * _downsampling_factor);
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions