Skip to content
Tempo on GitHub (opens in a new tab)

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.

Java
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 terrain
Python
from 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
C++
#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 terrain

cross(...) 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:

Java
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);
Python
# 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)
C++
// 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:

Java
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 bump
Python
from 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
C++
#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 bump

A 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…

The robot drives around the bump Regions, zones and terrain → [Tempo] leg 2 (target 5.60, 5.55): crossing 'bumpLeft' cannot be reached: {reason}; the leg drives to its target without crossing it

No route reaches the crossing, so it was left out. The reason after cannot be reached: names what blocked it.

A leg with a crossing target is skipped Above → [Tempo] leg 2 (target 5.60, 5.55): crossing 'bumpLeft' cannot be reached: {reason}; a crossing with a target has no fallback, so the leg has no route

The target isn’t reachable, and a targeted crossing has no fallback. Move the target onto the terrain where the robot fits.

The robot stops on a ramp Above →

The terrain cap is lower than the speed the ramp needs. Raise the cap for that terrain id.

esc

Loading search...