Back to catalog

Contact Manager

H01 Contact Manager Unit

Simple correctness tests for pContactMgrV20 output behavior. These cases keep the mission controlled and verify that contact alerts, reports, filters, runtime requests, and multi-contact selections appear only when expected.

Stem Mission

Baseline scenario context

The stem mission is a small single-ownship setup in the lower-band Forrest 19 / MIT_SP frame. alpha is the ownship; contacts such as bravo or intruder are synthetic targets introduced by individual cases so pContactMgrV20 can be checked without a full behavior stack.

Examples

Representative runs

This unit harness uses map-style explanatory GIFs instead of pMarineViewer captures because the ownship geometry is intentionally simple and the verdict comes from MOOS publications such as contact alerts, reports, and filter messages. The visuals call out the evidence that makes each case pass.

Runtime Alert Path

Description: Removes the static alert, posts a complete BCM_ALERT_REQUEST at two seconds, and posts intruder at four seconds, testing runtime alert creation; passes when CONTACT_SEEN=true and CONTACT_CLOSEST=intruder.

CPA-only Detection

Description: Posts a closing contact at (35,-35) with speed 2.0, alert_range=20, and cpa_range=40, testing CPA-based detection while the current range remains outside the alert range; passes when CONTACT_SEEN=true, CONTACT_CLOSEST=intruder, and CONTACT_CLOSEST_RANGE>20.

Case Matrix

All cases

detect_baseline_pass

Posts intruder at (20,-44) four seconds after deploy under the static track alert with alert_range=80 and cpa_range=100, testing the normal alert on_flag; passes when CONTACT_SEEN=true at the 12-second checkpoint.

detect_strict_absent_pass

Keeps the baseline contact but reduces both alert thresholds to 10 meters, testing exclusion of a tracked contact beyond both thresholds; passes when CONTACT_CLOSEST=intruder, CONTACT_CLOSEST_RANGE>10, and CONTACT_SEEN remains false.

detect_edge_pass

Sets both alert thresholds to 18 meters for the baseline contact, testing admission near the threshold; passes when CONTACT_SEEN=true.

detect_edge_absent_pass

Sets both alert thresholds to 14 meters while the reported closest range is 14 meters, testing the strict alert boundary; passes when CONTACT_CLOSEST=intruder, CONTACT_CLOSEST_RANGE=14, and CONTACT_SEEN remains false.

detect_delayed_spoof_pass

Delays the baseline SPOOF from four to eight seconds and moves the checkpoint to 16 seconds, testing late contact intake; passes when CONTACT_SEEN=true.

detect_early_checkpoint_absent_pass

Evaluates at two seconds before the baseline spoof is posted at four seconds, testing pre-contact state; passes when TEST_EVAL_READY=true and CONTACT_SEEN has not become true.

detect_far_spoof_absent_pass

Posts intruder at (20,-30) with 20-meter alert thresholds, testing exclusion of a tracked contact whose reported range exceeds 20 meters; passes when CONTACT_CLOSEST=intruder, CONTACT_CLOSEST_RANGE>20, and CONTACT_SEEN remains false.

detect_near_spoof_pass

Moves intruder to (20,-50) under the baseline alert, exercising close-range detection; passes when CONTACT_SEEN=true.

detect_cpa_only_pass

Posts a closing contact at (35,-35) with speed 2.0, alert_range=20, and cpa_range=40, testing CPA-based detection while the current range remains outside the alert range; passes when CONTACT_SEEN=true, CONTACT_CLOSEST=intruder, and CONTACT_CLOSEST_RANGE>20.

closest_contact_pass

Uses the baseline contact to test closest-contact naming; passes when CONTACT_SEEN=true and CONTACT_CLOSEST=intruder.

post_all_ranges_pass

Enables post_all_ranges=true for alerted contacts alpha and bravo, disables simulator motion, and seeds ownship at (0,-60), testing the sorted one-decimal range report for fixed contacts at (20,-50) and (20,-40); passes when CONTACTS_COUNT=2, CONTACTS_LIST=alpha,bravo, and CONTACT_RANGES=22.4,28.3.

post_closest_relbng_pass

Enables post_closest_relbng=true for the same fixed two-contact geometry with ownship heading 90 degrees, testing the rounded relative bearing to nearer contact alpha; passes when CONTACTS_COUNT=2, CONTACT_CLOSEST=alpha, and CONTACT_CLOSEST_RELBNG=333.

runtime_alert_add_pass

