Skip to content

fix: handle invalid camera frames and preserve Gazebo signal handling - #5

Merged
woensug-choi merged 27 commits into
mainfrom
ci/posim-image-validation-20260929
Oct 7, 2026
Merged

woensug-choi merged 27 commits into
mainfrom
ci/posim-image-validation-20260929

Conversation

@yeseorizi

@yeseorizi yeseorizi commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Why this fix is still needed

Normal camera demos can run on current main (109d545e). This patch addresses specific input and initialization cases that a normal startup does not cover:

  • Padded depth rows are read incorrectly: the second row becomes (99, 3) instead of (3, 4) because the row stride is ignored.
  • Missing image/depth data can throw: an empty image reaches an OpenCV assertion, and an RGB callback before depth arrives can throw Unsupported pixel format.
  • Camera initialization replaces the process's SIGINT handler, interfering with Gazebo's ownership of shutdown handling.

The same five isolated regression cases passed 2/5 on unchanged main and 5/5 with the fix. This is not a claim that every camera run crashes.

Changes — camera only, 5 files

Validate frame dimensions, formats, buffer lengths and row stride; wait for compatible depth data; use owned image storage and guard callbacks during teardown. Preserve the enclosing process's signal handler and avoid ROS work after shutdown.

The other changed files register the five camera regression tests through ament_cmake_gtest. Docker recipes, CI configuration, dependency overlays, image publication and website changes are not part of this PR. The ArduPilot download retry is already in main and is not duplicated.

Checks on the retained patch

The CI jobs build images; they do not run the full Gazebo runtime matrix, and image publication is disabled for PR events.

Reproduce the package tests

From a sourced Lyrical/Jetty workspace with the dependencies installed:

CMAKE_BUILD_PARALLEL_LEVEL=1 MAKEFLAGS=-j1 \
colcon build --merge-install --executor sequential \
  --packages-up-to posim_gz_sensor_plugins \
  --cmake-args -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug
colcon test --merge-install --packages-select posim_gz_sensor_plugins --return-code-on-test-failure
colcon test-result --verbose
Earlier PR scope and images

The former broad candidate is preserved at 584953b5. Historical validation-pr5-* images and their runtime results belong to that earlier source, not this camera-only patch.

Open for review; not merged.

@yeseorizi yeseorizi changed the title Validate Docker images and Quickstarts before publication Validate POSIM images and fix Docker runtime shutdown failures Sep 29, 2026
… patch [skip ci]

Reproduce the subscriber churn SIGSEGV using separate processes and compare pinned gz-transport 15.1.0 builds with identical flags. Serialize nonblocking socket polling and wait on OS notification descriptors outside the node mutex. Preserve every failure and first core; verify the loaded library and real deliveries. This commit does not install the candidate into release Dockerfiles or claim final-image acceptance. Explicit manual diagnostics do not enable publication.
Bring current main into the review branch while retaining only the five
camera source/build/test changes. Preserve prior commits as history.
ARM64 download retry already exists in main; drop duplicate Docker changes
and the unrelated overlays, diagnostics and publication automation.

Validated with the real posim_interfaces and posim_gz_sensor_plugins
package build and five passing camera regression cases on Linux ARM64.
@yeseorizi yeseorizi changed the title Validate POSIM images and fix Docker runtime shutdown failures fix: handle underwater camera input and callback lifetime safely Oct 6, 2026
@yeseorizi yeseorizi changed the title fix: handle underwater camera input and callback lifetime safely fix: handle invalid camera frames and preserve Gazebo signal handling Oct 6, 2026
@woensug-choi
woensug-choi merged commit 23bb608 into main Oct 7, 2026
3 checks passed
@woensug-choi
woensug-choi deleted the ci/posim-image-validation-20260929 branch October 13, 2026 05:25
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.

2 participants