3.5 Terrain crossings
Routes go around terrain like bumps and ramps unless a leg is allowed to cross it. The examples use the left bump of the bundled REBUILT 2026 pack, because the REEFSCAPE 2025 pack has no terrain.
Cross it
This route drives over bumpLeft on its second leg and goes around terrain on the third.
import com.tempo.Alliance;
import com.tempo.Arrival;
import com.tempo.Composer;
import com.tempo.Terrain;
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
Composer bumpCross = Composer.startAt(new Pose2d(2.0, 5.55, Rotation2d.fromDegrees(0)))
.originAlliance(Alliance.BLUE)
.to(3.30, 5.55)
.arrival(Arrival.through(0.8)) // at most 80% speed into the bump
.to(5.60, 5.55)
.cross(Terrain.named("bumpLeft")) // this leg may drive over it
.to(7.00, 4.50); // no cross(): routed around terrainfrom tempo import Alliance, Arrival, Composer, Terrain
from wpimath.geometry import Pose2d
bump_cross = (Composer.start_at(Pose2d(2.0, 5.55, 0.0))
.origin_alliance(Alliance.BLUE)
.to(3.30, 5.55)
.arrival(Arrival.through(0.8)) # at most 80% speed into the bump
.to(5.60, 5.55)
.cross(Terrain.named("bumpLeft")) # this leg may drive over it
.to(7.00, 4.50)) # no cross(): routed around terrain#include <tempo/Composer.h>
#include <tempo/Terrain.h>
auto bump_cross = tempo::Composer::start_at(2.0, 5.55, 0.0)
.origin_alliance(tempo::Alliance::Blue)
.to(3.30, 5.55)
.arrival(tempo::Arrival::through(0.8)) // at most 80% speed into the bump
.to(5.60, 5.55)
.cross(tempo::Terrain::named("bumpLeft")) // this leg may drive over it
.to(7.00, 4.50); // no cross(): routed around terraincross(...) applies to the to(...) before it, and several cross calls on one leg are
crossed in the order written. The id has to be a [[terrain]] entry in the loaded pack
(Create a game pack). Any other id throws when the cross
call runs.
The robot’s speed at each end of a crossing leg is set by that waypoint’s
arrival, so a leg after a STOP starts from
rest. If a ramp needs momentum to get over, leave the waypoint before it on the default
THROUGH or give it a through(...) arrival like the example’s.
A leg that starts or ends with the robot’s center on a piece of terrain can drive anywhere on
it without cross.
Crossings can also be set on the Paths screen in Tempo’s GUI.
Crossing depth and targets
If the straight line of the leg already passes over the terrain, the robot crosses where the
line does. Otherwise it crosses at the nearest edge. crossingDepth moves the nearest-edge
point inward, and target sets the point:
import static edu.wpi.first.units.Units.Meters;
// Cross 0.3 m in from the nearest edge, on a leg whose line misses the bump.
Terrain deeper = Terrain.named("bumpLeft").crossingDepth(Meters.of(0.3));
// Cross through the bump's center, facing +X the whole way over.
Terrain centered = Terrain.named("bumpLeft").target(4.63, 5.56, Rotation2d.fromDegrees(0));
// Either one goes in a leg's cross(...).
route.to(5.60, 5.55).cross(centered);# Cross 0.3 m in from the nearest edge, on a leg whose line misses the bump.
deeper = Terrain.named("bumpLeft").crossing_depth(0.3)
# Cross through the bump's center, facing +X the whole way over.
centered = Terrain.named("bumpLeft").target(4.63, 5.56, heading_rad=0.0)
# Either one goes in a leg's cross(...).
route.to(5.60, 5.55).cross(centered)// Cross 0.3 m in from the nearest edge, on a leg whose line misses the bump.
auto deeper = tempo::Terrain::named("bumpLeft").crossing_depth(0.3);
// Cross through the bump's center, facing +X the whole way over.
auto centered = tempo::Terrain::named("bumpLeft").target(4.63, 5.56, 0.0);
// Either one goes in a leg's cross(...).
route.to(5.60, 5.55).cross(centered);crossingDepth (crossing_depth) is in meters, or a Distance in Java. It goes from 0 at
the near edge up to the terrain’s center.
Python needs the heading as a keyword, target(x, y, heading_rad=h).
The robot drives a straight line through the target. If you give it a heading, it turns before it reaches the terrain and holds that heading until its center is past the terrain. Without one it keeps the heading it came in with.
The target has to be on the terrain, and it can’t be used with a positive depth. A target with
a heading also makes the robot stop at the waypoints on both ends of the leg. If no route
reaches the target, the leg is skipped. A missed target or heading fails the leg, and the leg
runs its runOnFailure command.
A crossing without a target that no route reaches is left out, and the leg drives around the
terrain. Tempo prints a [Tempo] line with the terrain id and the reason
(Crossing console lines). The tolerances
and every target form are under Terrain.
Speed caps on terrain
Without a cap the robot crosses at the leg’s limits. To set one, add a TerrainConfigs to
your config:
import com.tempo.config.TempoConfig;
import com.tempo.config.TerrainConfigs;
public static final TempoConfig CONFIG = new TempoConfig()
// ... the rest of the config
.withTerrain(new TerrainConfigs()
.defaultCap(1.5) // m/s inside any crossed terrain
.cap("bumpLeft", 2.0)); // m/s on this bumpfrom tempo import TempoConfig, TerrainConfigs
CONFIG = (TempoConfig()
# ... the rest of the config
.with_terrain(TerrainConfigs()
.default_cap(1.5) # m/s inside any crossed terrain
.cap("bumpLeft", 2.0))) # m/s on this bump#include <tempo/Tempo.h>
inline const tempo::TempoConfig kConfig = tempo::TempoConfig{}
// ... the rest of the config
.with_terrain(tempo::TerrainConfigs{}
.default_cap(1.5) // m/s inside any crossed terrain
.cap("bumpLeft", 2.0)); // m/s on this bumpA cap applies only inside the terrain, on a leg that crosses it. If the cap is lower than the speed a ramp needs to get over, the robot can get stuck on it. The other options are in the TerrainConfigs reference.
If it fails…
No route reaches the crossing, so it was left out. The reason after cannot be reached: names what blocked it.
The target isn’t reachable, and a targeted crossing has no fallback. Move the target onto the terrain where the robot fits.
The terrain cap is lower than the speed the ramp needs. Raise the cap for that terrain id.