Skip to content

set size_x_ and size_y_ in method initMaps #4014

@Hao-Li-Bachelorarbeit

Description

@Hao-Li-Bachelorarbeit

Bug report

Required Info:

  • Operating System:
  • ROS2 Version:
  • Version or commit hash:
  • DDS implementation:

Steps to reproduce issue

in file costmap_2d.cpp

void Costmap2D::initMaps(unsigned int size_x, unsigned int size_y)
{
  std::unique_lock<mutex_t> lock(*access_);
  delete[] costmap_;
  costmap_ = new unsigned char[size_x * size_y];
}

Expected behavior

Actual behavior

Additional information


Feature request

Feature description

set size_x_ and size_y_ in this method. Since these two attributes are always used to describe costmap_, I think this information should be synchronized when initializing the map, and setting them separately causes code redundancy.

Implementation considerations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions