Skip to content

Handle zero USBL noise deviation - #57

Open
yeseorizi wants to merge 1 commit into
IOES-Lab:ros2from
yeseorizi:fix/usbl-zero-sigma
Open

Handle zero USBL noise deviation#57
yeseorizi wants to merge 1 commit into
IOES-Lab:ros2from
yeseorizi:fix/usbl-zero-sigma

Conversation

@yeseorizi

Copy link
Copy Markdown
Collaborator

Summary

Allow USBL transponders to use sigma=0 as a deterministic noise configuration instead of constructing an invalid C++ normal distribution.

Problem

The checked-in USBL tutorial configures both transponders with:

<mu>0</mu>
<sigma>0.0</sigma>

UsblTransponder::sendLocation() always constructed std::normal_distribution with that standard deviation. On the tested libstdc++ build, the distribution enforces stddev > 0, so the first ping aborted Gazebo:

std::normal_distribution<...>::param_type: Assertion '_M_stddev > 0' failed.

The reproduced baseline exited with code 134 and returned no USBL locations.

Change

  • For sigma=0, use the configured mean as a deterministic per-axis offset without constructing std::normal_distribution.
  • Preserve the existing random sampling path for sigma>0.
  • Clamp a negative standard deviation to zero and emit a warning.

No topic names, interrogation routing, coordinate conversion, or positive-sigma sampling behavior is changed.

Validation

The exact candidate source was compiled in the ARM64 DAVE environment with ROS 2 Lyrical and Gazebo Jetty.

The original two-transponder tutorial geometry was then run with mu=0, sigma=0 and common interrogation:

Check Result
Gazebo remained alive after pings PASS
Spherical responses 6, IDs 1 and 2
Cartesian responses 6, IDs 1 and 2
Unexpected IDs 0
Maximum Cartesian axis error 6.13e-11 m
Maximum spherical reconstruction error 6.13e-11 m
Assertion / SIGABRT 0

A second run with sigma=-1 also stayed alive, returned the same deterministic geometry, and emitted one warning for each of the two invalid transponders.

Repository checks:

pre-commit run --all-files
# Passed

git diff --check
# Passed

Checklist

  • Reproduced the checked-in sigma=0 crash
  • Exact candidate source compiled
  • Two-transponder runtime path verified
  • Non-positive sigma behavior verified
  • Repository hooks passed

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