Skip to content

Phase 3: contacts, with the helm raising contact alerts itself - #22

Merged
tsaubergine merged 16 commits into
mainfrom
add-contacts
Nov 13, 2026
Merged

tsaubergine merged 16 commits into
mainfrom
add-contacts

Conversation

@tsaubergine

@tsaubergine tsaubergine commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Phase 3 of the Goby helm plan. The helm handles contacts and raises pContactMgrV20's alerts itself, so contact behaviors spawn without a separate contact manager. Multi-vehicle MOOS-IvP missions replay against pHelmIvP, and m2_berta runs closed loop under Goby with a ghost contact.

Changes

  • Contact manager in the helm (src/lib/helm/contact_manager.{h,cpp}, a port of pContactMgrV20).
    • Alert requests: both BCM_ALERT_REQUEST from behaviors and alerts in the configuration.
    • Alert checks: range and CPA, plus the alert and contact-manager filters.
    • Warnings and retirement: early and cease warnings, and retiring contacts.
    • Disabling contacts: disable_var/enable_var/expunge_var become BHV_ABLE_FILTER.
    • Timing: its posts come out as CONTACT_MANAGER postings and reach behaviors on the next iteration, as through the MOOSDB.
    • Configuration: helm.contact_manager; contact_alerts: false leaves alerts to an outside contact manager.
    • Left out: range reports and display radii, as the plan deferred.
    • CMAlert and PlatformAlertRecord are copied unchanged into src/lib/helm/contacts, rather than moved into MOOS-IvP's libraries, to keep ivp-without-moos minimal.
  • Allstop handling follows current pHelmIvP (upstream moos-ivp#146, already in the packaged libraries).
    • NothingToDo, NoGoalBehavior and missing decisions get one iteration's grace.
    • park_on_allstop parks only on BehaviorError or DisabledByStandbyHelm.
    • So a finished survey no longer parks the vehicle. The scenario tests are updated to match.
  • Status fix: a behavior respawned under the name of one that completed showed as COMPLETED in Status.
  • record.sh records multi-vehicle missions.
    • It runs them from their own launch.sh --just_make, with a fixture per vehicle (fixtures/<mission>.<vehicle>).
    • It drops pHelmIvP's app logging and objective functions from fixtures.
    • Contact missions record at warp 4.
  • New fixtures: s1_alpha_obsavoid, m2_berta, berta_cmgr, m15_pursuit and m34_bo_alpha. The single-vehicle fixtures are re-recorded under the current pHelmIvP.
  • replay changes:
    • Contact reports go in on the iteration pHelmIvP's ledger took them in (from IVPHELM_LEDGER_SUMMARY's report count), not by log time.
    • A change that differs only in its numbers, on the same iteration, counts against a separate 20% allowance. Structural mismatches keep the 5% limit.
    • replay --alerts (ctest replay_<fixture>_alerts) drops pContactMgrV20's recorded posts and has the helm raise alerts itself. It compares state, allstops, modes, life events, active behaviors and the contact manager's posts.
  • ivpico_ghost (test only, not installed) replays other vehicles' recorded NODE_REPORTs to goby_helm_ivp and publishes their range to ownship.
    • closed_loop_m2_berta checks that abe spawns avdcol_ben from its own alert.
    • It also checks that ben comes within 100 m and never within 10 m.
  • COPYING now also covers the GPL 3 pContactMgrV20 ports.
  • Left out: ufld_convoy, whose pHelmIvP looks for behaviors in a directory on its author's machine and is MALCONFIG anywhere else.

Testing

  • The helm scenario tests, including new contact-alert scenarios with built-in alerts on and off.
  • Every new fixture replays with the recorded contact manager feeding it.
  • With the helm raising alerts itself, its alerts land within an iteration of pContactMgrV20's, and spawns and deaths match. Checked on m2_berta, berta_cmgr, m15_pursuit and m34_bo_alpha.
  • All re-recorded single-vehicle fixtures replay, s1_alpha_obsavoid included.
  • The closed loops, closed_loop_m2_berta included.
  • Locally, with the continuous libivp-helm 24.8.1+git5536.g76684e8, all 25 replays pass. That package includes the fix for IvPContactBehavior::m_bearing_line_label_show, which the first CI run tripped over. The contact replays also pass with the heap forced to zero (MALLOC_PERTURB_=255).
  • CI on all four jobs with that package.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp

