Skip to content

fix: map DVL covariance correctly and guard callback lifetime - #23

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

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

Conversation

@yeseorizi

@yeseorizi yeseorizi commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fix DVL-to-ROS translation and callback lifetime issues reproduced on current main (0d19c3f).

  • Gazebo's linear covariance is 3×3; ROS TwistWithCovariance is 6×6. Map values into the top-left linear block, rather than copying them contiguously into the first nine ROS entries. Apply the same mapping to individual beams.
  • Bound malformed covariance input to nine entries to avoid writing past the fixed ROS array.
  • Create the ROS publisher before subscribing to Gazebo transport. A shared callback gate prevents in-flight / late transport callbacks from dereferencing a destroyed bridge; unsubscribe during destruction.
  • Do not replace Gazebo's SIGINT handler when initializing ROS. Ignore callbacks before configuration or after ROS context shutdown.
  • Remove the per-sample debug message from the callback hot path.

Reproduction and validation

The baseline failed the covariance-layout and host-signal-handler regressions. Tests also cover empty/oversized covariance, unconfigured and shut-down contexts, and 30 create/destroy cycles while a transport publisher is active (with a connection assertion).

  • Independently rebuilt this branch's ROS plugin package against the unmodified main workspace with UBSan / float-cast-overflow enabled.
  • All 7 cases passed in 10 repeats (70 case executions), including 300 lifecycle iterations.
  • Changed-file pre-commit checks passed.
colcon build --packages-select posim_ros_gz_plugins --cmake-args -DBUILD_TESTING=ON
ctest --test-dir build/posim_ros_gz_plugins --output-on-failure \
  -R '^test_dvl_bridge$' --repeat until-fail:10

Scope / limitations

Tested in Ubuntu 26.04 ARM64 Docker on an Apple Silicon Mac, ROS 2 Lyrical / Gazebo Jetty 10.5.0. The fix concerns translation and lifecycle, not changes to the acoustic DVL model or a claim of physical accuracy. No ASan/TSan, native Linux host or real-GPU validation is claimed. The separate ros_gz_bridge shutdown issue is not fixed by this PR.

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