4.1 API overview
Java, Python and C++ use the same class names, apart from a few C++ spellings
noted on each page (DcMotor, PidConstants). Methods are camelCase in Java
and snake_case in Python and C++.
These C++ names are capitalized, and every other C++ method is snake_case
(Arrival::through(0.8), Arrival::pause(0.5)):
Bias::TowardArrival::Through()andArrival::Stop(), which stand for Java’sTHROUGHandSTOPconstants- the
tempo::Posefactories and methods (Pose::At,Pose::Named,Pose::Capture), declared in<tempo/wpi/Pose.h> - the
SwerveModulesvendor factories (SDS::MK4i,REV::MaxSwerve) andGamePacks::REBUILT_2026() - enum values such as
Alliance::Blueand the module gears
These imports cover a simple auto:
import com.tempo.Bias;
import com.tempo.Composer;
import com.tempo.Condition;
import com.tempo.Speed;
import com.tempo.Tempo;
import com.tempo.TempoAutos;
import com.tempo.config.TempoConfig;
import com.tempo.wpi.Setlist;from tempo import Bias, Composer, Condition, Speed, Tempo, TempoAutos
from tempo import TempoConfig
from tempo.wpi import Setlist#include <tempo/Tempo.h>
#include <tempo/wpi/Setlist.h>
#include <tempo/wpi/TempoAutos.h>Classes
| Class | Purpose |
|---|---|
| Tempo | Setup, the drivetrain methods, update and point-to-point drives |
| TempoConfig and its settings | Drivetrain, footprint, limits, replanning, gains, terrain and planning (Configuration) |
| Composer | A route: a start, waypoints and options per leg |
| Setlist | An auto: routes, commands, waits, groups and branches |
| TempoAutos | Named autos and the dashboard chooser |
| TempoLogging | The items Tempo logs and the sink that receives them |
| Condition | A moment along a leg or a state, for hooks, aims and branches |
| Bias | The curve’s direction through a waypoint |
| Speed | Named speed levels and TrajectoryConstraints |
| Arrival | Carry speed, stop or pause at a target |
| Region, Zone, Terrain | Shapes to avoid or stay inside, and terrain to cross |
| Control | The path follower for a leg |
| Alliance | The alliance a route is authored for and the one the robot runs as |
| Field | Field.mirror flips a pose to the other alliance. Field also reads the field’s center and size and tests a point against a zone |
| GamePack | The loaded field, with its elements and point queries (file format) |
| MeasuredConfigs and TempoCalibration | Limits measured on the robot, and the calibration autos that measure them |
| SimRun | A simulated run for tests |
| PathFollower | A team’s own controller for a leg |
| Replanner | The low-level planner and follower for one leg |
| TempoAuto | One run of an auto and its phases. Robot code doesn’t build one |
| Pose | Named poses saved in the deploy folder |
Terms
- Route: what a
Composerbuilds, a start pose and the waypoints after it. - Path: the planned curve the robot follows.
- Leg: the drive to one waypoint. A few API names call it a segment (
skippedSegments()). - Planning unit: one independently planned leg, or several consecutive legs that share one trajectory.
- Auto: a route or Setlist you can run. A named one can go on a chooser. Both are
an
Auto, the type of a chooser’s pick, withschedule(),start(),isFinished(),cancel()andwarmup(). - Hook: a command attached to a leg.
- Recovery: the command a leg’s
runOnFailurestarts.
Lifecycle
- Build the config:
new TempoConfig()and a chain ofwithcalls (Configure the robot). - Set up once at robot start:
Tempo.configure(...)(tempo::wpi::configure(...)in C++) (Connect the drivetrain). - Write routes with
Composerand autos withSetlistat startup. - Name the autos you want on the chooser with
Composer.named(...)orSetlist.named(...). - Put them on a chooser with
TempoAutos.chooser(), or add them to your own (Your own chooser). - While the robot is disabled, Tempo plans the auto picked on the
TempoAutoschooser ahead of the run. With any other chooser, pass the pick toTempoAutos.prePlan(...), or call the picked auto’swarmup()fromdisabledPeriodic. A Java robot also warms Tempo up at boot without a call, andTempo.warmup()does the same in simulation. Python’sTempo.warmup()at boot is separate, and does the imports and planner setup the first auto would otherwise do. - Schedule the picked auto when autonomous starts, or
start()it. - The command scheduler runs it. Without a scheduler, call
Tempo.update()every loop (Schedule and cancel).
Packages and headers
| Language | Authoring and runtime | Configuration | WPILib adapters |
|---|---|---|---|
| Java | com.tempo | com.tempo.config | com.tempo.wpi (Setlist, Step) |
| Python | tempo | tempo | tempo.wpi |
| C++ | tempo::, <tempo/...> | tempo::, <tempo/Tempo.h> | tempo::wpi::, <tempo/wpi/...> |
Import Tempo’s Alliance, because WPILib’s DriverStation.Alliance is a
different enum. Tempo’s Java packages are com.tempo on both WPILib years.
WPILib’s Java packages are edu.wpi.first....
Python uses RobotPy 2026.
C++ uses frc:: and frc2::.
WPILib’s Java packages are org.wpilib..., and ChassisSpeeds becomes
ChassisVelocities.
Python uses RobotPy 2027.
C++ uses Tempo’s compatibility aliases.
See 2026 vs 2027.
Geometry and units
| Boundary | Java | Python | C++ |
|---|---|---|---|
| Route poses and points | WPILib Pose2d, Translation2d | RobotPy Pose2d, Translation2d, tuples or numbers | frc::Pose2d, frc::Translation2d, or numbers |
| Headings | radians, Rotation2d, Angle | radians or Rotation2d | radians, frc::Rotation2d, or units where an overload says so |
| The drivetrain’s pose methods | Pose2d | Pose2d | frc::Pose2d |
| The drivetrain’s speeds, robot-relative | ChassisSpeeds | ChassisSpeeds | frc::ChassisSpeeds |
Distances are meters, times are seconds, and a plain-number angle is radians.
Java methods also take WPILib measures (Meters.of(...), Seconds.of(...))
where the signature says so, and a few take only a measure:
giveUpAfter(Seconds.of(2.0)) compiles and giveUpAfter(2.0) doesn’t.
Python takes numbers, often with a unit suffix in the parameter name.
C++ takes numbers, or WPILib unit types such as 180_deg and 0.8_m where an overload
says so. The literals need no using line, because WPILib’s units headers end with a
global using namespace units::literals; (wpi::units::literals on 2027).
C++ reads the poses and speeds of Replanner, SimRun and a ControlContext through
<tempo/wpi/Geometry.h>, such as tempo::wpi::robot_pose(ctx).
Python and C++ notes
Python takes None where Java takes null. Each Tempo Python package (a .whl file)
depends on its year’s RobotPy, and the command scheduler also needs
robotpy-commands-v2. RobotPy keeps WPILib spellings such as
DCMotor.krakenX60FOC(...) on 2026 and 2027 alpha-6, and uses snake_case
(DCMotor.kraken_x60_foc(...)) on alpha-7 and beyond.
The C++ core under tempo:: is WPILib-free, the adapter is tempo::wpi::, and
tempo::wpilib:: aliases the selected year’s WPILib types (frc::Pose2d on 2026).
| C++ call | Ownership |
|---|---|
route.run_after(command.get()) and other hooks | Composer borrows the pointer, so keep the CommandPtr alive across every run |
setlist.drive(route).run(0, 1, command.get()) | The Setlist borrows the pointer |
setlist.then(std::move(command)), group members | The adapter takes ownership |
chooser.AddOption(name, command.get()) | The chooser borrows the pointer |
The pointer from .get() on a temporary CommandPtr is invalid once the expression
ends. A C++ Composer can’t be copied, so finish the chain before moving it, and keep
every route a Setlist uses alive.