Tap Before You Step: Safe Exploration When a Legged Robot Cannot Trust Its Eyes

A legged robot crossing stepping stones or broken ground has two kinds of senses. Its camera sees the terrain ahead but is sometimes wrong: glass, glare, dark pits and soft foam all fool a depth sensor. Its joints and motors feel the ground reliably, but only after the foot is already on it. Current methods for learning safely on real hardware ignore the camera. Current methods for learning with a camera ignore training-time safety. This proposal joins the two with a simple rule enforced during learning: the robot may put its weight only on ground that has been verified, either by a vision estimate it has learned to trust or by a light, force-limited foot tap. Under this rule, probing uncertain ground is the only allowed way forward, and it does not need to be bribed with a reward bonus. The same rule removes the usual dilemma where falls are either penalized too little, so the robot is reckless, or too much, so it refuses to move.

The rule has a second payoff. Every tap compares what the camera predicted with what the foot felt, which gives free labels for learning where vision can be trusted. So the robot should tap less and less on terrain its camera handles well, and keep tapping on glass, foam and reflective surfaces. That prediction is concrete and falsifiable. The proposal is to build this verification-gated safety layer for a quadruped, train through it in simulation and on hardware, and test whether it beats both blind safety shields and perception policies trained without safety constraints on terrain where the only route crosses ambiguous footholds.

Core Claim

Safe exploration on discrete terrain with unreliable exteroception (sensing of the outside world: depth images, height maps) should be written as a state-wise constraint on weight-bearing contact with unverified ground, not as a penalty on falls alone. When a proposed weight-bearing step fails the verification check, a supervisory layer converts it into a bounded-force probe at the same target instead of handing control to a recovery policy. Three results follow if the claim holds. First, near-zero falls during training on terrain that defeats blind shields. Second, no collapse into the "stand still" policy. Third, a learned vision-confidence map whose probe rate falls on reliable surfaces and stays high on deceptive ones.

Where This Sits in Prior Work

The closest system is the dual-policy locomotion learner of Safe Reinforcement Learning for Legged Locomotion. It predicts falls with a simplified whole-body momentum model (a centroidal dynamics model) over a short horizon and hands control to a recovery policy when a fall looms. It reports fewer than five falls in 115 minutes of real training on a Unitree A1. That paper supplies our shield structure and our hardware protocol, but its shield is blind: it checks base height and tilt, assumes supported ground, and the authors state it cannot handle terrain discontinuities or slippage. We add terrain geometry and, more importantly, terrain trust to the check. We also replace "switch to recovery" with "switch to probe," which keeps the step and gathers information instead of discarding it.

Two papers show that foothold feasibility can be predicted but do not close the loop. Learning Dynamic Bipedal Walking Across Stepping Stones trains a reachability predictor that filters infeasible stones for Cassie and lifts gap-crossing success from 50.2% to 82.3%. That predictor is an offline supervised filter fed by an overhead marker-tracking camera, and it is not used during reinforcement learning. Visual-Locomotion learns footholds from onboard depth with a 20 Hz planner over a 250 Hz model predictive controller, reaching a gap score of 10.1 out of 12 against 0.9 for a blind policy. Its early stepping-stone exploration has no safety mechanism, and it is open-loop between steps. We reuse its hierarchical split, so the high level picks footholds and the low level executes them, and we add training-time safety.

Two papers motivate the verification idea by showing that vision and touch disagree in practice. VP-Nav detects glass walls from joint-torque tracking errors and injects them into the occupancy map as virtual obstacles, reaching 100% success. It does so only after impact, and it walks around hazards rather than over them. Resilient Legged Local Navigation trains an asymmetric actor-critic, in which a value network sees the true terrain while the policy sees a corrupted map. The policy's memory is aligned to the privileged terrain, and success stays above 80% at 0% visibility. That paper has no constraint bounds, and its authors name active probing as missing. Our proposal is a direct attempt at that missing piece, with the probe made a structural part of the safety constraint.

