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

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::Toward
  • Arrival::Through() and Arrival::Stop(), which stand for Java’s THROUGH and STOP constants
  • the tempo::Pose factories and methods (Pose::At, Pose::Named, Pose::Capture), declared in <tempo/wpi/Pose.h>
  • the SwerveModules vendor factories (SDS::MK4i, REV::MaxSwerve) and GamePacks::REBUILT_2026()
  • enum values such as Alliance::Blue and the module gears

These imports cover a simple auto:

Java
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;
Python
from tempo import Bias, Composer, Condition, Speed, Tempo, TempoAutos
from tempo import TempoConfig
from tempo.wpi import Setlist
C++
#include <tempo/Tempo.h>
#include <tempo/wpi/Setlist.h>
#include <tempo/wpi/TempoAutos.h>

Classes

ClassPurpose
TempoSetup, the drivetrain methods, update and point-to-point drives
TempoConfig and its settingsDrivetrain, footprint, limits, replanning, gains, terrain and planning (Configuration)
ComposerA route: a start, waypoints and options per leg
SetlistAn auto: routes, commands, waits, groups and branches
TempoAutosNamed autos and the dashboard chooser
TempoLoggingThe items Tempo logs and the sink that receives them
ConditionA moment along a leg or a state, for hooks, aims and branches
BiasThe curve’s direction through a waypoint
SpeedNamed speed levels and TrajectoryConstraints
ArrivalCarry speed, stop or pause at a target
Region, Zone, TerrainShapes to avoid or stay inside, and terrain to cross
ControlThe path follower for a leg
AllianceThe alliance a route is authored for and the one the robot runs as
FieldField.mirror flips a pose to the other alliance. Field also reads the field’s center and size and tests a point against a zone
GamePackThe loaded field, with its elements and point queries (file format)
MeasuredConfigs and TempoCalibrationLimits measured on the robot, and the calibration autos that measure them
SimRunA simulated run for tests
PathFollowerA team’s own controller for a leg
ReplannerThe low-level planner and follower for one leg
TempoAutoOne run of an auto and its phases. Robot code doesn’t build one
PoseNamed poses saved in the deploy folder

Terms

  • Route: what a Composer builds, 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, with schedule(), start(), isFinished(), cancel() and warmup().
  • Hook: a command attached to a leg.
  • Recovery: the command a leg’s runOnFailure starts.

Lifecycle

  1. Build the config: new TempoConfig() and a chain of with calls (Configure the robot).
  2. Set up once at robot start: Tempo.configure(...) (tempo::wpi::configure(...) in C++) (Connect the drivetrain).
  3. Write routes with Composer and autos with Setlist at startup.
  4. Name the autos you want on the chooser with Composer.named(...) or Setlist.named(...).
  5. Put them on a chooser with TempoAutos.chooser(), or add them to your own (Your own chooser).
  6. While the robot is disabled, Tempo plans the auto picked on the TempoAutos chooser ahead of the run. With any other chooser, pass the pick to TempoAutos.prePlan(...), or call the picked auto’s warmup() from disabledPeriodic. A Java robot also warms Tempo up at boot without a call, and Tempo.warmup() does the same in simulation. Python’s Tempo.warmup() at boot is separate, and does the imports and planner setup the first auto would otherwise do.
  7. Schedule the picked auto when autonomous starts, or start() it.
  8. The command scheduler runs it. Without a scheduler, call Tempo.update() every loop (Schedule and cancel).

Packages and headers

LanguageAuthoring and runtimeConfigurationWPILib adapters
Javacom.tempocom.tempo.configcom.tempo.wpi (Setlist, Step)
Pythontempotempotempo.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

BoundaryJavaPythonC++
Route poses and pointsWPILib Pose2d, Translation2dRobotPy Pose2d, Translation2d, tuples or numbersfrc::Pose2d, frc::Translation2d, or numbers
Headingsradians, Rotation2d, Angleradians or Rotation2dradians, frc::Rotation2d, or units where an overload says so
The drivetrain’s pose methodsPose2dPose2dfrc::Pose2d
The drivetrain’s speeds, robot-relativeChassisSpeedsChassisSpeedsfrc::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++ callOwnership
route.run_after(command.get()) and other hooksComposer 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 membersThe 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.

esc

Loading search...