Back to catalog

Obstacle Manager

H01 Obstacle Manager Unit

Simple correctness tests for pObstacleMgr output behavior. These cases keep vehicle dynamics minimal and verify accepted obstacles, rejected obstacles, alert messages, point-cluster hulls, distance reports, and obstacle lifecycle messages.

Stem Mission

Baseline scenario context

The stem mission keeps the ownship context simple and introduces given obstacles or point clusters through the case inputs. That isolates pObstacleMgr message behavior before any moving obstacle-avoidance outcome is judged.

Examples

Representative runs

This unit harness uses map-style explanatory GIFs instead of pMarineViewer captures because the ownship is stationary and the verdict comes from MOOS publications such as obstacle acceptance, distance reports, hull generation, and filter messages. The visuals call out the evidence that makes each case pass.

Given Obstacle Alert

Description: Posts a 4-by-4-meter GIVEN_OBSTACLE 18 meters east of the stationary vehicle after a 25-meter OBM_ALERT_REQUEST, testing runtime obstacle ingestion and distance calculation; passes when OBM_NEW_GIVEN=true and OBM_DIST_TO_OBJ=OB_NEAR,18.0.

Point Cluster Hull

Description: Posts four TRACKED_FEATURE points under key=rock_a, testing conversion of a point cluster into an obstacle hull and its distance calculation; passes when OBM_DIST_TO_OBJ=ROCK_A,18.0 and 17 < OBM_MIN_DIST_EVER < 19.

Case Matrix

All cases

given_baseline_pass

Posts a 4-by-4-meter GIVEN_OBSTACLE 18 meters east of the stationary vehicle after a 25-meter OBM_ALERT_REQUEST, testing runtime obstacle ingestion and distance calculation; passes when OBM_NEW_GIVEN=true and OBM_DIST_TO_OBJ=OB_NEAR,18.0.

config_given_obstacle_pass

Loads the same near polygon through the startup given_obstacle parameter and sends only the runtime alert request, testing the configuration-owned obstacle path; passes when OBM_DIST_TO_OBJ=CONFIG_NEAR,18.0.

given_obstable_alias_pass

Loads the near polygon through the historical misspelled given_obstable parameter, testing that the alias still reaches the normal alert-distance path; passes when OBM_DIST_TO_OBJ=ALIAS_NEAR,18.0.

no_alert_request_absent_pass

Posts the near GIVEN_OBSTACLE without an OBM_ALERT_REQUEST, testing that an accepted obstacle does not produce request-scoped output; passes when OBM_NEW_GIVEN=true, no OBM_DIST_TO_OBJ publication is observed, and OBSTACLE_ALERT remains empty.

bad_alert_request_absent_pass

Sends an OBM_ALERT_REQUEST with alert_range=-25 before posting the near obstacle, testing rejection of an invalid request; passes when OBM_NEW_GIVEN=true, no OBM_DIST_TO_OBJ publication is observed, and OBSTACLE_ALERT remains empty.

given_far_absent_pass

Posts a GIVEN_OBSTACLE 35 meters east while the alert range is 25 meters and post_dist_to_polys=close, testing close-range output gating; passes when OBM_NEW_GIVEN=true, no OBM_DIST_TO_OBJ publication is observed, and OBSTACLE_ALERT remains empty.

given_general_alert_pass

Configures a named general_alert with a 40-meter range, then posts an obstacle 35 meters away and outside the normal 25-meter alert range, testing the independent general-alert path; passes when OBM_NEW_GIVEN=true, GEN_ALERT_SEEN=true, and GEN_OBSTACLE_ALERT exactly matches the gen_ob_far polygon payload.

general_alert_default_name_pass

Omits name= from the same 40-meter general_alert, testing the default gen_alert_ prefix; passes when OBM_NEW_GIVEN=true, GEN_ALERT_SEEN=true, and GEN_OBSTACLE_ALERT exactly matches the gen_alert_ob_far polygon payload.

given_duration_resolve_pass

Posts the near obstacle with duration=3, testing expiration of a runtime given obstacle; passes at 10 seconds when OBM_RESOLVED=ob_near.

given_max_duration_reject_absent_pass

Sets given_max_duration=5 and posts an obstacle with duration=10, testing rejection above the configured duration limit; passes when OBM_NEW_GIVEN is never set and OBSTACLE_ALERT remains empty.

given_max_duration_missing_absent_pass

Sets given_max_duration=30 and posts a GIVEN_OBSTACLE without duration=, testing the required-duration check; passes when neither OBM_NEW_GIVEN nor OBSTACLE_ALERT is published.

invalid_given_nonconvex_absent_pass

Posts a GIVEN_OBSTACLE whose three vertices are collinear, testing invalid-polygon rejection; passes when OBM_NEW_GIVEN is never set, no OBM_DIST_TO_OBJ publication is observed, and OBSTACLE_ALERT remains empty.

post_dist_always_pass