Removes the static alert, posts a complete BCM_ALERT_REQUEST at two seconds, and posts intruder at four seconds, testing runtime alert creation; passes when CONTACT_SEEN=true and CONTACT_CLOSEST=intruder.

runtime_alert_disable_absent_pass

Disables the static track alert with BCM_ALERT_REQUEST at two seconds before posting intruder at four seconds, testing that a tracked contact inside the static alert range no longer fires that alert; passes when CONTACT_CLOSEST=intruder, CONTACT_CLOSEST_RANGE<80, and CONTACT_SEEN remains false.

filter_match_type_absent_pass

Adds match_type=ship to the alert while the spoofed contact retains the default kayak type, testing type filtering after contact intake; passes when CONTACTS_LIST=intruder, CONTACT_CLOSEST=intruder, and CONTACT_SEEN remains false.

disable_contact_pass

Detects intruder at four seconds and posts CONTACT_DISABLE=intruder at six seconds, exercising translation to a BHV_ABLE_FILTER disable message; passes when CONTACT_SEEN=true and the complete payload is contact=intruder,action=disable.

enable_contact_pass

Detects intruder at four seconds and posts CONTACT_ENABLE=intruder at six seconds, exercising translation to a BHV_ABLE_FILTER enable message; passes when CONTACT_SEEN=true and the complete payload is contact=intruder,action=enable.

early_warning_pass

Configures early_warning_time=3, disables warning radii, and sets early_warning_flag=CONTACT_WARN=true, testing the warning flag path; passes when CONTACT_WARN=true at the checkpoint.

count_one_pass

Uses the baseline contact to test alerted-contact counting; passes when CONTACT_SEEN=true and CONTACTS_COUNT=1.

list_intruder_pass

Uses the baseline contact to test the known-contact list; passes when CONTACT_SEEN=true and CONTACTS_LIST=intruder.

range_report_pass

Uses the baseline contact to test the closest-range report; passes when CONTACT_SEEN=true, CONTACT_CLOSEST=intruder, and 10 < CONTACT_CLOSEST_RANGE < 30.

report_request_pass

Posts BCM_REPORT_REQUEST=var=BCM_CONTACTS_20,range=20 two seconds before the baseline contact, testing the custom range-limited report subsystem; passes when BCM_CONTACTS_20=intruder.

range_tight_pass

Applies a tighter check to the baseline closest-range report; passes when CONTACT_SEEN=true, CONTACT_CLOSEST=intruder, and 12 < CONTACT_CLOSEST_RANGE < 16.

count_two_pass

Posts alpha at (20,-50) and bravo at (20,-40) under 30-meter range and 35-meter CPA thresholds, testing alerted-contact counting; passes when CONTACTS_COUNT=2.

list_alpha_bravo_pass

Uses the same two contacts to test known-contact list construction; passes when CONTACTS_COUNT=2 and CONTACTS_LIST=alpha,bravo.

closest_alpha_pass

Uses the same geometry, where alpha is nearer, to test closest-contact selection; passes when CONTACTS_COUNT=2 and CONTACT_CLOSEST=alpha.

closest_bravo_pass

Moves alpha to (20,-36) while placing bravo at (20,-50), testing closest-contact reselection; passes when CONTACTS_COUNT=2 and CONTACT_CLOSEST=bravo.

bravo_far_count_one_pass

Places alpha at (20,-50) and bravo at (20,-20), testing the distinction between tracked and alerted contacts; passes when CONTACTS_COUNT=1, CONTACTS_LIST=alpha,bravo, and CONTACT_CLOSEST=alpha.

late_bravo_count_two_pass

Posts alpha at four seconds, bravo at nine seconds, and evaluates at 16 seconds, testing delayed multi-contact intake; passes when CONTACTS_COUNT=2 and CONTACTS_LIST=alpha,bravo.

stale_bravo_drop_pass

Sets contact_max_age=6, gives bravo a three-second spoof duration, and evaluates at 18 seconds, testing stale contact removal while alpha remains current; passes when CONTACTS_COUNT=1, CONTACTS_LIST=alpha, and CONTACT_CLOSEST=alpha.

reject_range_retire_pass

Sets reject_range=12 and posts intruder at (20,-30), testing range-based retirement after contact intake; passes when CONTACTS_RETIRED=intruder.

alpha_far_bravo_only_pass

Places tracked alpha at (20,-20) and alerted bravo at (20,-50), testing alert-count and closest-contact selection with a farther background contact; passes when CONTACTS_COUNT=1, CONTACTS_LIST=alpha,bravo, and CONTACT_CLOSEST=bravo.

Source links

Harness README Mission README