COPYING carries the license texts, and every source file gets a header.
src/lib/helm/helm.cpp ports pHelmIvP's logic, so it is GPL 3+ like MOOS-IvP,
and so are the mission fixtures and alpha.bhv copied from MOOS-IvP's missions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
ContactManager ports pContactMgrV20's alert handling: BCM_ALERT_REQUESTs
from behaviors and configured alerts, range and CPA checks, alert filters,
early and cease warnings, retirement, and the disable/enable/expunge
variables that become BHV_ABLE_FILTER. CMAlert and PlatformAlertRecord are
copied unchanged from pContactMgrV20. Its posts come out as CONTACT_MANAGER
postings and reach the behaviors on the next iteration, as they would
through the MOOSDB. contact_alerts: false leaves alerts to an outside
contact manager. Range reports and display radii are left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
HelmReport keeps a completed behavior's name in its completed list, so a
behavior respawned under that name showed as COMPLETED in Status. The
completed list now goes first, and the live states override it.

Also leaves an alert that a behavior's request will complete out of the
contact manager's configuration warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
record.sh runs multi-vehicle missions from their own launch.sh --just_make,
with a fixture per vehicle (fixtures/<mission>.<vehicle>), and trims
pHelmIvP's app logging and objective functions from the fixtures.
missions.txt adds s1_alpha_obsavoid and five contact missions, recorded at
warp 4.

replay --alerts (ctest replay_<fixture>_alerts) drops pContactMgrV20's
recorded posts and has the helm raise contact alerts itself from the .moos
file's pContactMgrV20 block, comparing its posts with pContactMgrV20's.

ivpico_ghost replays other vehicles' recorded NODE_REPORTs to
goby_helm_ivp for the m2_berta closed-loop test, and publishes their range
to ownship.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
MOOS-IvP's pHelmIvP now gives NothingToDo, NoGoalBehavior and missing
decisions one iteration's grace without relabelling the allstop, and
park_on_allstop parks only on BehaviorError or DisabledByStandbyHelm. On
other allstops the helm keeps control and decides again once they clear,
so a survey that ends no longer parks the vehicle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
pHelmIvP's IVPHELM_LEDGER_SUMMARY gives how many contact reports its
ledger had taken in by each iteration, so relayed NODE_REPORTs go to the
helm on the iteration pHelmIvP got them instead of by their log times.

A change with the same text on the same iteration but different numbers
counts against its own, looser allowance, and a change within tolerance of
the value before it is skipped. --alerts compares only the helm state,
allstops, modes, life events, active behaviors and the contact manager's
posts, since a behavior spawned an iteration later posts every value an
iteration later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
ivpico_ghost reads GOBY_INTERPROCESS and copes with empty alog values; its
paths are relative to its own test directory. The test also checks that
ben comes within 100 m, so keeping clear of him means something.

ufld_convoy's pHelmIvP looks for behaviors in a directory on its author's
machine, and is MALCONFIG anywhere else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
Recorded from GobySoft/moos-ivp's ivp-without-moos, with
IvPContactBehavior's bearing line label initialised (until that's in the
branch, the label's color is whatever was in memory). The single-vehicle
missions are re-recorded under the current pHelmIvP's allstop handling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
A change that differs from the other helm's only in its numbers, on the
same iteration, was skipped as insignificant when it was close to the value
before it, leaving its counterpart missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLcYK4e29B5FiPbDDJy5fp

Copy link
Copy Markdown
Member Author

CI fails replay_m2_berta.* and replay_m34_bo_alpha.*, on some jobs and not others, and only on the contact behavior's VIEW_SEGLIST:

pHelmIvP: ...,label=ben_avdcol_abe,label_color=white,...
IvPico:   ...,label=ben_avdcol_abe,label_color=invisible,...

The cause is in MOOS-IvP, not this PR.

  • IvPContactBehavior never initialises m_bearing_line_label_show, so the label is white or off depending on what was in memory. It's the only uninitialised read valgrind finds in the m2_berta replay.
  • With the heap forced to zero (MALLOC_PERTURB_=255), exactly these four replays fail locally, on that stream alone. Every other stream matches.
  • The fixtures were recorded from a MOOS-IvP with the fix, so they show the label.

The fix is 9d7aa7b, on GobySoft/moos-ivp's ivp-without-moos. These tests pass once a continuous libivp-helm includes it; the published one is still 24.8.1+git5535.gc535209. Nothing in IvPico can work around it without hiding the bug.


Generated by Claude Code

@tsaubergine
tsaubergine merged commit be05ce9 into main Nov 13, 2026
4 of 8 checks passed
@tsaubergine
tsaubergine deleted the add-contacts branch November 13, 2026 05:02
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