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

Tempo

Path planning for FRC, written in Rust.

The Paths screen of Tempo's GUI with a path named New Path open on the REBUILT 2026 field: the planned path runs from the start near the depot, over the blue trench and down into the fuel at the center, with the waypoint list on the right and the bottom bar of screens.

Example

This REEFSCAPE route drives from the starting line to reef branch G and scores on L4. The poses need the REEFSCAPE 2025 pack, which isn’t Tempo’s default pack.

  1. A Composer is one route the robot drives.
  2. startAt sets the pose the route starts from, here the middle of the blue starting line.
  3. resetOdometry(true) sets the robot’s pose to the start pose when the route begins.
  4. originAlliance sets the alliance the route was written for. On the other alliance, Tempo mirrors the route (alliance flipping).
  5. speed sets how fast the robot drives. FULL, the default, uses every configured limit, and the slower speeds scale them down.
  6. to adds a pose to drive to, here the reef in front of branch G.
  7. runAfter adds a command that runs after the drive, here scoring on L4.

In C++ the route keeps the pointer from score.get(), so score has to outlive the route. Keep it as a member next to the route.

Java
import com.tempo.Alliance;
import com.tempo.Composer;
import com.tempo.Speed;
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;

Composer scoreG = Composer
    .startAt(new Pose2d(7.58, 4.03, Rotation2d.fromDegrees(180)))
    .resetOdometry(true)
    .originAlliance(Alliance.BLUE)
    .speed(Speed.FULL)
    .to(5.77, 3.86, Rotation2d.fromDegrees(180))
    .runAfter(superstructure.scoreL4());
Python
import math

from tempo import Alliance, Composer, Speed
from wpimath.geometry import Pose2d, Rotation2d

score_g = (Composer
    .start_at(Pose2d(7.58, 4.03, Rotation2d.fromDegrees(180)))
    .reset_odometry(True)
    .origin_alliance(Alliance.BLUE)
    .speed(Speed.FULL)
    .to(5.77, 3.86, math.radians(180))
    .run_after(superstructure.score_l4()))
C++
#include <frc2/command/CommandPtr.h>
#include <tempo/Angles.h>
#include <tempo/Composer.h>
#include <tempo/wpi/Setlist.h>

frc2::CommandPtr score = superstructure.ScoreL4();

auto scoreG = tempo::Composer
    ::start_at(tempo::wpilib::Pose2d{
        tempo::wpilib::units::meter_t{7.58},
        tempo::wpilib::units::meter_t{4.03},
        tempo::wpilib::units::degree_t{180}})
    .reset_odometry(true)
    .origin_alliance(tempo::Alliance::Blue)
    .speed(tempo::Speed::Full)
    .to(5.77, 3.86, tempo::angles::deg(180))
    .run_after(score.get());

Find a topic

esc

Loading search...