On the reward side, the evidence constrains design more than it supplies a method. Additive penalties sit on a knife-edge between recklessness and a "safe but useless" standstill (Quanyi Li et al.), and miscalibrated penalties invite shortcut behaviour (Yoni Birman et al.). PSRAB shows that moving a secondary goal out of the reward and into the structure of the action space removes gradient interference for manipulators. That argument is what we borrow: safety leaves the reward sum and becomes an action-level gate. Its null-space mechanism, which uses spare arm joints so a secondary goal cannot disturb the main task, does not transfer to legged robots, which lack such spare joints. CR-MOPO keeps separate value estimates per objective and resolves conflicts between them in the gradient. It reports a Walker move reward above 800 against under 250 for LP3, but only on clean joint-state MuJoCo tasks. We use its separate-critic idea for the remaining trade-off between progress and energy, and we test whether it matters at all.

Research Program

The robot is a quadruped with a forward depth camera, using a hierarchy like Visual-Locomotion. A high-level policy reads the height map, a per-cell confidence map and proprioceptive history. At each step it proposes a foothold and a load mode, either commit or probe. A low-level controller executes the step. In a probe, the swing foot descends to the target while the other three feet keep full support, and ground reaction force is capped at a fraction $f_{\text{probe}}$ of body weight. The probe records contact height and apparent stiffness, then the foot lifts or transitions to a commit if the cell verifies.

Each height-map cell $j$ carries a confidence $\kappa_j \in [0,1]$ produced by a small network. Its inputs are depth validity, temporal consistency across frames, and local appearance. The network is trained online on probe outcomes: a probe that finds the surface where vision predicted, with rigid contact, is a positive label, and anything else is a negative. A cell is verified if $\kappa_j \ge \tau$ or if it has been probed successfully. The per-step safety cost is

$$c_t = \mathbb{1}[\text{fall}_t] + \sum_{k} \mathbb{1}\big[F_{k,t} > f_{\text{probe}}\big]\,\mathbb{1}\big[j(k,t)\ \text{unverified}\big],$$

where $F_{k,t}$ is the vertical force on foot $k$ at time $t$ and $j(k,t)$ is the cell under it. Because this cost is defined per state rather than per trajectory, it can be enforced step by step. The shield checks each proposed commit in three parts: that the target cell is verified, that it lies inside a feasible foothold region of the height map, and that the momentum model of Safe Reinforcement Learning for Legged Locomotion predicts a stable base over its horizon given the proposed support. If the cell is unverified, the commit is rewritten as a probe. If the geometry or dynamics check fails, the recovery policy takes over, as in the original. The policy is trained on its proposed actions, with a constraint critic learning which proposals get rewritten. It therefore learns to propose probes itself where they will be needed, and not to lean on the shield. This is also a partial answer to the "safety paradox" raised by Feasible Dual Policy Iteration, where safer policies generate fewer unsafe samples for the safety critic: probes are low-risk encounters with exactly the states the constraint critic needs to see.

The reward keeps only forward progress and energy, as two separate critics. We compare a weighted sum against a conflict-averse update in the style of CR-MOPO. Probing costs time and energy and is never rewarded directly. The analysis question is whether the gate alone makes probing appear where, and only where, vision is unreliable.

Baselines

The naive reference is the vision foothold policy of Visual-Locomotion, retrained with PPO and an additive fall penalty. Its penalty weight is swept over the same tuning budget as our method. It shows what happens with no safety mechanism and establishes the reckless-versus-frozen curve. A stronger constrained baseline is PPO-Lagrangian with the same fall cost, which the Safety-Gymnasium paper reports cuts violations by 98% relative to PPO at a 45% reward loss on its velocity tasks. We expect it to commit many violations early in training, as Constrained MDPs via Backward Value Functions documents for convergence-only methods.

The strongest existing safe-exploration competitor is the blind dual-policy shield of Safe Reinforcement Learning for Legged Locomotion, given the same vision policy. It reports fewer than five falls in 115 minutes of hardware training and 48.6% fewer simulated falls than Recovery RL and PCPO, but on flat or modeled terrain. The file contains no reported result for it on stepping stones or corrupted perception. We run it with identical observations, compute, wall-clock budget and tuning sweeps. Beating it means fewer cumulative training falls on the ambiguous-terrain suite at equal or better final success.

