Skip to content

Backport SignedDistance2d 2D SDF helpers from master to rolling#536

Open
JayHerpin wants to merge 1 commit into
ANYbotics:rollingfrom
Metal-Shark-Sharktech:backport/signed-distance-2d-rolling
Open

Backport SignedDistance2d 2D SDF helpers from master to rolling#536
JayHerpin wants to merge 1 commit into
ANYbotics:rollingfrom
Metal-Shark-Sharktech:backport/signed-distance-2d-rolling

Conversation

@JayHerpin
Copy link
Copy Markdown

@JayHerpin JayHerpin commented May 12, 2026

Summary

Backports the 2D-from-occupancy SDF helpers (grid_map::signed_distance_field::signedDistanceFromOccupancy) from master onto rolling.

The four files are copied verbatim from master, where they were introduced by 91ba880:

  • grid_map_sdf/include/grid_map_sdf/SignedDistance2d.hpp
  • grid_map_sdf/include/grid_map_sdf/Utils.hpp
  • grid_map_sdf/include/grid_map_sdf/PixelBorderDistance.hpp
  • grid_map_sdf/src/SignedDistance2d.cpp

grid_map_sdf/CMakeLists.txt is updated to add the new translation unit to add_library.

Motivation

signedDistanceFromOccupancy only exists on master. Downstream consumers on rolling need it to compute a 2D SDF from a bool occupancy grid. The headers' only external symbol is grid_map_core/TypeDefs.hpp, which is already a grid_map_sdf dependency, so no new transitive deps are introduced.

Companion PR

A matching backport against kilted is filed separately: see #535 (kilted).

Build verification

Built clean against rolling in a downstream ROS 2 workspace.

Notes for maintainers

  • No behavioral changes — pure file copy + CMake source-list addition.
  • Happy to add the upstream testSignedDistance2d.cpp if it compiles cleanly under this branch's CMakeLists; let me know if you'd like it included.

Copies SignedDistance2d.{hpp,cpp}, Utils.hpp, and PixelBorderDistance.hpp
verbatim from master, where they were introduced by 91ba880, and adds the
new translation unit to grid_map_sdf's add_library list.

No behavioral changes to existing code. Pure additions; only external
symbol referenced by the new files is grid_map_core/TypeDefs.hpp, already
a dep of grid_map_sdf.
@JayHerpin JayHerpin marked this pull request as ready for review May 12, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant