SABER: Learning Attention-based Semantic Affordance for Legged Locomotion
Authors: Hari Prasanth Palanivelu, Samuel Sze, Kennard Garrison Johannes, Albertus Hendrawan Adiwahono, Meng Yee Michael Chuah
Organizations: Institute of Advanced Intelligence and Computing (IAIC), Agency for Science, Technology and Research (A*STAR), Singapore. · Nanyang Technological University, Singapore.
Perceptive legged locomotion has advanced rapidly by integrating terrain geometry into learned policies, yet the integration of terrain meaning remains sparse: a pipe, a patch of grass, or a fragile box may be geometrically traversable while being inappropriate for contact. In industrial environments, where legged robots increasingly operate, a single misplaced step can damage fragile equipment, destabilize the robot, or endanger the site. To address this, we introduce SABER, a planner-free reinforcement-learning policy that jointly reasons about terrain geometry and semantic contact permission. The policy consumes a unified terrain-affordance map, where each cell encodes local 3D geometry and a semantic contact cost. We augment cross-attention with a learned, signed semantic bias: an additive term on the attention logits, gated by the contact cost, that reweights flagged cells by their distance from the nearest foot. A hazard therefore reshapes attention where it can still affect the next foothold, and its influence fades where it cannot. The resulting policy selects footholds on permitted support and keeps the leg clear of forbidden regions throughout the swing phase. We perform a systematic ablation that isolates the contribution of each architectural component; removing the semantic bias alone increases forbidden contacts by 55% while velocity tracking is unchanged. We validate the policy on a Unitree B2, demonstrating sim-to-real semantic contact selection across indoor and outdoor environments and four semantic obstacle classes.
Figures & tables
Fig. 1 : Semantic contact selection on hardware. The Unitree B2 crosses a flagged pipe without touching it (right); in the corresponding terrain-affordance map (left), the pipe’s cells carry contact cost r=1 (red) while geometrically similar unflagged terrain remains available for support.
Fig. 2 : Overview of the proposed framework. A CNN tokenizes the terrain-affordance map and a single proprioceptive query attends over the tokens; the contact cost enters both as a CNN input channel and as a distance-structured semantic bias on the attention logits.
Fig. 3 : Training terrain suite. a) rough terrain; b) pipes; c) semantic stepping stones; d) rails; e) lava tiles; f) concentric grass rings. Colored terrain regions are flagged. In the terrain-affordance map, red points denote flagged cells and blue points denote unflagged cells.
Fig. 4 : Feet contacts per episode on the three terrains without a geometric cue. On the stepping stones, the concentric grass rings, and the lava tiles, flagged and unflagged ground have identical geometry, so only the cost channel can tell them apart.
Observation
Noise
Unit
Base angular velocity
U(−0.2,0.2)
rad/s
Projected gravity
U(−0.05,0.05)
–
Joint position
U(−0.01,0.01)
rad
Joint velocity
U(−1.5,1.5)
rad/s
Foot position
U(−0.03,0.03)
m
Foot velocity
U(−0.25,0.25)
m/s
TABLE II : Actor observation noise.
Fig. 5 : Indoor scenes. (a) Semantic stepping stones: the B2 steps on the concrete rails and keeps its feet off the flagged cardboard boxes. (b) B2 crossing a 30cm pipe. (c) B2 crossing turf patches sideways. (d) Three low pipes, the tallest 11cm , laid parallel.
Fig. 6 : Visualization of attention in mjlab . Attention over the N=231 terrain tokens, averaged over the eight heads, on four training terrains. Small blue markers are map cell centres in the yaw-aligned robot frame; sphere size and colour encode the attention weight a cell receives. Uniform attention would assign 1/231=0.004 to every token.
Fig. 7 : Learned semantic attention bias. (a) Effective bias βhρh(d) of each head against the distance d to the nearest foot. (b) Change in attention mass on flagged cells caused by the bias, per terrain. Negative means the bias diverts attention away from flagged cells.
Fig. 8 : Outdoor tiles with grass gaps , the hardware counterpart of the lava tiles. (a) With semantics active, the B2 places its feet on the tiles (solid circles). (b) Without semantics, the same policy steps onto the grass (dashed circles).
Fig. 9 : Outdoor pipe and grass. (a) Crossing a pipe on a timber deck. (b) Walking along a strip of grass beside a pavement. The circle marks the foot nearest the flagged object, which passes over the pipe and stays on the pavement.
Legged robots maintain dynamic feasibility through multicontact interactions with terrain. Learned foothold prediction can provide feasibility-aware costs for motion planning and path selection, but accurately predicting future contacts from perceptual inputs such as height scans remains challenging on highly unstructured terrain, even with a repetitive gait cycle. In this work, we show that modeling epistemic uncertainty in predicted footholds, conditioned on terrain observations and commanded motion, distinguishes in-distribution from out-of-distribution operating regimes in simulation and real-world settings. This allows a single learned model, trained on limited data distributions, to express uncertainty caused by missing training coverage. We use this learned uncertainty to detect OOD regions and incorporate them into a unified costmap-generation framework for uncertainty-aware path planning. Using these uncertainty-aware costmaps, we evaluate feasibility error across in-distribution and OOD terrains in simulation and real-world settings. The results show improved OOD detection, up to a 37% reduction in simulation feasibility error, and more reliable planning behavior than geometry-only baselines.
Perceptive locomotion policies typically observe a dense robot-centric elevation map, although only the terrain beneath and around the next footsteps informs the control decision. Learned encoders compress the whole visual input, leaving the policy to work out which inputs matter while learning the baseline locomotion task. Learning both at once slows training and, without computationally expensive attention mechanisms, makes generalization to new terrain harder. We instead remove redundant inputs from the elevation map before the policy sees it. A lightweight foothold prediction model (FPM) predicts future footholds from proprioception and the velocity command alone, and we sample the elevation map only in small patches around these predicted footholds. We train the prediction model alongside the locomotion policy, periodically retraining it on new policy rollouts as the robot's gait matures. This allows the perception to anticipate where the policy will step, while the policy learns to leverage terrain information around those steps. With the proposed lightweight preprocessing, the policy reaches a given terrain difficulty in roughly a third of the training iterations required with the complete map. It outperforms policies that observe the complete map where footholds are sparse, including in narrow walled corridors, and on unseen terrain, and it matches an attention-based encoder trained at several times the cost. The policy transfers zero-shot to a Unitree G1 humanoid traversing various obstacles, stairs, gaps, and step-downs beyond the training distribution in both indoor and outdoor environments.
Matthias Heyrman, Chenhao Li, Ioannis Dadiotis +1
Robotic Systems Laboratory, ETH Zürich, Switzerland. · ETH AI Center, ETH Zürich, Switzerland.
Learning-based control has revolutionized dynamic locomotion, yet navigating unstructured terrain remains limited by a robot's incomplete awareness of imminent ground contact. While global perception systems such as LiDARs and depth cameras provide environmental context, they are frequently plagued by latencies, occlusions, and the high computational cost of dense geometric reconstruction. On the other hand, proprioceptive feedback is purely reactive, initiating corrections only after impact has occurred. This work explores embedding a minimal suite of low-cost, high-frequency infrared proximity sensors directly into the feet of a quadrupedal robot. These sensors provide "pre-contact" feedback that is robust to self-occlusions and significantly less computationally demanding than conventional vision-based pipelines. By integrating these localized signals into a reinforcement learning framework, we enable the robot to anticipate terrain discontinuities such as gaps and stepping stones that are problematic for traditional perception stacks due to occlusions or state estimation drift. We demonstrate that such sparse, near-field sensing can be reliably modeled in simulation and transferred to the real world with high fidelity. Experimental results show that local proximity sensing substantially improves traversal robustness over discrete terrain and offers a low-power, low-latency alternative or complement to complex global perception suites in unpredictable environments. For more information about results and methods, please see the project website: https://sites.google.com/view/foot-tof/home.
Jiale Fan, Connor Flynn, Tianao Xu +4
All authors are with the Robotic Systems Lab, ETH Zurich.