Sets post_dist_to_polys=true and posts an obstacle 35 meters away, outside the 25-meter alert range, testing unconditional distance publication; passes when OBM_NEW_GIVEN=true and OBM_DIST_TO_OBJ=OB_FAR,35.0.

post_dist_false_absent_pass

Sets post_dist_to_polys=false before posting the near obstacle, testing distance-output suppression without rejecting the obstacle; passes when OBM_NEW_GIVEN=true and no OBM_DIST_TO_OBJ publication is observed.

points_cluster_dist_pass

Posts four TRACKED_FEATURE points under key=rock_a, testing conversion of a point cluster into an obstacle hull and its distance calculation; passes when OBM_DIST_TO_OBJ=ROCK_A,18.0 and 17 < OBM_MIN_DIST_EVER < 19.

custom_point_var_pass

Sets point_var=OBM_POINTS and posts the same four points on OBM_POINTS, testing the configurable point-input subscription; passes when OBM_DIST_TO_OBJ=ROCK_A,18.0 and 17 < OBM_MIN_DIST_EVER < 19.

invalid_point_missing_key_absent_pass

Posts four TRACKED_FEATURE points without key= or label=, testing rejection before cluster creation; passes when no OBM_DIST_TO_OBJ publication is observed and OBSTACLE_ALERT remains empty.

max_pts_per_cluster_trim_pass

Sets max_pts_per_cluster=3 and posts five points under key=rock_a, with the first two 10 meters away and the latest three 22 meters away, testing that the cap discards the older near points; passes when the current report is OBM_DIST_TO_OBJ=ROCK_A,22.0.

points_ignore_range_absent_pass

Sets ignore_range=10 and posts a point cluster whose nearest point is 18 meters away, testing point rejection outside the input range; passes when no OBM_DIST_TO_OBJ publication is observed and OBSTACLE_ALERT remains empty.

points_age_resolve_pass

Sets max_age_per_point=3 and posts four points under key=rock_a, testing point-cluster expiration; passes at 10 seconds when OBM_RESOLVED=rock_a.

lasso_cluster_pass

Sets lasso=true and lasso_radius=5 for three collinear points centered 20 meters east of the vehicle, testing pseudo-hull construction instead of the normal convex hull; passes when 14 < OBM_MIN_DIST_EVER < 16.

placeholder_hull_pass

Posts three collinear points with lasso disabled, testing the placeholder-polygon fallback when a convex hull cannot be formed; passes when 19 < OBM_MIN_DIST_EVER < 21.

post_view_polys_false_absent_pass

Sets post_view_polys=false and posts a valid four-point cluster, testing that visualization can be suppressed without suppressing obstacle processing; passes when OBM_DIST_TO_OBJ=ROCK_A,18.0 and no VIEW_POLYGON mail is observed.

new_obs_flag_macros_pass

Configures new_obs_flag=OBM_NEW_STATS=now_$[OBS_NOW]_ever_$[OBS_EVER] and posts the first near obstacle, testing macro expansion of current and lifetime obstacle counts; passes when OBM_NEW_STATS=now_1_ever_1 and OBM_DIST_TO_OBJ=OB_NEAR,18.0.

point_vsource_alert_pass

Adds vsource=radar to every point in the rock_a cluster, testing preservation of the source tag in the generated alert; passes when ALERT_SEEN=true, OBM_DIST_TO_OBJ=ROCK_A,18.0, and the complete OBSTACLE_ALERT exactly matches the polygon payload containing vsource=radar.

given_after_points_same_key_reject_pass

Builds the mix_key point cluster and then posts a GIVEN_OBSTACLE with the same label, testing key-ownership conflict handling; passes when OBM_DIST_TO_OBJ=MIX_KEY,18.0 and the given-obstacle OBM_NEW_GIVEN flag is never set.

disable_obstacle_pass

Sets disable_var=OBM_DISABLE, accepts ob_near, and posts OBM_DISABLE=ob_near, testing generation of BHV_ABLE_FILTER=obstacle_id=ob_near,action=disable; passes only when that complete payload is observed.

disable_vsource_pass

Posts OBM_DISABLE=vsource=radar, testing the source-selector branch of the modification parser; passes when OB_FILTER_SEEN=true and BHV_ABLE_FILTER=vsource=radar,action=disable exactly.

enable_obstacle_pass

Sets enable_var=OBM_ENABLE, accepts ob_near, and posts OBM_ENABLE=ob_near, testing generation of BHV_ABLE_FILTER=obstacle_id=ob_near,action=enable; passes only when that complete payload is observed.

expunge_obstacle_pass

Sets expunge_var=OBM_EXPUNGE, accepts ob_near, and posts OBM_EXPUNGE=ob_near, testing generation of BHV_ABLE_FILTER=obstacle_id=ob_near,action=expunge; passes only when that complete payload is observed. This case intentionally grades the public filter translation only; the bare-ID removal defect is recorded separately as a suggested upstream change.

Source links

Harness README Mission README