gait_phase — DRIVE locomotion op

• Data kinds: matrix → table

• Call: import fullseye as fs; fs.ledger.gait_phase(foot_heights, stance_frac: 'float' = 0.25, ground=None, contact_tol=None) (to call the implementation directly, import locomotion; locomotion.gait_phase(foot_heights, stance_frac: 'float' = 0.25, ground=None, contact_tol=None); from the registry, opsdrive.get("gait_phase"))

• GPU: none (CPU reference implementation only)

Usage

Classify each foot as stance (planted) or swing per frame from its height.

foot_heights is (T, F) — the height of each of F feet over T frames. Returns {stance (T,F bool), duty_factor (F,), n_contacts (T,), double_support} (duty factor, Alexander 1984; how many feet are down each frame; fraction of frames with >=2 feet down).

★Stance is defined against a ground reference:

• ground given (recommended for anti-cheat) — a foot is stance only when it is within contact_tol of the absolute floor level ground. This is the honest test: an airborne / hopping / frozen-in-air foot is correctly NOT stance. contact_tol defaults to stance_frac × the foot's own range.

• ground=None (default, backward-compatible) — stance is inferred from each foot's OWN height range (within stance_frac of its per-foot minimum). ★This heuristic CANNOT tell a foot planted on the floor from a foot at the bottom of an airborne trajectory, so it must NOT be used as a stability / cheat gate — pass ground for that.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• consumer_hillco — py -3.11 examples/consumer_hillco.py

• consumer_onocollo — py -3.11 examples/consumer_onocollo.py

• walking_ops_tour — py -3.11 examples/walking_ops_tour.py

Ops the type connects to (they accept table as input)

course_layout · course_occupancy · course_contains · world_build · world_camera · world_move · lidar_scan · rss_longitudinal_same

Same category (locomotion)

contact_points · com_from_silhouette · support_polygon · com_support_margin · support_line_margin · lipm_capture_point · capture_margin · gait_step_events


*Provenance: locomotion.py — DRIVE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.