Skip to content

Backport SignedDistance2d 2D SDF helpers from master to kilted#535

Draft
JayHerpin wants to merge 1 commit into
ANYbotics:kiltedfrom
Metal-Shark-Sharktech:backport/signed-distance-2d-kilted
Draft

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

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 kilted.

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 the kilted distro 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 rolling is filed separately: see #536 (rolling).

Build verification

Built clean against kilted in a downstream ROS 2 workspace; grid_map_sdf (and the rest of the grid_map graph) compiles and signedDistanceFromOccupancy is callable from consumer code.

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.
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