Skip to content

Push 4.59.2 release into ros2-master - #3596

Merged
Nir-Az merged 37 commits into
ros2-masterfrom
r/4.59.2
Nov 15, 2026
Merged

Nir-Az merged 37 commits into
ros2-masterfrom
r/4.59.2

Conversation

@Nir-Az

@Nir-Az Nir-Az commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Overview: Bring the frozen r/4.59.2 release branch into ros2-master, so the bloom tracks (version: :{auto}, devel_branch: ros2-master) read 4.59.2 and the 4.59.2 tag can be created on ros2-master.

Why

The ROS wrapper is released from ros2-master: bloom reads <version> from ros2-master's package.xml. ros2-master is still at 4.59.1 (7a87097c).

Summary

  • ros2-master (7a87097c) is already an ancestor of r/4.59.2 (28db0360): no conflicts, the result equals r/4.59.2.
  • 18 files, +382 / -445 (4.59.2 content and version bump).

Next (after merge)

  • catkin_generate_changelog + catkin_prepare_release on ros2-master, tag 4.59.2
  • GitHub release from the tag, then bloom for humble / jazzy / kilted / lyrical / rolling

Test plan

  • git merge-base --is-ancestor origin/ros2-master origin/r/4.59.2
  • package.xml reports 4.59.2
  • CI green
  • Merge with Create a merge commit (not squash / rebase)

🤖 Generated with Claude Code

nnarain and others added 30 commits September 18, 2026 13:59
FW >= 7.58 + librealsense#15691 removed the 52-byte MAP1 header from the
occupancy stream: the frame is now a bare signed-cell grid, and the grid
geometry and signed origin travel in the UVC metadata ABI instead of a
MAP1 sub-header.

- publishOccupancyFrame: add a pure-payload path that reads cols/rows/
  cell_size/origin from the occupancy frame metadata and copies the cells
  straight through (already in nav_msgs row-major order, no axis flip),
  publishing both ~/occupancy and ~/occupancy_certainty.
- Remove publishOccupancyFromMap1, the occupancy_map1.h parser and its
  unit test, and the corresponding ament_add_gtest hook in CMakeLists.
- Other-device legacy paths are left untouched.

Validated live on D555 (FW 7.59.35.15855): occupancy 320x256, 81920-byte
pure payload, resolution 0.05 m, origin (0, -6.4) sourced from metadata.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When neither the pure-payload nor the legacy path can read the grid
geometry (device/driver delivers no occupancy metadata, e.g. an unpatched
uvcvideo on Linux that drops the vendor blob), the legacy path called
get_frame_metadata() unguarded and librealsense threw on every frame.

Guard on supports_frame_metadata(GRID_COLUMNS/ROWS) - matching the
existing guarded readers in this file - and, when absent, drop the frame
after an RCLCPP_ERROR_THROTTLE (5s, pointing at librealsense2-dkms). The
5s throttle matches the sibling occupancy-drop logs; no per-frame throw
or log spam, but the cause stays visible in recent logs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code review found two frames-that-partially-populate-metadata paths that
could still throw rs2::error out of the streaming callback:

- Pure-payload branch was gated only on ORIGIN_X/Y but then read
  COLUMNS/ROWS/CELL_SIZE unguarded. A frame advertising origin but not
  those would throw. Require all five metadata fields to enter the branch.
- The metadata-missing guard checked COLUMNS/ROWS but not CELL_SIZE, while
  the legacy path reads CELL_SIZE unguarded. Add CELL_SIZE to the guard.

Both cases now fall through to the throttled metadata-missing error and
drop the frame instead of throwing per frame.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The pure-payload path's geometry validation (rows/cols positivity, size_t
overflow, raw_size < n) and unit conversions were inline in
publishOccupancyFrame with no unit coverage - the MAP1 tests deleted in
this branch used to be the only occupancy-geometry tests.

Extract them into occupancy::computeGeometry (header-only, free of ROS/SDK
types, same pattern as splitCells) and cover with gtests:
- valid 320x256 grid converts cm->m and mm->m correctly (the live D555 case)
- non-positive dims and payload-smaller-than-grid are rejected
- output is left untouched on failure

publishOccupancyFrame now calls the helper; no behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- computeGeometry now rejects a non-positive cell size (would publish
  resolution 0, a malformed OccupancyGrid) with a NonPositiveCellSize
  status; covered by a new unit test.
- Move the pure-payload path out of publishOccupancyFrame into
  tryPublishPurePayloadOccupancy() so the frame handler is no longer one
  oversized function (234 -> 169 lines; the helper is self-contained). The
  pre-existing legacy paths are left untouched.
The MAP1 path validated a CRC-32 over the payload; the pure-payload path
dropped that check. The FW now reports the same CRC-32/ISO-HDLC over the
whole payload in RS2_FRAME_METADATA_CRC (confirmed on a live D555: metadata
CRC matches the computed one on real frames).

When RS2_FRAME_METADATA_CRC is supported, recompute it over the payload and
drop the frame on mismatch (throttled warning). Skip the check when the
metadata has no CRC. CRC helper is header-only and unit-tested (standard
check value + single-byte corruption).
The drop warnings printed rows x cols, so a 320x256 grid logged as 256x320. The legacy path keeps rows x cols since its width is the firmware row count.
Co-authored-by: Nir Azkiel <nir.azkiel@realsenseai.com>
@sysrsbuild-gh-agentic

Copy link
Copy Markdown

Hi @Nir-Az,

Thank you for opening this PR!

However, this PR targets ros2-master directly. Please follow our Contributions Guide before proceeding — it outlines the correct branching and release workflow.

This comment was auto-generated by the rs-agentic bot.

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.

7 participants