Skip to content

fix: preserve underwater camera inputs and acquisition headers - #22

Open
yeseorizi wants to merge 1 commit into
IOES-Lab:mainfrom
yeseorizi:fix/camera-validation-20261022
Open

yeseorizi wants to merge 1 commit into
IOES-Lab:mainfrom
yeseorizi:fix/camera-validation-20261022

Conversation

@yeseorizi

@yeseorizi yeseorizi commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fix camera conversion and ROS image metadata issues reproduced on current main (0d19c3f). This is a follow-up to the already merged camera work, not a replacement for PR #5.

  • RGB/RGBA conversion no longer writes into the incoming const gz::msgs::Image buffer.
  • Reject unsupported formats, dimensions outside OpenCV's integer range, and invalid float row alignment without throwing from the transport callback.
  • Handle NaN depth as a far return instead of converting a NaN intensity to a byte.
  • Preserve the Gazebo acquisition timestamp and frame ID (including valid zero time), rather than stamping images with the ROS node's current time. Normalize scoped frame names as the bridge does.

Reproduction and validation

The added adversarial suite failed 7 of 8 cases before the fix: it demonstrates source-buffer mutation, malformed input exceptions, and undefined NaN conversion. The existing renderer-passthrough behavior remains covered so attenuation is not applied twice.

  • Independently rebuilt this branch's sensor package against the unmodified main workspace with UBSan / float-cast-overflow enabled.
  • All 15 camera/pressure cases passed, with each target repeated 10 times (150 case executions).
  • Independent end-to-end rerun: 10 raw and 10 processed images, including 7 matching acquisition stamps and frame IDs, then clean process cleanup. The scene run also used a local diagnostic ros_gz_bridge shutdown overlay; this PR does not claim to fix that separate dependency.
  • Changed-file pre-commit checks passed.
colcon build --packages-select posim_gz_sensor_plugins --cmake-args -DBUILD_TESTING=ON
ctest --test-dir build/posim_gz_sensor_plugins --output-on-failure \
  -R '^test_(underwater_camera|camera_adversarial|pressure_shutdown)$' --repeat until-fail:10

Scope / limitations

Test environment: Ubuntu 26.04 ARM64 Docker on an Apple Silicon Mac, ROS 2 Lyrical, Gazebo Jetty 10.5.0; software rendering for the scene test. This is not native-Linux, real-GPU, WGPU-sonar or full-release certification. No image publication or dependency changes are included.

The existing locally patched asv_wave_sim dependency also remained installed during scene checks. Neither that renderer teardown patch nor the bridge overlay is included in this PR; successful scene cleanup is not attributed to this change alone.

Checklist

  • Forked the repository and kept the change focused.
  • Added regression tests and ran the targeted functional tests plus changed-file pre-commit.
  • Signed commits with DCO and disclosed AI assistance.
  • Entire repository colcon test is clean. The earlier full audit also reports pre-existing ament cpplint/uncrustify/copyright failures; no tests were disabled here.
  • Remote formatting CI passed. Docker jobs are intentionally skipped for fork PRs; this is not a Docker build result.

Assisted-by: OpenAI Codex (implementation, tests and PR preparation).

Assisted-by: OpenAI Codex
Signed-off-by: Kwon Yeseol <172019512+yeseorizi@users.noreply.github.com>

This branch has not been deployed

No deployments
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