4.10 Terrain
TerrainConfigs caps the robot’s speed inside terrain a leg crosses. Pass it to
withTerrain(...). defaultCap and cap also take a plain SI supplier
(Live tuning).
TerrainConfigs
Java
import com.tempo.config.TerrainConfigs;
TerrainConfigs terrain = new TerrainConfigs()
.defaultCap(1.5) // m/s inside any crossed terrain
.cap("bumpLeft", 0.8); // per-id overridePython
from tempo import TerrainConfigs
terrain = (TerrainConfigs()
.default_cap(1.5) # m/s inside any crossed terrain
.cap("bumpLeft", 0.8)) # per-id overrideC++
#include <tempo/TerrainConfigs.h>
auto terrain = tempo::TerrainConfigs{}
.default_cap(1.5) // m/s inside any crossed terrain
.cap("bumpLeft", 0.8); // per-id override| Java | Python / C++ | Effect |
|---|---|---|
new TerrainConfigs() | TerrainConfigs(), tempo::TerrainConfigs{} | No caps: every crossed terrain at the leg’s limits |
defaultCap(mps) | default_cap(mps) | Cap for any crossed terrain without its own entry |
cap(id, mps) | cap(id, mps) | Cap for the terrain with this id |
Caps are in m/s or a WPILib speed unit.
- Caps apply inside terrain a leg crosses with
.cross(Terrain.named(id))(Terrain crossings), and an uncapped crossing runs at the leg’s limits. - A default that isn’t finite and positive leaves crossings uncapped. A per-id cap that isn’t finite and positive leaves that terrain uncapped whatever the default is.
capFor(id)(cap_for) reads the per-id cap, then the default if there’s no per-id cap, and infinity (an emptystd::optionalin C++) if there’s neither. Java returns a cap that isn’t finite and positive as it was set, and it still means uncapped.- Caps are robot-wide and a leg can’t override them.
bumpLeft is a REBUILT 2026 terrain, and the REEFSCAPE 2025 pack has none.
Warning A cap below the cresting speed strands the robot
A ramp may need entry speed to crest, and a cap below that speed can leave the robot on the ramp.