The strongest perception-robustness competitor is the asymmetric actor-critic of Resilient Legged Local Navigation, trained in simulation with the same sensor corruptions and transferred without online constraints. It reports above 80% success at 0% visibility on its own hills, boxes and pits terrain. We give it an equal simulation budget and our terrain distribution. Beating it means higher success on the deceptive-surface categories, where passive memory cannot help before first contact.

The key ablation is a vision-aware shield without probing: cells below $\tau$ are simply forbidden, much like extending the Cassie reachability filter of Learning Dynamic Bipedal Walking Across Stepping Stones to onboard height maps. It isolates the probe-conversion ingredient. Further ablations replace the learned confidence with a fixed depth-validity threshold, which isolates self-supervised calibration, and swap the conflict-averse update for a weighted sum, which isolates the multi-objective component.

Why not just…?

Why not just train with heavy sensor corruption in simulation and transfer zero-shot? This is the most serious threat, and Resilient Legged Local Navigation shows it achieves a lot. Its limit is that it learns what to do after contact and never forms an incentive to test ground first; its authors list active probing as future work. Simulated depth also rarely reproduces real glass, glare and invalid bands (VP-Nav), and real tuning doubled balance duration over simulation-only transfer in Safe Reinforcement Learning for Legged Locomotion. If this baseline matches us on the deceptive-surface categories in simulation, the claim for our method shrinks to training-time safety on hardware, and we will report it that way.

Why not just forbid stepping on uncertain cells? This is exactly the no-probe ablation. It will be safe, and on terrain with a detour it may be efficient. On terrain where every route crosses an ambiguous stone, it can only freeze or detour, and if vision confidence is miscalibrated it forbids good stones forever, because it never collects the labels that would correct it. The suite deliberately includes forced-crossing layouts, and we will report both layout types so that the detour case is not hidden.

Why not just add a penalty on uncertainty, or a bonus for probing, to the reward? A penalty reproduces the knife-edge that Quanyi Li et al. describe. A probing bonus invites the robot to tap forever instead of walking, the kind of shortcut Yoni Birman et al. document. We run the bonus variant on top of the zero-shot baseline and measure probes per meter on terrain with reliable vision, where any probing is waste.

Why not just use a classical map-plan-execute pipeline? Classical planners stall or fail on unmapped hazards in Resilient Legged Local Navigation and were 27% less time-efficient in VP-Nav. They also have no mechanism for resolving a mismatch between the map and the feet before committing weight. We do not rerun this baseline.

Proposed Experiments

In simulation (Isaac Gym, following Robust RL-Based Locomotion for Resource-Constrained Quadrupeds), we build a stepping-stone and gap suite with four stone types: honest stones; invisible stones with missing depth; deceptive stones that render solid but are compliant or sink; and phantom surfaces that appear in depth but offer no support. Each type is presented in detour and forced-crossing layouts. The metrics are:

  • cumulative falls and unverified weight-bearing events during training;
  • final crossing success;
  • traversal time and energy per meter;
  • probes per meter, broken down by stone type;
  • calibration of $\kappa$ against probe outcomes.

On hardware, we repeat the protocol of Safe Reinforcement Learning for Legged Locomotion on an A1-class robot with a depth camera, over acrylic, foam and rigid blocks. Falls are counted per training hour, with its fewer-than-five-falls-in-115-minutes figure as the reference to beat on harder terrain. Final gap performance is reported alongside the 10.1 of 12 of Visual-Locomotion, noting that terrains differ.

Three checks decide the proposal.

  1. Against the blind shield on forced-crossing deceptive layouts, training falls should drop by a clear margin, not within seed noise, while success stays at least equal.
  2. Against the forbid-uncertain ablation on the same layouts, success should be much higher at matched fall counts. If it is not, probe conversion adds nothing.
  3. Probe rate should decay on honest stones and stay high on deceptive ones over the course of training. A flat probe rate everywhere would mean the confidence model is not learning, and the method would reduce to a slow, cautious walker.