Back to catalog

Behavior Correctness

H01 Trail Behavior

Behavior correctness tests for BHV_Trail. These cases verify relative and absolute trailing geometry, pursuit relevance, runtime trail updates, extrapolation choices, missing-contact behavior, and malformed parameter handling.

Stem Mission

Baseline scenario context

The stem mission uses two simulated vehicles: abe runs BHV_Trail while ben provides the moving contact track. Case overlays vary trailing geometry, relevance settings, runtime updates, and missing-contact behavior.

Examples

Representative runs

Relative Port Trail

Description: Covers relative port expected pass.

Lead Turn Angle Update

Description: Covers lead turn angle update expected pass.

Runtime Range Extend

Description: Covers runtime range extend expected pass.

Case Matrix

All cases

static_trail_pass

Configures a relative 180-degree trail point 45 meters behind Ben with radius=8 and nm_radius=18; passes at 45 seconds when TRAIL_DISTANCE<=20, PURSUIT=1, relevance is positive, and no BHV_ERROR occurred.

lead_right_turn_pass

Replaces Ben's straight leg with points (55,-80):(55,-35):(125,-35), exercising pursuit through a right-angle target turn; passes at 80 seconds when Ben has reached x>=50,y>=-45, TRAIL_DISTANCE<=45, pursuit and relevance are active, and no error occurred.

pwt_outer_inactive_pass

Sets pwt_outer_dist=30, below the observed contact range; passes when TRAIL_RANGE>30, PURSUIT=0, relevance is zero, and no error occurred.

runtime_relevance_off_pass

Posts pwt_outer_dist=5 at 12 seconds, exercising runtime relevance shutdown; passes at 35 seconds when TRAIL_RANGE>5, PURSUIT=0, relevance is zero, and no error occurred.

runtime_bad_update_recover_pass

Rejects trail_range=-5 before accepting the distinct recovery value 70; ordered evaluation requires the exact param_error, a warning, exact success for 70, then TRAIL_DISTANCE<=40, active pursuit, and positive relevance before the deadline.

idle_post_distance_pass

Sets post_trail_dist_on_idle=true and turns TRAIL=false at 25 seconds, exercising distance publication while idle; passes at 35 seconds when PURSUIT=0, TRAIL_DISTANCE<999, and no error occurred.

idle_no_post_distance_pass

Sets post_trail_dist_on_idle=false, turns TRAIL=false at 25 seconds, and writes sentinel TRAIL_DISTANCE=999 at 28 seconds; passes at 35 seconds when the sentinel remains 999, PURSUIT=0, and no error occurred.

auto_alert_request_pass

Starts a spawn-templated Trail with an updates variable and no_alert_request=false; the live case requires a BCM_ALERT_REQUEST before active pursuit, while direct CTest requires the complete request payload and proves each suppression gate.

missing_contact_warn_pass

Sets contact=ghost with on_no_contact_ok=true; the live case leads on a pre-deadline warning with no behavior error, and direct CTest requires exact trail_contact: ghost x/y/heading/speed info not found warning text.

missing_contact_fail

Sets the same absent contact with on_no_contact_ok=false; the live case leads on a pre-deadline behavior error, and direct CTest requires the exact ghost-contact message on BHV_ERROR.

missing_contact_param_fail

Omits contact with on_no_contact_ok=false; the live case leads on a pre-deadline behavior error, and direct CTest requires exact trail_contact: contact IDX not set. text.

bad_trail_angle_type_fail

Sets trail_angle_type=diagonal; the harness requires armed, pre-deadline MALCONFIG, while direct CTest requires rejection of this exact type.

bad_trail_angle_fail

Sets trail_angle=west; the harness requires armed, pre-deadline MALCONFIG, while direct CTest requires rejection of this exact nonnumeric angle.

bad_trail_range_fail

Sets trail_range=-1; the harness requires armed, pre-deadline MALCONFIG, while direct CTest requires rejection of this exact negative range.

bad_mod_trail_range_pct_fail

Sets mod_trail_range_pct=0; the harness requires armed, pre-deadline MALCONFIG, while direct CTest requires rejection of this nonpositive percentage.

bad_radius_fail

Sets radius=-1; the harness requires armed, pre-deadline MALCONFIG, while direct CTest requires rejection of this exact radius.

bad_nm_radius_fail

Sets nm_radius=-1; the harness requires armed, pre-deadline MALCONFIG, while direct CTest requires rejection of this exact near-mode radius.

bad_pwt_outer_dist_fail

Sets pwt_outer_dist=-1; the harness requires armed, pre-deadline MALCONFIG, while direct CTest requires rejection of this exact relevance distance.

bad_decay_fail

Sets decay=60,30; the harness requires armed, pre-deadline MALCONFIG, while direct CTest requires rejection when decay start exceeds decay end.

bad_time_on_leg_fail

Sets inherited time_on_leg=-1; the harness requires armed, pre-deadline MALCONFIG, while direct CTest requires rejection of this exact negative duration.

Source links

Harness README Mission README