3.2 Wrapper policy
Tempo has one Rust core. Java, Python and C++ expose robot authoring and runtime bindings through its C ABI. Wasm exposes planning and game-pack preview operations by linking the same Rust crate. Design robot APIs in Java first, then carry the semantics into each supported binding using its language’s idioms. Document platform-specific differences such as Java’s boot warm-up for the JVM’s class loading and JIT and wasm’s browser-facing preview API.
Equivalent routines must preserve planning and command behavior across bindings, but signatures, object ownership and scheduler setup can differ.
Java is the spec
The approved Java API defines behavior and defaults for the other robot bindings. Each binding uses its own language’s naming, types and ownership conventions.
| Concept | Java | Python | C++ |
|---|---|---|---|
| Method names | camelCase | snake_case | snake_case |
| Units | WPILib units (Meters.of(0.4), Seconds.of(3)) | plain floats with unit-suffixed names (drift_m=0.4) | plain doubles, unit-suffixed |
| Enum values | UPPER_CASE (Sensitivity.HIGH) | UPPER_CASE (Sensitivity.HIGH) | PascalCase (Sensitivity::High) |
| Overloads | true overloads | one method, union-typed args | true overloads |
| ”Sealed” sets | sealed interface (TempoConfig.Part) | isinstance checks in the assembler | closed std::variant (ConfigPart) |
| Absent/clear | null | None | std::nullopt |
| Bad argument | IllegalArgumentException | ValueError | std::invalid_argument |
| Call at the wrong time, or on a half-built object | IllegalStateException | RuntimeError | std::logic_error |
| Native, game-pack or filesystem failure | TempoException, IOException | TempoException, OSError | std::runtime_error |
| Demoted API | package-private | leading underscore | private + friend |
Authoring keeps these established exceptions: Python uses ValueError for a
missing start, an empty route, and a differential leg without a track width.
C++ uses std::invalid_argument for an unknown crossing id. The complete core
code mapping and language-specific messages are pinned in
tests/fixtures/api/authoringRefusals.json.
The C++ core is WPILib-free and accepts opaque commands and explicit scheduler
callbacks. The tempo::wpi adapter owns commands moved into its groups. Robot code
keeps each returned CommandPtr while a chooser holds its raw pointer.
Runtime wiring differences
| Surface | Binding contract |
|---|---|
Java Tempo.configure | Accepts the pose getter, pose setter, measured-speeds getter, velocity runner and config, then the drive subsystem unless the robot has no command scheduler. With a config alone it installs the config and wires nothing. |
Python Tempo.configure | The same arguments in the same order, the drive subsystem optional; with a config alone it installs the config and wires nothing. |
C++ tempo::wpi::configure | Accepts the pose getter, pose setter, measured-speeds getter, velocity runner and config, then an optional is_red_alliance check and the season’s Requirements. Reads the alliance from the DriverStation unless it is given that check. The WPILib-free tempo::Tempo::configure takes the same five without requirements. |
C++ tempo::wpi::Setlist::command(setlist) | Returns an ordinary WPILib CommandPtr that compiles a fresh root on every initialize, for the season’s SendableChooser. |
Shared pose callbacks use WPILib Pose2d. The velocity callback receives robot-relative
WPILib chassis speeds. Subsystems passed as C++ requirements must outlive the commands
built from them.
Geometry on the public surface
Every public pose, point and speed is WPILib’s. Tempo’s own value types are internal and
exist only where a binding meets the C ABI: Java com.tempo.internal.CorePose,
CoreSpeeds and Point2d, Python tempo._geometry (_Pose, _Point, _Speeds), C++
tempo::detail::Pose2d, Point2d and RobotSpeeds. A WPILib value converts at the
boundary with x, y and every speed component bit for bit and the heading through the
core’s wrap_pi.
| Binding | Takes | Returns | Plain-number forms |
|---|---|---|---|
| Java | Pose2d, Translation2d, Rotation2d, ChassisSpeeds (org.wpilib names and ChassisVelocities on 2027 through java/wpilib2027Imports.tsv) | the same types | to(x, y[, heading]) |
| Python | wpimath Pose2d, Translation2d, Rotation2d and ChassisSpeeds (ChassisVelocities on RobotPy 2027, where wpimath is flat), read by duck typing; plain numbers and (x, y) / (x, y, heading_rad) tuples where a point or pose is taken | wpimath values; the private fallback types when wpimath does not import | start_at(x, y, heading_rad), to(x, y[, heading]) |
| C++ | frc:: (2026) and wpi::math:: (2027) geometry and chassis speeds through the concept-constrained templates of tempo/detail/Geometry.h, which match the Pose2d, Translation2d and Rotation2d shapes and refuse Transform2d and the 3D types; the core includes no WPILib header | the given WPILib type from Field::mirror and Mirroring::flip; the lower-level results through tempo/wpi/Geometry.h | start_at(x, y, heading_rad), to(x, y[, heading]) |
The C++ lower-level classes (TempoAuto, Replanner, SimRun, ControlContext, the
the logged events) keep their internal values in
private members. tempo/wpi/Geometry.h reads them as tempo::wpilib types through free
functions: tempo::wpi::tick(auto_, pose, now_s), expected_pose(auto_, now_s),
planned_path(auto_), final_pose(run), robot_pose(ctx), suggested(ctx),
field_center() and the rest. Core-only tests reach the same members through
detail::GeometryAccess.
Python’s public API returns wpimath values whenever wpimath imports, which every installed
wheel guarantees through its robotpy dependency. Without robotpy (the first leg of
python/run-suites.sh), it returns _Pose, _Point and _Speeds, which answer the same
reads: X(), Y(), x, y, rotation().radians() and translation() on a pose, angle()
and norm() on a point, and vx, vy, omega on speeds.
tests/fixtures/api/wpilibGeometry.json holds the conversion cases each binding asserts and,
per binding, the names no line of the tracked API snapshot may carry. The Java, Python and C++
surface tests and the maintainers’ API snapshot extractor read it.
The editor generates the robot config as one TempoConfig constant (CONFIG, C++
kConfig) in a setup file. Robot code
passes that constant to Tempo.configure(...) with the methods of an ordinary drive
subsystem; the editor shows the call to copy and checks the project for it. Routine
exports use that global registration. See
gui-app.md for the call and the check.
withFrame(width, length) states the chassis and
withBumpers(new BumperConfigs().thickness(thickness)) the bumpers around it. Width
is Y, length is X, and plain numbers are meters. A side’s own thickness beats
thickness(...) and a corner’s own shape beats roundCorners/chamferCorners,
whichever was written first. Python/C++ use front_thickness, round_corners, and
round_corner in place of Java’s camel-case methods. All bindings resolve the same
outline. Frame, whole-footprint and typed-bumper values are covered by the
footprint API.
One source tree supports WPILib 2026 and 2027. Java generates its 2027 source
set using java/wpilib2027Imports.tsv and the year-specific overrides.
C++ public adapter headers use cpp/include/tempo/wpi/WpiCompat.h for season
detection and aliases. Python resolves the available RobotPy spellings at
runtime in python/tempo/_wpi_compat.py, the one module that names them:
wpimath’s flat 2027 layout, the snake_case wpilib and commands2 of RobotPy
2027.0.0a7, the alliance on MatchState and the robot state on RobotState.
Tempo’s own commands carry both commands2 spellings of each method they define
(DualSpelling). A command Tempo did not make is read only under the installed
commands2’s spelling, decided once (spelled). A team attribute named in the
other year’s spelling never stands in for a method. Check both Java builds, the relevant adapter paths and
the Python suite on RobotPy 2026 and 2027 when changing season-sensitive APIs
(see testing.md).
A TempoConfig holds its settings unresolved in all three bindings. Every setter
changes the object and returns it, a with... call copies the group it is given, and
Tempo.configure resolves its own copy of the config. run(Condition, cmd) shares the same
condition and hook semantics across all three bindings.
Native hooks and runs without the scheduler
Every hook that takes a command also takes the robot’s own actions and checks. The list is
tests/fixtures/api/runnableAcceptance.json, and each binding’s acceptance test calls it in
full. A native hook is wrapped as it is written into a command-shaped object that requires
nothing and keeps what it was made from as its source: runOnce runs an action as it starts,
waitUntil finishes once its check is true, and startEnd runs one action as it starts and
another as it ends. Java wraps a Runnable or BooleanSupplier in
com.tempo.internal.NativeHooks. Python wraps a plain callable, or wait_until=, in
tempo._native_hooks, and treats anything with the command protocol as a command first. C++
keeps each hook in a process-lifetime arena and routes its handle through the native branch of
CommandOps. A Java Supplier hook is named commandFactory. A Python plain callable is
named runOnce until it returns a command and commandFactory from then on, since whether
it is a factory shows only as it runs. C++ refuses a callable that returns a command at
compile time, so its hooks never carry that name. A C++ handle is a slot in a reserved,
never-written address range and not the hook’s own address. A handle whose hook was
freed throws a [Tempo] error even after the arena has dropped its record, and never reaches
the binding’s CommandOps as a WPILib command. A footprint effect bound to the source reaches the hook made from it.
The runBefore hooks of one leg, and its runAfter hooks, run one after another in
written order. The route command starts the first, and each next one on the loop the one
before it ends, as a WPILib sequence starts its next member. A hook a running one refuses
is skipped. A Setlist run’s whole-run runBefore and runAfter commands follow the same
rule in its route step. waitUntil(check[, timeout]) is a waitUntil hook after the
waypoint on a Composer and a step on a Setlist. Its timeout reads the Setlist clock and
ends the wait as if the check had passed. It is the one way a Setlist step waits. A check given to then or as a group or branch member (a Java BooleanSupplier, a C++ callable
returning bool, a Python callable annotated -> bool) is refused as the Setlist freezes
with checkStep. An unannotated Python callable cannot be told from an action, so it runs
once and prints boolAction when it returns a bool.
finallyDo(action) on a Composer runs exactly once as its route ends, no matter how it ends, after
its last runAfter. The Setlist route step that runs the route runs it as the step ends, once
per start even when a throwing hook ends the step and its group ends it again. On a Setlist
it runs as the Setlist ends: a nested one as its tree ends, a hook one as the hook ends, and a
root as the root ends. A root the scheduler runs hands recoveries still running to their own
commands before its actions run. A root Tempo.update() runs ends them first.
Condition.near, the and, or and not combinations and every runWhile reach the
core as a TREE trigger or aim condition (auto_runtime::StateTree). The core tests it
every tick against the pose in the route’s authored frame, the auto clock and the pack’s
zones. Each distinct when check object in a route’s trees takes one route-wide slot, the next
one the first time the serializer meets it, leg by leg, triggers then aims, each tree left to
right. The binding answers slot n in bit 63 - n of the tick’s when_bits, beside the low
bits that answer a leg’s plain when triggers. A tick whose pose is whole (x, y and heading
finite) asks each check once, and only the checks that can matter: those of the current leg’s
trees, of every route-wide tree armed by a leg up to it, and of the leg’s plain when
triggers, when aims and endWhen. One check object read in several of those places is asked
once. The core tests trees only on such a tick, and only for the leg the checks were read for.
A tick that enters a leg with trees asks for fresh inputs, and a leg reached by flowing
through a merged waypoint mid-tick has its trees tested from the next tick. A leg skipped for
having no route arms none of its watches. Checks are passed as the robot code answers them, with no hysteresis. A route
whose distinct checks plus the run triggers or aims of any one leg exceed 64 is refused as it
freezes (commandWorkflow.json, messages.conditionBudget), and the core refuses one too. and
and or chains are one node of many parts ({"and": [a, b, c]}), so a long chain stays one
level of JSON. Every part is tested each tick. A near latches. It holds from
its distance in and lets go only beyond the distance plus max(0.05 m, 5 % of it)
(near_release_m). A leg’s tree fires once while the leg drives. A route-wide tree is armed
once the drive of its leg begins and stays armed to the end of the route. A runWhile
(level) fires Trigger each tick its state comes to hold and WindowEnd each tick it
stops, so the route command starts and ends its command as it does a window’s. A Setlist run’s own state trigger fires once. A Setlist run’s runWhile and its inside, near and
combined triggers ride on its connecting drive’s leg and on the route’s first leg, so they are
watched from the connecting drive on, as its plain matchTime and when triggers, which stay
with the run’s step, are. The two drives hand the core’s starts and ends of those commands to
the run’s step, which runs them. A state trigger starts once a run, and a runWhile command
started on the connecting drive keeps running into the route. The route’s copy is marked
resume, so its first test ends a command whose state no longer holds. Its resumeSlot
check answers whether the run’s step is running the command as the route takes
over. The copy’s near latches start there, so a robot inside a near’s release band keeps
the state the connecting drive left. They end as the
drive ends. Only states combine: inside, near, matchTime, when and combinations of them. A standalone
Replanner has no core sequencer, so its aims never arm on a near or a combination.
tests/fixtures/api/commandWorkflow.json holds the decisions. The core’s
tests/command_workflow.rs replays them and each binding checks that it serializes the same
trees.
A Setlist with no drive is a hook payload. Its hook freezes the Setlist as the route
freezes, requires what its steps require, refuses one with a drive or a drivetrain step,
and compiles a fresh tree with Tempo’s own groups each time it starts. Its matchTime
checks count from the start of the auto that runs it. Its finallyDo actions run as
the hook ends. Tempo never makes a factory’s command before the hook runs. Python knows
a factory before it runs only from a return annotation naming a command. Such a factory with
no subsystems declared beside it fails the freeze with factoryMessages.undeclaredAtFreeze,
which names both fixes: pass the command itself, or declare the subsystems beside the factory.
A Setlist then step and arrive_with are exempt and are read as they run. A Java
Supplier and an unannotated Python callable are read as they run. javac resolves every
expression lambda or method reference whose call returns a value to the Supplier overload,
() -> motor.setControl(request) as much as ss::shootCommand, so the hook calls it once
as it starts. A returned command runs, and is refused there when it requires a subsystem not
declared. Any other value means the call was an action. C++ has no factory hooks.
Composer and Setlist share the Auto type: schedule(), start(), isFinished(),
cancel() and warmup(). With the drivetrain bound to a real subsystem, start() schedules a
cached root command, so the scheduler handles requirements and default commands. Bound without
one, start() runs the same root command the scheduler would run, through initialize, execute,
isFinished and end, from Tempo.update(). Tempo.stop() ends it interrupted, and an update
while the robot is disabled ends a root that does not run when disabled. A start, cancel or stop
asked for from inside an update waits until that update’s loop is over, as the scheduler defers
a schedule or cancel made inside its loop. warmup() warms whichever root the next start()
runs. Java hooks also take a Supplier of commands, which makes its command as the hook
starts. A started root compiles its groups to Tempo’s own sequence, parallel, race and
deadline steps and its waits to the Setlist clock, never asks the scheduler about itself, and
runs recoveries to their end. Starting an auto ends any other started one. The Rust core still
drives every route, and joins go through RouteJoin, so a started auto makes the same core
decisions as a scheduled one. Each binding’s end-to-end test compares the commanded speeds loop
for loop. Tempo.configure(...) without a drive subsystem binds a placeholder for the drivetrain
requirement that no command can hold. Python’s tempo.wpi imports without commands2, because its
command classes build on tempo._command_base, which is commands2’s Command when installed
and a plain base otherwise.
Auto registry and chooser
TempoAutos holds one ordered map from name to auto per process. Setlist.named(name)
creates and registers a named Setlist. Python uses the same spelling, and C++ uses
Setlist::named(name) in both tempo and tempo::wpi. Composer.named(name)
validates the name and returns a builder. startAt(pose) creates and registers its
route, and every to(...) form starts and registers a route from the live pose.
Python uses start_at, and C++ uses Composer::named(name).start_at(...).
The builder creates no route until a start method runs and accepts no command framework types.
A Setlist made with no name argument is a reusable piece and never registers.
Blank and null names are refused. The one-route auto behind a
Composer’s schedule() and start(), Composer.command()’s backing Setlist and the warm-up’s
throwaway Setlist are built through a constructor that does not. An entry is either
self-registered or kept. register(...) marks it kept, so turning auto-registration off removes
only self-registered entries. Messages and the registry’s decisions are
tests/fixtures/api/autoRegistry.json, which every binding replays.
A name holds one object, and the same object again is ignored. Another auto made or registered under a taken name waits on a pending list, listed nowhere, because a Setlist is empty as it is constructed and a Composer is named before its legs. The pair is compared by content fingerprint:
- A Composer’s key is its serialized route,
resetOdometry, each hook’s kind and leg, each leg’s end condition and eachruncondition. - A Setlist’s key is its frozen step tree, with each drive’s route key and run commands.
- A hook, predicate or end condition is keyed by object identity, through a per-registry number that holds the object so the number is never reused. Only Tempo’s own action, check and factory wrappers look through to their source, and Python and C++ may key a function or lambda that captures nothing by its code. Autos that capture or hold different things never compare as the same.
Same content drops the waiting auto, marking the holder kept when the waiting one was
registered by hand. names, get, all, chooser(), prePlan() and the disabled
pre-planning loop freeze both autos to compare them. Different content throws duplicateName
only from one of those calls made before the registry has seen the robot enabled, which is
where robot init makes them. The registry latches the first enable it sees for the life of the
process. It reads the
driver station on every robot loop, as an auto is made under a taken name, at a freeze and at
each of those calls, and a route or auto command that starts sets it, which covers a robot with
its own chooser, no prePlan and no Tempo.update(). An enable in which none of those
happens is not seen, so a clashing auto built in the next disabledInit and then read still
throws. Where nothing throws, a waiting auto that cannot freeze counts as different and is
dropped. Before the first enable Java and Python let the freeze error of such an auto out of
the read, and C++ throws duplicateName for it. The pre-planning loop never throws, and nothing throws after the first
enable, because an exception out of the robot loop or out of disabledInit ends the robot
program, and an auto rebuilt in autonomousInit with new command objects is compared in the
disabled gap after autonomous. They print
duplicateNameKept once per name, drop the waiting auto and leave the name and the chooser
entry with the first. A freeze compares only pairs whose autos are both frozen, prints a clash
the same way and leaves it waiting. An enabled loop compares nothing.
Registering an auto under another name after a chooser lists it, or turning
auto-registration off while a chooser lists a
self-registered auto, throws, because a stock chooser cannot drop an option.
chooser(...) returns the season’s stock chooser of Auto (SendableChooser, or alpha-7’s
Selectable through the java-wpilib2027-alpha7 overlay, Python’s _wpi_compat adapter and
C++‘s WpiCompat.h), with no default unless one is given, and adds autos registered later to
every chooser whose filter accepts them. The pick Tempo pre-plans comes from the newest chooser,
the chooser whose onChange fired last, or a prePlan(supplier). While disabled, the pick’s
warm-up warms the root its start() runs, from the loop that runs that root: Tempo.update()
for a drivetrain bound without a subsystem, the scheduler’s loop-start hook otherwise. A Setlist
keeps one scheduled root, which start() and schedule() share, and one root Tempo.update()
runs. Each compiles a fresh tree per run, so the warmed tree is the one that runs. The warmed
root is pinned in the warm selection and never goes stale. A new pick unpins the old one, and
enabling unpins without dropping the warmed state, which the start adopts. An Auto robot code
implements itself is listed but warms nothing. A pick whose warm-up throws is reported once and
tried again about once a second while disabled. Every test suite resets the registry before and
after each test.
Mecanum settings
MecanumConfigs takes a strafe efficiency (default 0.8, above 0 and at most
1), a wheel speed and acceleration margin (default 0, in [0, 1)), and
four wheel offsets. Only a mecanum route writes config.mecanum:
strafeEfficiency and mecanumMargin, plus turnRadiusM (the largest |x| + |y| offset) when
offsets were given. Without them the core takes the radius from the footprint.
tests/fixtures/api/mecanumConfig.json holds the refusal messages and the
expected config.mecanum objects that Java, Python and C++ assert.
The standalone bindings pass known, unconditioned aims to
tempo_replanner_new_mecanum_v2 as six-double records: point x/y (NaN for a
heading), angle, start fraction, end fraction (NaN for none), and turn-rate cap
(NaN for none). Points and angles are already in the runtime frame. The core copies those records before returning. The v1 constructor keeps its ABI and
uses the default margin without planned aim records.
Game-pack selection
Configuration resolves an explicit config pack, then an installed pack, then
tempo/game.toml under the language’s deploy directory, then the bundled default
for the artifact’s WPILib year. Named bundled selections have stable identities:
Java/Python GamePacks.REBUILT_2026, C++ GamePacks::kRebuilt2026. A config’s
gamePack(...) (game_pack in Python and C++) accepts those enum values directly. The registry, build-time defaults, ownership,
discovery errors and shared selection fixture are documented in
game-packs.md.
Warm-up
Warm-up builds route runtimes and plans while the robot is disabled. It also bakes planning keys and starts background corner expansion for keys whose first build found no route. The auto’s first tick cancels any remaining corner bakes. Warm the selected command on every disabled loop:
| Binding | Warmable commands | Disabled-loop call |
|---|---|---|
| Java | TempoCommand, and the command Setlist.command() and Composer.command() return (Warmable) | if (selected instanceof Warmable w) w.warmup(); |
| Python | TempoCommand, and the command Setlist.command() returns | selected.warmup() when the selection has one |
| C++ | tempo::TempoCommand, and the command tempo::wpi::Setlist::command() returns (tempo::wpi::Warmable) | tempo::wpi::warmup(chooser.GetSelected()) |
A route command that resets odometry calls the pose setter with the runtime
start pose as its run starts, then tells the runtime so (Java
AutoCoordination.awaitStartReset, Python TempoAuto._await_start_reset, C++
ComposerAccess::await_start_reset), which passes it to
tempo_auto_await_start_reset_v1 before the first tick, with the pose the getter
returned just before the setter ran. The core treats a tick as one without a
pose, for up to 0.5 s, until its pose stands within 0.15 m and 10 degrees of that
start or has moved farther than that from the pose before the reset. The robot
rests meanwhile, so only the reset, or vision pulling the reset estimate toward
the robot’s true pose, moves the pose that far. A getter that shows the reset a
few loops late then never plans the first leg or fires a progress hook from the
pose before the reset. Every route command that resets odometry waits this way:
an auto’s first route under its authored policy, a command run with
FORCE_RESET, and each route of a team’s own command sequence built with
resetOdometry(true). A Setlist route after the first never resets. Its join reads the getter after the route before it has ended, by when the reset has shown
or the wait has run out.
A route with a start pose warms its first plan from the authored start through
tempo_auto_warm, whether or not it resets odometry and whether or not it is a
Setlist route after the first (FORCE_NO_RESET). The core plans that leg from
the authored start either way, and drives that plan for a robot within the
route’s arrival tolerance of the start. A route that may start its run and does
not reset odometry (the authored policy, resetOdometry off) starts wherever
the robot’s pose says it is, so its warm-up also plans the first leg from where
the disabled robot rests. On every disabled loop on which the route command
holds the warmed runtime, it reads the pose getter on the loop and passes the
pose and the loop’s clock to tempo_auto_warm_from_v1 in place of tempo_auto_warm
(Java RouteCommand.warmsFromLivePose and AutoCoordination.warmFromStep,
Python _route_build.warms_from_live_pose and TempoAuto._warm_from_step, C++
RouteCommandCore::warmup and TempoAuto::warm_from_step). The pose is in the
frame the tick takes, so a route mirrored for the other alliance needs nothing
more, and an alliance change builds a new runtime that tracks the pose afresh.
The core decides when to plan, so the three bindings cannot differ: it
low-passes the pose (0.25 s), and once the low-passed pose has rested for 0.5 s
farther than half the first plan’s tolerance from every start a plan was made
from, it plans the first leg from there, at most one plan at a time and at most
one a second, and a new plan replaces the one before once it lands. Pose jitter
inside that half tolerance plans nothing, and neither does a robot being
carried. The plan from the authored start stays, and the first leg starts on
the one made from nearest the robot, so a route command that
runs after another in a team’s own command group still starts on its authored
plan. The call returns three bits: 1 as tempo_auto_warm, 2 where it asked for
a plan from the pose, which the tests count
(tests/fixtures/api/firstPlanSource.json, the cases with disabled), and 4
where nothing is left to plan for a robot that stays where it is
(AutoRuntime::live_pose_settled). After a call with bit 4 a binding reads the
pose getter once in five warm-up loops and compares the numbers, and passes the
pose on again only once it stands more than 1 mm in x or y or 0.001 rad from
that one, or on every 50th loop, since a plan dropped under it is planned again
only from a reported pose. A robot that is moved is so seen within 0.1 s, and
planned from once it has rested 0.5 s there. The three bindings hold the same numbers (the fixture’s settled), and
each one’s test counts the poses passed on over 500 loops at rest. Odometry
that moves by more than that at rest, as a vision estimate does, is passed on
every loop. The pose is passed on whether or not the authored start has a route:
a runtime whose authored plan found no route is asked for that plan again about
every second on a helper, which holds the runtime for up to a second, and the
route command passes the pose on the loops between. The warning about the
authored start still prints, because it is true of the auto as authored, and a
robot enabled where a route exists drives the plan from its pose (the fixture’s
case with authoredRoute false). A pose that is not finite is passed to the
core as it is, which plans nothing from it; no binding converts or wraps it
first (the fixture’s notFinitePoses). A route
that resets odometry warms from the authored start alone, because its reset
puts the robot’s pose there as it starts, and so do a Setlist route that cannot
be first (FORCE_NO_RESET) and a replay runtime; each binding’s first-plan
test holds a route of each kind off its start for 3 s and counts no plan from
the pose. The pose is passed on every warmup() call, so a route warmed from
an enabled loop is planned from wherever the robot comes to rest, at the same
rate. A pose the robot is not at, such as odometry at the field corner before
the first vision fix, costs one plan, with or without a route, which is not
asked for again while the pose stays there
(a_pose_at_the_field_corner_is_planned_from_once). A route that starts
from the live pose cannot preplan its first leg. Both warm later legs whose starts are fixed by
the route. The live-start case uses tempo_auto_warm_later_legs_v1 (see
route sequencing for adoption
rules). The helper retries requests for up to one second while a worker resolves
junctions. Later disabled-loop calls retry any that remain.
A Setlist root compiles its command tree as it is constructed, and the next
run’s tree as each run ends, so an initialize compiles nothing. A tree that
cannot be compiled then is compiled by the next warm-up or initialize. The
warm-up warms every route in the tree. Possible first routes retain their reset policy,
including both sides of a when and routes in nested Setlists. Other routes
start from the live pose, and their joins read the authored start from the warmed
runtime. Initialize adopts the tree and runtimes. Repeated warm-up calls reuse
them unless the resolved alliance changes, which prints
[Tempo] warm runtime discarded: resolved alliance changed and rebuilds the
affected runtime.
Warm-up does nothing between initialize and end, including when a parent command
runs the auto. Ending a run closes runtimes for routes that never started.
Destroying a C++ command before it runs also frees its warmed state.
RouteWarmupTest checks this under the asan. ctest target with leak detection.
A decorator such as withName (WithName in C++) or withTimeout wraps the
command in one that is not warmable, so warming a decorated auto does nothing:
C++ tempo::wpi::warmup returns false, Java’s instanceof Warmable fails, and
Python’s decorated command has no warmup. The Setlist’s command already
carries the Setlist’s name, so a chooser needs no withName. When the
selection changes to a command they cannot warm, the three swerve examples
print one line, the same in each: [Tempo] auto '<name>' has no Tempo warm-up: a decorated Setlist command or a command Tempo did not build. The no-auto
choice (Java’s “None” default, an empty selection in C++ and Python) prints
nothing.
WarmProgress reports requested plans, completed plans, and readiness. Read it
with Java Warmable.warmProgress(), Python warm_progress(), or C++
tempo::wpi::warm_progress(command). A Setlist sums its routes’ progress from
tempo_auto_warm_progress_v1 on the warming loop. A command is not ready while
its runtime is building or the command is running.
A warm-up plan that found no route counts as landed, so the progress cannot
say that a leg will be skipped. tempo_auto_warm_no_route_v1 names those
planning groups by first and last leg, after taking in the plans workers have
landed, so no progress read is needed first. Each route command reads it on
the warming loop once as the last plan lands, and once as each attempt that
leaves the runtime unplanned lands, which is how a first plan with no route
shows. It prints one [Tempo] auto '<name>': no path was found ... line a
group (one leg, since the core splits a group of several legs whose plan
found no route and plans its legs alone) and keeps the groups it has printed on the runtime, so a line repeats
only for a runtime built afresh (a rebuilt auto, a changed alliance or
config). The read buffer holds one group a leg. Java TempoAuto.noRouteLines,
Python TempoAuto._no_route_lines and C++ TempoAuto::no_route_lines hold the
words, which tests/fixtures/api/noRouteWarning.json checks with its cases.
Nothing is read or printed on an enabled loop. A running Setlist that asks
ahead for a later route (planAheadOfStart, _plan_ahead_of_start,
plan_ahead_of_start) marks that warm-up, and the read is left for the next
warm-up of a robot that is disabled again. A failure first met while enabled
shows as the skipped-leg line.
A group of several legs is named by its first and last waypoint, since the legs share one plan and the core cannot say which waypoint has no route. A later group whose plan still has a retry to make as the robot drives is not reported, nor is the first leg of a route reached after another, which plans from the live pose. Under an angular acceleration limit a group plans from where the plan before it ends, so the warm-up plans nothing after a group with no route, and only that group is reported.
What a run’s first leg drove comes from the core
(tempo_auto_first_plan_source_v1): the warm-up’s plan, or a live plan and why
the warmed one was not taken. Java RouteCommand.planSource() (and the
[Tempo] first tick line), Python TempoCommand.plan_source() and C++
TempoCommand::plan_source() report it in the same words, which Java
FirstPlanSources, Python tempo._first_plan and C++ tempo::first_plan_label
each hold and tests/fixtures/api/firstPlanSource.json checks, with the cases
each binding drives. The answer is empty until the first leg starts driving
and is kept after the run ends.
Each binding tracks warmed commands in a registry: Java WarmSelection, Python
_warm_selection, and the C++ core’s warm-selection registry. The registry advances an
epoch when a command is warmed a second time in the current epoch. With one call
per selected command per disabled loop, that is one epoch per loop.
At the epoch boundary, inactive commands not warmed for more than 50 epochs
drop their runtimes and plans. At 20 ms per loop this is about one second.
A Setlist keeps its compiled tree, which has not run. Commands warmed together on every loop keep their state.
Initializing a command discards the warmed state of every other registered command robot code had stopped warming, and cancels its pending plans. That is a command not warmed in the current epoch, such as an auto deselected within the last second. A command warmed in the current epoch keeps its runtime and plans, so the route commands of a command group a team built, each warmed on every disabled loop, each start on their own warm-up. A selected auto and a backup warmed together do too. The starting command leaves the registry, since its warm-up is spent. Java and Python hold commands weakly and C++ commands leave as they are destroyed, so a robot that builds a command per run keeps none of them there. A Setlist’s internal routes and Java’s throwaway routes do not register separately. Alliance changes invalidate runtimes independently of the registry. On 2026-10-09, warmed later-leg plans for 20 ten-leg autos on an x86 host with the shipped pack held a median 219 KB and a maximum 320 KB of core allocations, about 25 KB per plan.
Before that drop, a warmed command keeps what its warm-up built until it runs.
Measured on the x86 host with the C++ core
(glibc mallinfo2, which counts the core’s allocations), destroying a warmed
Setlist root freed 86 KB for three plain routes (2026-09-27, the 2026 pack,
steady over three rounds). The per-pack plan cache keeps what the warm-up baked
into it, as a cold run’s first loop would. That was 28 KB the first time those routes
were warmed, and 6 KB or less when the same routes were warmed again. A runtime
holds the graphs its build baked (GraphHold). The per-pack cache evicts
least recently used entries that are neither held nor pinned by the
configure-time prebake, so a later bake never evicts a warmed route’s graphs.
Warming never changes what the robot is commanded. The core adopts a warmed first plan only when the first tick’s pose is within the first plan’s tolerance of the start that plan was made from, the authored one or the pose the robot rested at; a route that starts anywhere else, such as a first candidate that another route ran before and left away from its start, plans from the live pose as a cold route does. It adopts a warmed later leg’s plan only as the plan the look-ahead would have made, every input the same to the bit.
schedule() schedules the root the scheduler runs. Bound with its subsystem,
that is the root start() schedules and pre-planning warms. Bound without it,
pre-planning warms the root Tempo.update() runs, whose groups are Tempo’s
own, and the scheduled root takes each route’s runtime and build from the same
route of that root as it initializes (Java RouteCommand.takeWarmup, Python
TempoCommand._take_warmup, C++ RootRunCore::take_route_warmups). Both
build a route from the same occurrence. A
scheduler loop that follows another with no Tempo.update() between them
pre-plans in its place, so a robot that binds no subsystem and never calls
Tempo.update() still starts warm. The first scheduler loop never does, since
it cannot tell yet. Such a loop also makes the scheduled root once the other
is made, so the schedule compiles nothing. Beside Tempo.update() the
scheduled root is made by the first schedule(), because making it composes
the auto’s commands into WPILib groups, and a robot that starts its autos with
start() never asked for them.
A route command builds its runtime and eligible first plan on a helper thread
(RouteBuild). The calling loop captures the config and game pack in
BuildInputs (_build_inputs.BuildInputs in Python). The build job stores the
reset policy and resolved alliance as separate fields in all three bindings.
Only the loop calls the alliance supplier. A neutral result uses the route
occurrence’s fallback in a mixed-alliance Setlist.
On the helper, Tempo.config(), Tempo.pack(), and Tempo.isReady()
(is_ready in Python/C++) read this snapshot. Reconfiguration during a build
cannot change its inputs.
A replaced pack stays open until its last build finishes. C++ uses shared
ownership. Java and Python defer closing a retired pack, or one closed with
GamePack.close(), until the last build holding it releases it. A build’s
helper thread can be inside a native call on the pack, and freeing it there
writes into freed memory. C++ also copies the config and reads field center
and symmetry on the loop, keeping lazy cache initialization off the helper. Later warm-up calls adopt a completed runtime
or return while its build continues.
The background helper (TempoBuild) calls tempo_run_below_the_loop and handles
runtime builds, first plans, and cleanup ahead of a run. That includes freeing every
runtime a run or a warm-up is done with (tempo_auto_free), because dropping a runtime’s
plans and caches is more than a millisecond of a roboRIO loop. It looks for work
every 10 ms and is never woken. Waking a parked thread takes a lock the
parked thread can hold, and a nice-19 thread beside a busy core can hold it for
milliseconds (3.5 ms in LockSupport.unpark at a roboRIO route start). The
Java, C++ and Python console threads poll the same way, every 20 ms. On robot hardware Python’s
background helper starts a release, a close or free of a runtime a run or a
warm-up is done with, no sooner than 0.5 s after it is handed over
(_background.release). Freeing the runtime a start set aside ran on the helper
inside the enable loop and stretched that loop’s core tick from 0.8 to 1.8 ms on
a roboRIO (2026-11-04). Work queued behind a held release runs meanwhile. The urgent helper
(TempoUrgent) calls tempo_run_beside_the_loop and builds runtimes needed by
the next start. On Linux it uses SCHED_BATCH at nice 0. Threads inherit their
creator’s nice value and robot code lacks permission to raise priority later,
so Tempo.configure starts both helpers on the main thread after the
core’s planning workers. That keeps urgent work at nice 0 even when it is submitted
by a nice-19 thread such as Java’s TempoWarmup. Without configuration-time
startup, helpers start on first use.
A start never waits on a helper in robot planning mode. If its build is queued,
initialize or the Setlist join moves it to the urgent helper. If the background
helper is already building it, the urgent helper builds a second copy. The first result
wins and the other is closed. First-plan requests stop. A running root
keeps the routes it has yet to reach whose plans were not asked for. Every
five loops it warms each as a disabled loop would until every plan it asks for has
landed, since a later leg is asked for only once the plan before it lands (Java
FreshRootCommand.planAhead, Python _FreshRoot._plan_ahead, C++
RootRunCore::run_loop). So a robot enabled before its pick’s warm-up landed
plans its later routes while the first drives. A run whose warm-up landed keeps
no such routes, and the replay planning mode asks for none. While waiting,
the command brakes within the upcoming leg’s acceleration and wheel limits,
then holds zero until the first execute after the build finishes.
tempo_brake_output_v1 shares that arithmetic across the bindings. Its first
step uses the last command sent by the drivetrain binding, including zero.
Only a binding with no sent command seeds from measured motion, or rest when
no finite measurement is available. Subsequent steps use the braking output, which also
seeds the runtime’s first command when no measurement is available. Commands
built directly from an opaque runtime factory use the configured limits while
that factory runs. A waiting Setlist step brakes on every waiting loop and
commands zero on cancellation. It decides its join when the runtime is ready.
Starting a Setlist promotes all pending builds.
A failed build gets one retry on the urgent helper. A robot loop never builds a
route. A start with nothing built ahead (no warm-up, a failed warm-up, a warmed
runtime it cannot adopt), a Setlist join with nothing built and a connecting
drive, which starts from the live pose, have the urgent helper build the runtime.
The command brakes toward rest, from its initialize on, until it
lands, and the run starts on the first loop after. A start that has held for 1 s says
so once. A route that reads its targets as it starts reads them again for each
build. A start whose builds fail, or land unfit to adopt, twice fails the drive.
The command prints one line, runs the first leg’s runOnFailure where the failed build left a route to
read it from, tells the run’s leg-failure listener and finishes at rest, never
raising on the loop. The lines and the threshold are
tests/fixtures/api/routeStart.json. A route with no start pose, or one that reads a
supplied target, reads the robot’s pose and its targets on the loop and has the
urgent helper build that runtime. Replay mode builds on the loop and waits for
plans so tests repeat tick for tick. Cancellation or early destruction prevents
queued builds from running. An active helper closes its result on its own thread.
A start adopts a runtime built ahead of it only for the live alliance, on the
same game pack, from the same route under the same configuration. Packs are
compared by identity, and a pack records the TOML it was loaded from. Configure
keeps the active pack when the one it selects was loaded from the same TOML, so
a config applied a second time, as from autonomousInit, keeps every warmed
runtime and plan. Every binding
builds runtimes with tempo_auto_new_v2 from two core handles (see
ffi-contract.md). There is one config handle per
configuration, keyed by identity in Java and C++ and by value in Python (so a list
robot code changes in place is seen), with equal blobs sharing a handle. There is
one authored-route handle per frozen definition or Setlist occurrence and drivetrain
kind, written on its first build and shared by every runtime of it (a route with
no start pose or one that reads a supplied target writes its own each build). A
runtime is adopted when its planning mode matches and either the route handle is
the same under configurations tempo_config_same_route_v1 calls equal, or the two
pairs’ tempo_route_json_v1 texts are equal. Each route keeps its text per
configuration, so any change of footprint, radius,
latency, limits, gains or pack rebuilds the runtime. A runtime the start
itself built passes the same checks. Where no route can be compared (a command
built through the public constructors, a route with no start pose or one that
reads its targets as it starts), the planning values, footprint, radius, follower
latency and gains of the configs decide (Java LiveConfig.sameRouteInputs). A
route with no start pose is compared by the live pose as well.
Registered autos build their routes’ runtimes, with no plans, on the background
helper as Tempo is configured and as each freezes, and again as each run ends, so
a start nobody warmed adopts one. A warm-up asks for the plans of such a runtime
at once. Python also builds again, with no plans, a route of a registered auto
whose warm-up dropped its runtime (deselected for 50 loops, or another auto
started) or whose runtime built ahead resolves an alliance since changed. A later
pick then asks only for plans on its first loop instead of handing each
route’s build to the helper on a loop of its own. A loop hands over one such
build, only once every step ahead is taken, the pick is pre-planned and both
helpers are idle (_auto_registry._refresh_one_ahead). That pass compares the
alliance the pick’s warm-up read on the same loop, and reads the source itself
only for a pick with no route that reads it (_loop_alliance). The background
helper starts such a build only once a robot loop has ended with room for it
before the next (_background.submit_between_loops). That is when the loop thread’s CPU
clock holds still for 0.5 ms and the time left to the next loop start, timed
from the loops’ starts, covers the build’s expected CPU time and 2 ms. Begun at
any point, a build’s milliseconds of Python held the GIL inside the next loop’s
scheduler.run and stretched it 5-10 ms on a roboRIO (2026-10-29). A loop that
asks for the build’s plans or hurries it lifts the hold. Work queued behind it
runs meanwhile, and a build held for 0.5 s starts anyway. A robot whose
scheduler ticks times its loops from those ticks alone. Off robot hardware, or
without a per-thread CPU clock, the build starts as any other task. Java and C++ build
off the GIL and build every route of a pick in one loop. The autos registered when the first disabled pre-planning loop runs are
frozen and built ahead of their picks, one step per loop. A loop either freezes
the next of them or, for one already frozen, compiles its root and starts its
builds (Java AutoRegistry.freezeOneAhead, Python
_auto_registry._freeze_one_ahead, C++ freeze_one_ahead). On a roboRIO the
C++ compile is most of a first pick. Its WPILib adapter pays about 5.5 ms for
each command it composes into a WPILib group, which records a stack trace for
it. A two-route Setlist’s first pick held its loop 13.1 ms, 11.1 ms of it
composing and 1.5 ms freezing (2026-10-29). A loop takes a step
only once the pick has been warmed on an earlier loop and its pre-planning is
complete, and only while both helper threads are idle. So a step never runs
beside the builds of the one before. One that froze inside another, such as a
named Composer a Setlist drives, is built there too. A first pick of such an auto
then warms a compiled root whose runtimes are already being built, instead of
freezing and compiling on the loop it was picked on. An auto registered after
that first loop freezes as it is picked, since robot code may still be writing
it. A freeze that fails there is left to the auto’s pick, which reports it.
A freeze made by a step stays the step’s until robot code uses the auto (a pick,
a start, a schedule, a command, a comparison) or freezes something that embeds
it. The use takes everything the auto contains with it. Until then, authoring
the auto drops its freeze and that of every Setlist or route the step froze
around it, with the roots compiled from them and the runtimes built for them,
and restores a route’s open leg, so the authoring goes through as if no step
had run (Java FreezeAhead, Python tempo._ahead, C++ freeze_ahead). C++
also counts capturing such a route in a Setlist as authoring it, since the
capture closes its open leg. Its Composer::is_frozen() answers for robot
code’s freezes only. A Setlist contains the
Setlists and routes it drives and a route the Setlists its hooks run. The
console lines a step’s freeze prints wait for robot code’s first use of what
printed them. A step compares no autos named alike. Only
the loop that runs the pick’s start root warms or freezes it.
Java readies a pick’s first pre-plan off the loop on a robot’s planning mode
(AutoRegistry.readyingOffLoop). The loop after the first that finds the
pick’s root unmade hands the urgent helper the pick’s freeze, with the builds a
registered auto’s freeze starts left to a loop, and the root Tempo.update()
runs, whose groups are Tempo’s own (Setlist.prePlanOffLoop). The first such
loop may be the command scheduler’s first run, and the helper runs at the
loop’s priority beside it. The root the scheduler runs composes WPILib groups,
which register with WPILib’s command scheduler from the thread that makes them.
So the helper compiles a throwaway root of Tempo’s own groups, and the first loop
after it makes that root. Then one loop starts the builds the freeze left and the
next warms the pick. Loops in between do nothing for it, and a start meanwhile
waits for the freeze and the root as the loop would have. Each pick is handed
over once while it stays picked. One whose work failed is frozen on the loop,
which reports why. A loop that waits for its background work
(Background.loopWaits: inBackground(false), or the replay planning mode) does
it all on the loop, so a run repeats tick for tick. On the bench roboRIO the first
disabled loop after boot takes 3.8 to 7.9 ms this way and 416 to 910 ms with the
freeze and compile on it.
C++ freezes and compiles the pick on the loop. Its first pick of a two-route
Setlist held a roboRIO loop 13.1 ms (above), and on the bench roboRIO the pick of a
one-route Setlist takes 1.9 ms of the robot thread’s CPU with Tempo::update() and
5.1 ms through the command scheduler.
Python readies the pick in robot init instead, where robot code has no loop
deadline, since a freeze on a helper would hold the GIL against the loop
(_auto_registry.ready_ahead). On robot hardware, once Tempo is configured, the
drivetrain bound and a chooser or prePlan source set, whichever comes last,
it first runs a throwaway route command (tempo._route_warmup), then freezes the
pick as a step ahead (tempo._ahead), compiles the root its start runs, builds
that root’s runtimes and plans and takes them in, warming it every 20 ms as
disabled loops would, for up to 3 s. Robot code that authors the auto afterward
undoes that freeze, and the first loop’s pick makes it robot code’s. The
throwaway route runs through its warm-up, start, every loop and end on the
calling thread, with a stand-in drivetrain, a clock and a scheduler of its own,
its start leaving the autos robot code warms alone, its lines dropped and its
logging written to a sink of its own holding the items the installed logging
consumes. The auto’s first loops then run code the interpreter has already
specialized. On the bench roboRIO (2026-11-04) the first disabled loop after boot
took 3.3 to 6.1 ms this way against 17 to 45 ms with the freeze and compile on it,
and robot construction 1.2 s against 0.3 to 1.3 s.
A Setlist or route robot code froze answers its definition without the freeze
lock (FreezeAhead.settled). A step ahead of a pick that began no freeze
takes no lock as it ends. A freeze holds that lock while it prepares, and
Java’s boot warm-up freezes its throwaway routes on a thread below the loop. A disabled
loop that read its pick’s frozen definition under the lock waited 38 to
131 ms for one on a roboRIO (2026-11-03). A config with
PlanningConfigs.warmWhileDisabled(false) takes no steps ahead, builds nothing ahead and stops warming a chooser’s pick on the disabled pre-planning loop,
which unpins any pick it had pinned. A prePlan(supplier) source is robot code’s
own request, so the registry marks it explicit and keeps warming its pick.
TempoAutos.selected() still answers, and a warm-up call robot code makes still
warms.
Planning settings
PlanningConfigs is a robot-wide config group with three settings: inBackground,
warmWhileDisabled and preplanAhead. preplanAhead is written into each route’s
config.preplanAhead unless the route’s Composer.preplanAhead(n) overrides it.
inBackground is held unstated (Java Optional.empty(), Python None, C++
std::nullopt) unless the author states it, so TEMPO_PLANNING_MODE=replay still
replays a suite or simulation that does not state it. Each binding decides the planning
mode in one function, Java PlanningSettings.decide, Python _planning_mode.decide and
C++ detail::decide_planning, from the stated value, the environment and whether the
process runs on robot hardware. That function returns the config.planningMode a route
is built with, whether a loop waits for the work it needs, and the one-time console
line. tests/fixtures/api/planningSettings.json holds every combination, and each
binding’s planning-settings test replays it. A route’s own seam (SimRun’s replay,
a test’s robot mode) precedes the decision.
Whether a loop waits (Java Background.loopWaits(), Python _background.loop_waits(),
C++ loop_waits_for_builds()) is read where a start or join uses it, from the active
config, so a command made before Tempo.configure follows the config it runs under.
Where the loop waits, a warm-up joins its build and plans on the calling loop too
(Java RouteBuild.settle), so Auto.warmup() and the disabled pre-plan complete on
the loop that calls them. A runtime built ahead under one stated inBackground is
never adopted under another, whatever mode either names (on a real robot an unstated
value and true both name robot). Each binding compares the stated values beside the
route JSON (Java PlanningSettings.adopts, Python _planning_mode.adopts, C++
detail::adopts_planning). The fixture’s adoption rows pin the rule.
Java’s boot warm-up triggers class loading, call-site linking and JIT compilation on a
background thread. It loads the classes route commands use, hands a throwaway command to the
command framework without scheduling it, runs a two-route Setlist root through its join and
connecting drive, exercises every hook kind through RouteWarmup, ends two routes while
their hooks run (one running them, one having scheduled them), and ticks throwaway routes.
Its throwaway routes log nothing, whatever TempoLogging installed.
On robot hardware (RobotBase.isReal()), Tempo.configure starts it once
per process, as soon as it has the drivetrain and unless the config says
warmWhileDisabled(false). A drivetrain bound with its subsystem has the command scheduler
run it as a command named TempoWarmup, so the scheduler’s first schedule, loop and end of a
Tempo command come before the auto’s. One bound without a subsystem starts it on its thread.
Before its first throwaway route it waits for a pre-planning loop to end with its pick warmed
(AutoRegistry.loopTicked), up to 5 s, so its throwaway freezes never compete with the
pick’s. Robot init loads the classes and links the call sites the first disabled loops reach
(Tempo.configure, through the warm-up’s class list), since a loop that needs a class the
warm-up’s thread below the loop is loading waits for that thread. It stops before its next
step once the robot is enabled
(WarmupAccess.stopping). Tempo.warmup() and Tempo.warmupCommand() run the same work.
One called while the boot warm-up runs waits for it. The scheduler’s pre-planning also makes
the command it will run for the pick (Setlist.exportAhead). The start, end and console
paths that no throwaway reaches (WarmSelection.starting, a root’s end cleanup,
TempoConsole) make no lambda as an auto runs, since each one links the first time it is
made.
These runs use a point-mass drivetrain, blue alliance without calling the robot’s
alliance supplier, private gain topics, and their own clock and scheduler
(Setlist.runPrivately). Tempo supplies the sequence, parallel, race, and deadline
groups because constructing WPILib groups would modify the singleton scheduler’s
unguarded membership map off the robot loop. C++ is compiled ahead of time and
CPython compiles modules to bytecode on import, so neither has Java’s JIT warm-up.
Free headings
Java to(x, y) and to(Translation2d), and the Python and C++ to(x, y) and
point forms, mark the leg’s heading carrier freeHeading / free_heading
when the leg requires no heading: no waypoint heading, no rotation target, no
whole-leg aim and no face travel. A face-travel leg serializes its rotation
targets and waypoint heading as any leg does, and the core faces its travel
until the first of them (rotation::travel_then_targets). Such a leg ends on
its last target: the core’s headings op reports that exit heading, so the
join after it compares headings, and the leg waits for its heading to arrive.
The exitHeadings rows of tests/fixtures/api/rotationLocks.json with
facingTravel hold the two cases. A leg that faces its travel and names no
target still ends on a dynamic heading. Each serializer writes "freeHeading": true
in the segment’s rotation object only when set, and mirroring preserves it.
The binding still chains the leg’s start heading as a hold, and the core chooses
the heading.
A Setlist join compares headings whenever the next route’s first leg requires
a heading, unless the robot last drove a route that ends on a dynamic heading
(Java RouteJoin.comparesHeading, Python compares_heading, C++
compares_heading). The cases are in the headingCompared table of
tests/fixtures/sequencing/routeJoins.json, and its waypointHeadings table
pins which first legs count as requiring none. A route whose first leg
requires none starts from the robot’s heading, so its join is by position
alone and a connecting drive to it is itself free.
Point to point
A Composer made with Tempo.to(...) (Java com.tempo.Tempo, the Python Tempo facade, C++
tempo::Tempo in Facade.h) has no start pose. Each Tempo.to overload delegates to a
package-private startless Composer factory (Java Composer.startless, Python
Composer._startless, C++ the private Composer::startless, which Tempo befriends). Its leading legs carry a NaN start heading until a run names one. The core never
sees such a route without a start. The route command reads the robot’s pose on the loop as the
run starts and hands it to the runtime (Java TempoAuto.startFrom, Python _start_from, C++
ComposerAccess::start_from). The runtime mirrors it into the authored frame when the route runs
flipped, as a connecting drive’s start is, and fills the NaN headings with its heading. The
route then serializes and plans like any other with the reset policy off. A resetOdometry(true) on it fails the freeze. A Setlist step starts such a route without a
join, since there is no start to drive to. The warm-up builds the runtime from the pose it
reads on the disabled loop and warms the later legs alone (tempo_auto_warm_later_legs_v1). A
start takes that runtime when the live pose is within the default arrival tolerance of the
warmed one (RouteJoin.needsConnector with the configured defaults). Otherwise the loop makes a
fresh runtime, names its start and reads its targets, and the urgent helper builds it
(RouteBuild.urgent with an existing runtime, which a hurry never rebuilds elsewhere) while the
command brakes toward rest. A start that waited for a build in flight makes the same
comparison once the build lands.
A target a supplier names (to(PoseSupplier), to(Supplier<Translation2d>), a Python
callable, a C++ callable) is read once, on the loop as the run starts, after the start pose
(readTargets, _read_targets, ComposerAccess::read_targets). An empty answer or an
exception never leaves the read. It answers the leg, the fixture’s console line and the leg’s
runOnFailure recovery. The route command prints the line, adopts the recovery as a failed
leg’s, tells the leg-failure listener and finishes without driving. SimRun raises the line
instead. The value is field-frame. On
a flipped route it goes into the authored frame mirrored, so the core mirrors it back to the
value as given. A pose’s heading becomes the leg’s end keyframe. A route with such a target
is built only as its run starts, never by the warm-up, whose progress reads ready with nothing
asked. Its start pose, for a Setlist join, comes from the authored start without building the
runtime while its targets are unread. The messages are tests/fixtures/api/pointToPoint.json. Each binding’s point-to-point
test drives its cases and reads the supplier count.
The to step of a Setlist
Setlist.to(target) and Step.to(target) (Java com.tempo.wpi.Setlist and Step, Python
tempo/wpi/setlist.py and step.py, C++ tempo::Setlist and tempo::Step) take the targets
Composer.to takes and add drive(Tempo.to(target)): a fresh startless Composer with one leg,
held by the step. The step adds no node kind, no FFI and no state of its own. It freezes,
warms, plans from the live pose, flips, fails and takes run commands as any startless route
does, and .at(1) is its one waypoint. Java and Python build the Composer through Tempo.to
and Composer._startless, and C++ through Composer::startless, which befriends Setlist
and Step. C++ takes WPILib geometry through the same AuthoredGeometry template as
Composer::to, and the heading of its to(x, y, heading_rad) is radians, as there.
Refusals are Composer’s. A target off the field fails the core’s bounds op as to is
called, and a waypoint heading that is not finite throws in Composer.to before the leg opens
([Tempo] a waypoint heading must be a finite angle; got <value>). A NaN heading would
otherwise read as no heading in the leg’s draft. tests/fixtures/api/setlistTo.json holds the
forms, the refusals and the runs (a Setlist of to steps and routes, hooks and .at(1), a
target with no route, a give-up, both alliances, group members). SetlistToTest,
python/tests/test_setlist_to.py and cpp/tests/test_setlist_to.cpp run them. The Java
suite has no WPILib scheduler to run a command group on, so it checks the group’s shape and
the Python and C++ suites run it.
Limits
Every binding writes the route config’s angular limits the same way
(tests/fixtures/api/defaultAngularLimits.json):
maxAngularVelocityRadSis the config’s cap, elseSpeed.FULL’s velocity over the drive radius.maxAngularAccelerationRadS2is written only when the config states one.outputAngularAccelerationRadS2is the stated cap, else the chassis torque over its estimated inertia,a r / k^2forSpeed.FULL’s accelerationa, the wheels’ mean lever armr(swerve module offset, mecanum|x| + |y|over the wheel offsets) and the squared radius of gyrationk^2about the robot center of a uniform plate over the bumper outline (the framewithFramenames, grown by its bumper thicknesses), else over the outline. Without wheel positions it isaover the drive radius. It bounds the commands, and the core plans holonomic legs with no stated limit within it. A stated positive infinity leaves the cap off.
The drive radius is the largest swerve
module offset, else the footprint circumradius. For mecanum it is the stated turn radius,
else the largest |x| + |y| footprint vertex, else sqrt(2) times the robot radius.
A differential drive has none (Java AngularDefaults, Python _angular_defaults, C++
detail::angular_defaults). Speed.HALF and Speed.CRAWL scale only caps the config
states.
As a route freezes it compares each leg’s velocity, acceleration and centripetal
limits with Speed.FULL and prints one [Tempo] line for the first leg above it,
counting the later ones (tests/fixtures/api/limitsAboveFull.json, Java LimitsCheck,
Python _limits_check, C++ detail::limits_check). A connecting drive is not checked.
A connecting drive ends on the next route’s authored start pose, heading
included, on a swerve or mecanum drive, whether or not that route’s first waypoint names a
heading (the core’s connector authoring op). A tank drive’s heading follows its path, so
it faces the start heading only when the first waypoint names one. When a drive happens is
unchanged (routeJoins.json).
A connecting drive runs at Speed.FULL, the robot’s configured velocity,
acceleration and centripetal limits, with zero boundary speeds. A join that flows
replaces them at the ends it carries speed through (see
Setlist joins that flow). The editor’s preview plans it at
the robot’s default limits (connectorPlanning.ts).
A drivetrain reports its measured robot-relative speeds through the third argument
of Tempo.configure (Python get_robot_relative_speeds, C++
tempo::wpi::configure and tempo::Tempo::configure). The argument is required;
a supplier may still answer nothing on a tick.
Every route command reads the supplier just before each tick and hands a finite answer
to its runtime (Java TempoAuto.setMeasuredMotion, Python
TempoAuto._set_measured_motion, C++ ComposerAccess::set_measured_motion), which
passes it to tempo_auto_set_measured_motion_v1 with that tick. The core steps the
route’s first command, and the first after an arriveWith hand-off, from that motion
within the leg’s limits (tests/fixtures/api/measuredMotion.json). No answer, or a
non-finite component, sends nothing. SimRun reports none.
An arriveWith command owns the drivetrain while it runs, so Tempo clears its
command history on hand-off. Without a measured-speed supplier, the first
command after it ends steps from rest. On a final leg with no remaining hooks,
the route completes after one zero tick. Bounded braking from the arrival
command’s remaining motion requires a finite measured-speed reading.
isComplete is the core’s. A route that ends while its last command is still moving
keeps ticking after DONE, slowing within the last leg’s limits, until
tempo_auto_is_complete reads true. The wrappers read the phase first and cross the
FFI only once it reads DONE. A custom controller’s output and an output filter are
the host’s and are not bounded. The binding records their final output through
tempo_auto_record_output_v1, so native commands and the follower’s prediction
use the command actually sent. Suggestions keep their own slew history while the
host controls consecutive legs, including a tick with no usable reference
while a host-controlled leg remains active. So a controller that scales suggestions scales the
suggested motion once per tick without feeding that scale into the next suggestion’s
acceleration bound.
Measured limits and calibration
MeasuredConfigs is a config group in every binding, and the route config carries it
as its measured block. Where the binding derives the constraints from hardware (the
swerve module model, or the differential drive’s derived constraints), it writes the
measured top speed and the smaller of the measured acceleration and deceleration in
place of the derived values before an explicit trajectory section applies, so a stated
limit stays a ceiling and an unstated one may rise above the motor model. The core applies
the rest (architecture). The follower latency is a stated
one, else the measured lag, else the physics-seeded lead. For the last, and for the zero of a
config with no drive model, the binding sets followerLatencyEstimated on the config and
writes it true into the route block; it is absent for a stated or calibrated latency.
For the measured lag it sets followerLatencyCalibrated and writes that the same way; a
stated latency sets neither, also one equal to the measured lag. steeringLag
(steering_lag in Python and C++) is the measured block’s steeringLagS, which the core
applies to a swerve whose route block says followerLatencyCalibrated
(Following); the bindings only carry it, and
TempoCalibrationResult reports it beside lagS.
Tempo.configure calls tempo_measured_lag_forget_v1, so the lag the routes measured under
the last applied config is not carried into this one, and a runtime warmed under an
estimated or a calibrated latency is not reused under a stated one (sameRouteInputs
compares both flags).
Each binding prints the core’s
tempo_config_measured_warning_v1 text once per distinct warning.
TempoCalibration’s factories each make a calibration auto that registers itself under
its chooser name, as Setlist.named(...) does. Two made under one name compare by their
routines and options, a wheel position supplier by identity. A run builds
tempo.calibration-settings/v1 from the routines, half the space either way, the route
config blob without its measured block, respectLimits and the wheel position unit. The
core reads the drive model’s limits, the stated ones, the lever arm and the wheel radius
from the blob. Module positions are sent as meters. The binding ticks the core with the
bound pose getter, the measured-speed supplier and the wheel positions, sending each
command through the bound drive output. With saveToRobot the settings also carry
saveToRobot, the saved file’s path and its previous contents, so that the report’s
config line is the merged result. When a run ends, interrupted or not, the binding stops
the core with “the robot was disabled” or “it was interrupted”, commands zero, saves
tempo_calibration_merged_v1 over the previous file at tempo/calibration.json under
the operating directory (in Python, on a robot, the parent of the deployed py folder,
which is the directory Java and C++ name) when saving and tells the core whether the write succeeded
(tempo_calibration_saved_v1), prints the report, which ends with its own
language’s config line, and hands the result to the calibration logging item, which it
also does as each routine ends.
The write goes to a sibling .tmp file that is flushed and synced (fsync, _commit
on Windows) before it is renamed over the target, and the directory is synced after the
rename where the platform allows, so a power cut leaves the earlier file or the new one.
A directory sync that the platform or filesystem does not have (Windows, EINVAL,
ENOTSUP) is skipped silently. Any other failure, such as EIO, keeps the save
successful and prints [Tempo] saved the calibration to <file>, but its directory could not be synced (<reason>); the save may not survive a power loss.
saved() reads that file, then deploy/tempo/calibration.json. fromJson accepts what
the core’s MeasuredLimits::from_value accepts in a config, with numeric strings
refused: the root and measured are objects, each limit is a finite positive JSON
number (the lag may be zero), acceleration holds [speed, acceleration] pairs and
turning [speed, rate, acceleration] triples, and the slowest acceleration point has
a positive acceleration. tests/fixtures/api/savedCalibration.json holds the cases for
all three bindings, and rust/core/tests/calibration.rs checks them against the core.
A robot file that is empty, cannot be opened or fails those rules is skipped with one
[Tempo] ignored the saved calibration in <file> warning and the read falls through to
the deploy copy, then to no limits. Every filesystem call on the robot file sits inside
that handling. The merge ignores such a file too, so the next save replaces it. A deploy
copy that fails the same rules throws [Tempo] cannot read <file>: <reason>, since it
is a tracked file that fails the same way in simulation.
Rotation Locks and Keys
Java Composer.rotationLock(position) and rotationKey(position), and
Python/C++ rotation_lock and rotation_key, add a marker to the current
leg’s heading carrier at a fraction of that leg’s path distance. Each
serializer writes the leg’s markers in authored order as rotationLocks,
{"at": ..., "kind": "lock" | "key"}, and omits the field on a leg without
any. Mirroring preserves them. A position outside [0, 1] raises the argument
error whose text is in tests/fixtures/api/rotationLocks.json, with the value
spelled the same way in every binding. A marker before any to(...) is the
leg-option state error. Planning, the dropped headings and every warning
belong to the core. Two host decisions read the same resolution the core
makes: a route with markers reads each leg’s arrival heading from the core,
and a route’s static exit heading for Setlist joins drops the keyframes a Lock
holds (Java Composer.lockResolvedRotations, Python
_lock_resolved_rotations, C++ lock_resolved_rotations). No binding has
a narrow-spot switch. The core’s narrow-span scheduler
runs only for locked legs and the hold-scheduler fixtures.
The loop budget
The goal is about 2 ms per robot loop spent inside Tempo once the robot has warmed,
counting a route command’s initialize, execute and end, the native calls and the disabled
warmup(). It is a goal. Nothing in the core or a binding stops
planning or skips work when a loop runs long. One-time work runs in robot init and the
first disabled loops: the native library and the field bake in Tempo.configure, Java’s
classes for the disabled loops and its boot warm-up (Warm-up), and the first
freeze and compile of the chooser’s pick, on a helper thread in Java and on the first
pre-planning loop in Python and C++.
Python binds each native function as _native imports. A first run imported no module on
its enable or route-end tick, so those ticks cost what a later run’s do (0.17 to 0.50 ms
against 0.16 to 0.43 ms on the x86 host, 2026-11-02). A Setlist compiles its next run’s tree
as a run ends (Python on the next loop’s pre-planning tick where Tempo.update() or a
chooser or pre_plan supplier runs one, since the compile is milliseconds of Python on a
roboRIO loop that still drives the run’s last route). Every binding reads each route’s
static exit heading from its freeze there, because asking the core on each compile cost a Python route-end tick about 0.1 ms on the x86
host. C++ has no class loading or
JIT step. What the bindings do to keep to it:
- The tick call returns the core’s status block (
tempo_auto_tick_status, the slotstempo_auto_statusdocuments). The phase, segment, leg clock, reference pose, target, replan counts, skipped and missed counts and plan keys a command reads after the tick come from it, so a tick is one native call. A notify or a cancel drops the block, and the next read asks the core for it again. - A route command publishes nothing on its own.
TempoLogging(Javacom.tempo.logging, Pythontempo.logging, C++TempoLogging) installs one consumer per item. Each run reads the installed consumers once as it starts and sets the core’s mask from them (tempo_auto_set_log_mask), so an item with no consumer is never computed in the core and never crosses the FFI. A run with no consumer at all keeps no log object and makes no logging call. - With consumers, one native call per loop (
tempo_auto_log_v1) reads the core’s per-tick frame and drains its event queue into buffers the run allocated as it started. The planned path is sampled only when the core’s plan key moves, the zones only when the leg changes, the state only when it changes. The values a consumer receives are new immutable WPILib objects or records. Nothing else is allocated per loop. - Python leaves the path and the zones off a loop that starts a leg, the run’s
first included, since building them takes milliseconds of Python on a roboRIO
and that loop also takes the leg’s plan. The next loop hands them over, at
once where the warm-up built them ahead. A path not built ahead is built
64 poses a loop (
_PATH_CHUNK, about 0.6 ms on a roboRIO 2) and handed over once whole. It compares the core’s raw path and zone bytes with what it built last (planned_pose_bytes,log_zones_raw) before building any object. Theeverythingsink writes no zones it holds already, and the warm-up makes the route logs’ buffers for the runs ahead. Java and C++ build these objects natively on the loop that reads them. - Each loop hands its items over in one order in every binding: the robot pose, the commanded speeds, the planned pose, the target, the error, the planned speeds, the core’s events in the order they happened, the path, the zones, the state and the timing. Consumers run on the robot loop, after the tick’s drive command has been applied.
- Java prints the first-tick line from a console thread (
TempoConsole), made from the numbers the loop hands over, and says each route’s passed-on-arrival lines once per route in every binding. C++ prints every line a loop can say from a console thread of the same name (tempo::detail::console_err,console_errfandconsole_fatalincpp/src/internal/ConsoleLines.h): the loop hands the finished line over with an atomic exchange and the thread, underSCHED_BATCHat nice 19 and polling every 20 ms, writes it. Lines still waiting as the program exits print then, and a test reads standard error afterconsole_flush()(cpp/tests/console_capture.h). Python does the same from a thread of that name (sayandfatalinpython/tempo/_console.py): the loop makes the text and appends it to a deque, taking no lock the console thread holds while it writes, and the thread writes each line with one write, which releases the GIL. Lines still waiting as the interpreter exits print from anatexithandler, a line said where the thread could not start or after that handler prints where it is said, a forked child starts with no thread, new locks and none of its parent’s waiting lines and prints where a line is said until Tempo is configured in it (os.register_at_fork), and a test reads the console after_console.flush(), which thecapsysandcapfdfixtures ofpython/tests/conftest.pyandpython/robot_sim/conftest.pycall before each read. Lines said while Tempo is configured (the field prebake, pack selection, a saved calibration, saved poses) print where they are said in all three (_console.say_herein Python). In all three a line handed over less than a poll before the process is killed, or ends without running its exit handlers (_exit,exec), is lost, a fatal one included. The core prints itsarrival(through)notices once per route and none for a warm-up route. - A route with no start pose of its own, started from the robot’s pose
(
startFrom,_start_from,start_from), carriesstartFromLive: truein its authored route in every binding. The core then holds back thearrival(through)notices that read the start (the first plan’s corner and the boundary after it) until the route’s first tick, so a pre-plan from the parked pose says nothing about a corner a Setlist’s later route never drives. - Java reads dashboard gain edits every tenth tick and compares the six values
directly, so no record
equalslinks on the loop. - On a roboRIO, the first loop Tempo runs on after it is configured (a route
command’s warm-up or initialize, a Setlist root’s, or
Tempo.update()) checks the thread’s policy withsched_getscheduler(0)and, when it is neitherSCHED_FIFOnorSCHED_RR, prints once[Tempo] the robot loop thread is not at real-time priority, ...with the language’s call to raise it (JavaThreads.setCurrentThreadPriority(true, 99), Pythonwpilib.setCurrentThreadPriority(True, 99), C++frc::SetCurrentThreadPriority(true, 99)). On 2026-10-08 the worst warmed roboRIO loop inside Tempo was 9.7 ms at normal priority and 2.9 ms at real-time priority. Robot code raises its thread at the end of robot init, after configuring, so the check waits for a loop.
Tempo.configure starts the core’s planning workers in every binding (C++
Tempo::configure, both overloads) by calling tempo_pool_start_v1 before it
bakes the field. The workers take the scheduling of the thread that starts them
and cannot raise it later. Configure runs on the robot program’s main
thread during robot init, before Java’s TempoWarmup thread or any route asks
for a plan (ffi-contract.md).
Each binding’s configure test runs configure in a fresh process (a forked JVM,
a fresh interpreter, a C++ death test), since the core starts its workers once
per process from whichever thread asks first. It reads tempo_pool_urgent_nice_v1
and expects the urgent worker at nice 0, or at the configuring thread’s nice
where that is higher. A probe in a fresh process (Java UrgentWorkersTest, Python
test_background.py, the C++ Background death test) configures, builds the
process’s first runtime on the background helper and hands the urgent helper
its first work from a thread at nice 19. It then reads /proc to check that the core’s
tempo-urgent worker and the urgent helper run at the configuring thread’s
nice.
Tempo.configure bakes the field in every binding (C++ Tempo::configure,
both overloads). With the config and pack set, it calls
tempo_auto_prebake_field for blue and then red with the values a route
serializes: the clearance radius, the resolved footprint outline and its
plain-circle flag, and the pack’s default avoid mask. The core bakes the
terrain-crossing variants on a thread of its own, named tempo-bake, under
SCHED_BATCH at nice 19 whatever the configuring thread runs at, so the two
bakes of a configure never hold a core a robot loop is runnable on. A bake the core refuses, or
one that throws, prints [Tempo] field prebake skipped: <reason> and bakes
nothing more. Configure never fails on it, since a route bakes what it needs as
its runtime is built. Java’s configureForTesting and useGamePackForTesting on its
own do not bake. The bake changes no plan. FieldPrebakeTest,
TempoPrebakeTest and test_field_prebake.py drive a route on a baked and an
unbaked pack and compare every command. It costs boot time and saves the first
loop of a route nobody warmed. On a qemu rig with the roboRIO’s target
and sysroot the C++ bake took 49.9 ms at boot, and a plain one-leg route’s
cold first loop fell from 29.9 ms to 18.0 ms. On the x86 host it took 1.2 to
1.4 ms, and the same route’s first loop fell from 0.56 to 0.29 ms in C++, from
0.94 to 0.64 ms in a Python process that had imported wpilib, and from 1.03
to 0.65 ms in Java once the JVM had compiled the path. A cold JVM spends about
22 ms loading classes in that loop either way, which Tempo.warmup() moves
(2026-09-27, the 2026 pack, a 0.88 m square footprint, median of 9 runs).
The porting checklist
For a change that starts in the core (rust/core):
- Core and FFI: land the Rust change. If the FFI surface grows, it grows additively.
Read pins-and-surfaces.md before touching
ffi.rs, and re-pin in the same commit. - Java: port with tests. Naming is decided here, so contested names get a candidate list with in-place readings and the maintainer picks.
- Python and C++: mirror the approved Java surface using the table above. Same
semantics, same defaults, same error text (house message style:
[Tempo]prefix,must be X; got Y). Port the Java tests along with the code, since a behavior pinned in one binding is pinned in all of them. Keep plain-JUnitwpitests independent of HAL and scheduler runtime. Exercise those integrations in the simulation suite. - WASM: usually only affected by serialization and field-export changes. Record a no-op in the commit message.
- Surface fixtures: update
tests/fixtures/api/*.txtadditively in the same commit (see pins-and-surfaces.md). - Consumers:
tests/robot/java_sim/compiles against freshly staged artifacts, the editor’s config/setup codegen (gui/web/src/features/robot/code/robotCodegen.tsandrobotSetupCode.ts) emits the new shape in all three languages, and the docs’ code fences passnpm run check. External names (WPILib, AdvantageKit, subsystem methods invented for examples) go in the reviewedEXTERNALlist inwebsite/scripts/check-api.mjs. The fence checker verifies method and import/include names. Inspect signatures and argument order separately, and compile or exercise consumer paths where applicable.
Complete each applicable check and record the reason for any skipped binding.
Behavior parity
A route is authored against an applied config. Composer.startAt / start_at,
Tempo.to and Tempo.composer throw [Tempo] no config is applied yet; call Tempo.configure(...) first (C++ Tempo::configure(...)) before Tempo.configure in all
three bindings. Python’s and C++‘s bare Composer() can still be authored before it, and
the freeze repeats the pack checks for such a route.
ModuleConfigs setters change the module and return it. A preset and
new ModuleConfigs() both hold the unreduced motor and absolute reduction, so
ratio replaces gearing instead of multiplying it. An unset topSpeed is estimated
from motor, ratio and radius, and a stated one stays fixed.
WheelTread applies COF without resizing the wheel. The editor stores tread
identity separately from its resolved coefficient, so a measured override can
retain its source selection. A preset factory defaults to the tread of the
wheel its vendor lists first: Colson for the MK4, MK4i, MK4c and MK4n, Spike
Grip for the MK5i and MK5n. The WCP, REV and Thrifty factories have no named
tread and default to a COF of 1.0. Selecting a module in the editor applies its
default tread. tests/fixtures/api/swerveModules.json lists every factory, gear,
ratio, wheel radius, default tread and tread coefficient; Java, Python, C++ and
the editor each check their own list against it. Ratio and hardware
edits preserve later tread and COF overrides. Java/Python/C++ exports use named module factories
plus overrides when a module and ratio are selected. Generated output must
preserve radius, reduction, COF, motor, current, and explicit 12 V speed. Preset matching cannot replace any of them with a numerically different default.
Composer’s limits(v, a, c), limits(v, a, c, omega, alpha),
limits(TrajectoryConstraints), and speed(Speed)
update defaults for the next to(...) and later legs until changed. The open leg
retains the constraints captured when it opened, except the leg a Tempo.to starter
opens. Until the route’s next to(...) that leg takes the limits written after it, as a
startless route’s first leg does when they are written before its first to(...)
(Java starterLegPending/starterLegOpen, Python _starter_leg_pending, C++ the
same flags in the Composer state). Compact limits are finite
positive SI caps, with zero boundary velocities and no steering-rate cap. The full
constraints form keeps all boundary and steering fields. Angular
components are finite, nonnegative SI caps. Zero inherits the robot cap and
positive values can lower it. Named speed presets keep configured angular
components without scaling them. Other sticky
leg options continue to update the open leg and later defaults.
Composer defaults to Arrival.THROUGH in every binding, so intermediate waypoints
use the full carry-speed cap of the slower adjacent leg. Explicit fractional,
stop and wait arrivals stay sticky until changed. Junction.SMOOTH keeps
its explicit 0.7 fraction. The route’s final leg still ends at its configured
end velocity. The core receives resolved junctions, and an absent wire junction
means no incoming transition. Editor code generation,
source import, the passing-speed control and preview lowering use the same
full-speed default. An omitted wasm preview speed cap already permits full speed.
Robot radii (a footprint’s circumradius, the swerve module radius, the extension sweep
a replanner hands the core), footprint outlines (circle, hexagon, rounded corners), aim
headings and Pose.facing come from the core’s correctly rounded tempo_math_hypot_v1,
tempo_math_atan2_v1, tempo_math_sin_v1 and tempo_math_cos_v1 (CoreMath,
tempo._core_math, tempo::detail::core_*), so every binding hands the planner the same
bits on every target. Python binds the four symbols on the GIL-keeping _fast handle. A live
aim resolves every tick, and a CDLL call releases the GIL and can wait out the
interpreter’s switch interval while another thread is busy. Java’s live aims go through the
direct-mapped TempoNativeFast.
These classes need the native library when they are used. Java and C++ RobotFootprint
load it when a footprint is built, TempoConfig when it derives a radius from module
offsets, and an aimTarget when it resolves a heading. A missing library shows up there as a
TempoLoadException or std::runtime_error. In Java the first implicit load runs inside
a static initializer, so its failure arrives wrapped in ExceptionInInitializerError.
NativeLoader.ensureLoaded() unwraps it into the TempoLoadException. Python loads the
library when tempo is imported.
When no outline is given, TempoConfig in all three bindings
derives the planning radius from the module offsets as the farthest module’s core hypot
plus 0.08 m, so
offsets at (+-0.4, +-0.4) give the same 0.645685424949238 m bits in each. Java and Python
make that radius a circle footprint. C++ sets the radius alone, which the core treats
the same. With neither offsets nor a footprint all three refuse the config with the
noOutline text of tests/fixtures/api/configParts.json, which holds every whole-config
refusal.
A rounded corner rounds each rotation product before the sum, as Java and Python do. The
C++ library builds with -ffp-contract=off. A sum of products that feeds the core is
defined in the library and not in a header, because a header compiles under the
including program’s flags and GCC fuses multiply-adds for aarch64 by default. The
drivetrain model’s net_drive_wheel_torque_nm, drive_calibration_warning and
DifferentialModel::derive_feedforward_latency are in cpp/src/DriveModel.cpp, and
the aim evaluator’s passed_element projections and distance in cpp/src/AimEvaluator.cpp,
for that reason. Two header cases remain. In RobotFootprint.h a rounded corner’s direction
is axis-aligned, so each of its sums has a zero product and fusing cannot change it. The
products are stored through volatile in case a caller’s direction is not. The
simulators under cpp/include/tempo/sim stand in for a robot and do not feed the
planner’s inputs. C++ angles::deg, rates::deg_per_sec and the default rotation tolerance multiply by
pi / 180 rounded once, as Math.toRadians and math.radians do, so a degree
conversion has the same bits in every binding. The editor’s planning radius takes an
exact-integer hypot with the same bits as the core’s.
Each binding uses its own math library for the round-footprint classifier
(a 1e-9 tolerance against hypot), the aim evaluator’s distances along the path
(sqrt of the squares, rounded unfused), Setlist joins
(RouteJoin, routeJoins.json) and the simulators. Each compares a distance with a
tolerance, so an ulp changes a decision only at the boundary.
Arrival checks read the core’s correctly rounded distance from the tick status block. The block includes the tick’s XY so a query for another pose computes its distance through the core math boundary. The ordinary arrival check adds no native call after the tick.
Java and Python wrap a pose’s heading into [-pi, pi] when the pose is built. C++ keeps it
as written, so a heading outside that range reaches the core a whole turn apart in
the route JSON. That covers a start_at pose, a to(pose) end keyframe, and a later leg’s start
heading chained from one of them. The core wraps every heading it compares, so the routes
drive alike. They have the same hooks at the same ticks and the same commands, which differ by at
most 3e-15 rad/s under an angular acceleration limit on the unmirrored alliance
(a_heading_a_whole_turn_away_drives_the_same_route in
rust/core/tests/walled_routes.rs). The host arrival check wraps the heading error, and a
Setlist join compares wrapped headings, so neither changes either. One value shows the
difference. On the unmirrored alliance a C++ route’s runtime start pose carries the start
heading as written, where Java and Python carry it wrapped.
Setlist joins are decided on the robot, identically in every binding
(java/src/main/java/com/tempo/wpi/Setlist.java, python/tempo/wpi/setlist.py,
cpp/src/Setlist.cpp and the C++ adapter). Every route leaf, nested Setlists and
both sides of a when included, compiles to one route step. As its drive starts
it asks the run’s AutoRun whether any route has started yet. The first route
the run starts uses its authored reset policy and never connects, whichever
route it is: the first in tree order, the route after a when that ran
nothing, or the side a when picked. The freeze marks the routes that could be
first (sequences stop at a member that always starts a route, and race members,
deadline companions and a when with a side that starts none do not stop it).
Those are built with the authored policy so warmup can plan them ahead. A
candidate that turns out not to be first switches to FORCE_NO_RESET. The core
adopts a warmed plan only within the route’s default arrival tolerance of
its authored start. Every later route
builds the route’s runtime, reads the live pose, and compares it with the
route’s runtime-frame start (RouteJoin, shared cases in
tests/fixtures/sequencing/routeJoins.json). It connects when the
distance exceeds the join translation tolerance + 1e-12, or the wrapped heading
error exceeds the join rotation tolerance + 1e-12 while the run’s
compareHeading is set and the drivetrain is not differential. A pose with any
non-finite component never connects. Each route or connector that ends sets the join
tolerances to its last leg’s arrival tolerance (arriveWithin, else the
configured default) and compareHeading to whether the route has a static exit
heading. A route has one when authoring fixes the heading it ends on: its last
leg’s last keyframe, or the heading a last leg with no keyframe holds. A last
leg that faces travel, or that a reactive aim steers with no keyframe, has none.
Nor does a holding last leg after a leg that a reactive aim alone steers. The core
starts the legs after that aim leg at the heading the aim left, and the
carry stops only after a leg with a keyframe, one facing travel or one on a
differential base, which keeps its own end (Composer.staticExitHeading in
Java, _static_exit_heading_rad in Python, static_exit_heading in C++). A
native step that requires the drivetrain clears the tolerances, so
the next join uses the configured default arrival tolerance, and sets
compareHeading true. compareHeading starts true and the tolerances start
cleared. The connector is an internal one-leg Composer definition in
the route’s origin alliance, authored frame, avoid mask and custom avoid zones,
with default leg options: startAt(live).to(entry), the live pose mirrored into
the route’s authored frame when its runtime is flipped, so the rotation profile
begins at the robot’s heading. The core makes it from the next route’s
authored-route handle and the config handle (tempo_route_connector_v1) and
writes back the one leg the binding keeps. Its runtime is built from that
route handle and the same config handle, so a join serializes nothing. A
connector carrying a run’s whole-run commands writes its merged leg as an
authored route, as any route is written. It runs as a FORCE_NO_RESET occurrence inside
the route step, so group requirements and cancellation are the route’s. A
connector that cannot plan is reported as the drive to the next route’s start. One that
cannot be built is reported and skipped, and the route runs from the live
pose. Mixing mirroring and never-flipping frames anywhere in the tree fails at
freeze in every binding.
Setlist joins that flow
A Setlist sequence links each member that ends on a route step to the route step
the member after it starts on (Java Setlist.linkRouteSteps, Python
_link_route_steps, C++ TreeAssembly.h). A route step starts and ends on
itself. A nested Setlist or a sequence group starts on what its first member
starts on and ends on what its last member ends on. So a route links into the
first route of a nested Setlist or sequence after it and out of the last one
before it, at any depth. A nested Setlist with finallyDo actions ends on
nothing, since the actions run as it ends. A command, wait, parallel, race or
deadline group, or branch starts and ends on nothing, and the last route of an
auto has nothing to link to. Java and Python read what a compiled command
starts and ends on from maps on the compile context, by the command’s identity,
since WPILib groups do not show their members and a nested Setlist’s prepared
nodes are shared between its uses. C++ reads it from assemble_node as it
builds each subtree (RouteEnds). tests/fixtures/api/setlistLinks.json holds the
shapes and the links each makes, which every binding’s tests read (Java
SetlistLinksTest, Python test_setlist_links.py, C++
SetlistFlowTest.EveryShapeLinksTheDrivesTheTableSays). A route a link starts early inside a nested
Setlist or sequence is the one the sequences around it initialize next, which
spends that call, so a cancel still reaches it. A link asks the core to end the first route moving
(tempo_auto_flow_into_v2) with the last waypoint’s through fraction (0 for
STOP and pause), the next route’s authored-route and config handles (the pair its
own runtime is built from), whether that route names a start heading, and
the join test’s inputs as the binding takes them when the next route starts:
compareHeading (compares_heading of the first route’s static exit heading
and the next route’s free start) and tolerance (the first route’s last-leg
arriveWithin, else the configured default). It asks unless the first step has a whole-run runAfter, the next has a whole-run or
first-leg runBefore, or the next route has no authored start or reads a target
from a supplier at start. The core makes the remaining stop decisions
(AutoRuntime::flow_into): last-leg runAfter, arriveWith, a custom
controller or output filter (hook_paced), a crossing heading hold, a next
drive whose first leg has keep-ins or stops to turn for a crossing’s heading
(the exitStops cases of routeJoins.json, which the core and each
binding’s tests read), a turn that reverses the robot’s travel or that the
plans on both sides round no faster than they stop, an exit speed
no faster than one loop of the last leg’s acceleration, or a join the shared
rule says needs a heading the robot would arrive off from. The core decides
with the same rule the binding applies at the join (route_join, below), from
the authored end of the first route moving along the chord it arrives on.
While the first route drives its last stretch the step reads the planned
handover (tempo_auto_planned_exit_v1, eight values: pose, velocity, turn rate,
the handover distance, and whether the core flows into the next route itself)
and asks the next route, or the connector where the core flows into a drive to
the start, to plan its first leg from it (tempo_auto_expect_entry_v1). It asks
each loop, but the core plans again only when the handoff moves more than 2 cm, 1
degree, half the join’s velocity step or half a loop of angular acceleration in
turn rate. The connector is built on the first ask and kept for the join. Where the core
flows into the route itself but the planned handoff stands within half the
first route’s tolerances of needing a drive to the start, that drive is built too,
so the join never builds one on the robot loop. On the loop the first route reports DONE with
tempo_auto_flowed_out_v1 returning 1, it sends no command and no zero. The
step then runs its own end (whole-run hooks, prebuilt connector, finallyDo
actions) and starts the next step, which initializes and runs its first loop on
that same loop. The end and initialize calls the group makes next are spent.
A step started that way hands on no further on the same loop. Where it ends on its
first loop, its sequence advances to the step after it as usual, so a cancel
reaches that step. A step whose loop throws, its own end or finallyDo included,
commands zero after ending. A route command whose hooks fail to end stops the
chassis instead of leaving it to a next drive.
The next runtime takes the motion the first left (tempo_auto_flow_in_v1)
before its first tick, lowered to what its first group takes. The join decision
then reads that motion as flow (routeJoins.json v6). The offsets along the
travel and across it beyond the last leg’s moving handover distance are compared
with the translation tolerance as one distance, and the heading as without flow.
The flow is tempo_auto_flowed_out_v1’s five values. Where its fifth reads 0, the
core planned the exit for a drive to the start, and that drive runs whatever the
live pose reads. A join that waits for the next route’s runtime slows from the
flow within the limits (the brake output seeded with it where nothing is
measured or sent) and keeps the flow at the slowed motion until the robot is at
rest. So a later loop decides from the robot’s motion and a drive to the start is
never planned from rest while it still moves. A connector flows into its route
with fraction 1 unless the route’s first leg has a runBefore. An interrupted
step drops any flow and commands zero as before. The shared cases are in
tests/fixtures/sequencing/routeJoins.json and the per-binding suites are
SetlistFlowTest, test_setlist_flow.py, test_setlist_flow.cpp.
Route hooks run inline in Tempo-built route commands in every binding. The route
command initializes, executes and ends them itself, and requires their subsystems.
A starting step, hook or recovery takes over from a running hook or recovery that is
the same command or shares a subsystem with it, unless that one is
kCancelIncoming, which refuses the newcomer with a console line. Every hook ends
when its route ends. A runOnFailure recovery is adopted by the run (AutoRun),
which the Setlist root executes after its tree each loop. When the tree finishes
with recoveries running, a root the scheduler runs directly ends and schedules one
recovery tail per recovery, requiring only that recovery’s subsystems and reporting
its name, interruption behavior and runsWhenDisabled. A root inside another
command, a decorator included, runs them to the end, and an interrupted root ends them.
The frc2 C++ scheduler runs a schedule made inside its loop at once and releases
a finished command’s requirements after End, so a C++ root that hands off
reports finished and schedules its tails from End. While it ends it allows
interruption and leaves the subsystems its tails took out of GetRequirements,
so the scheduler keeps those with the tails and releases the rest, the
drivetrain among them. The hand-off reaches OnCommandFinish in every binding,
and frc2 frees a root it owns. frc2 frees an owned command only when it
finishes, so C++ tails are not handed to it. A tail owner holds them and frees
each one at the top of the loop after it ends, finished or interrupted. The C++
scheduler-facing core (cpp/src/internal/SchedulerCore.h) is WPILib-free and
runs under ctest against a stand-in that follows the frc2 rules, once more under
AddressSanitizer. A C++ root scheduled again on the loop it handed off ends at
once with a console line, since its tails still hold subsystems it requires. A
hook or step that cancels the root from inside it, as a Proxy or
ScheduleCommand whose target needs one of the root’s subsystems does, ends the
auto in every binding. frc2 ends the C++ root at once, while the groups inside
it are still looping over their members, so the root closes its run there and
ends its tree, hands off or ends its recoveries and discards warmed routes as its
outermost call returns. Until then every member of the closed run does nothing,
and a step that frc2’s sequence starts again stays ended. The root is named
after the Setlist.
A tick fault is the core refusing a tick, or a custom controller, output filter or
control session throwing inside it. Called directly, TempoAuto.tick handles one by
binding, as the path follower reference
states: Java and C++ latch the fault and return zero, and Python cancels the run and
raises. A controller end hook that throws outside a tick, as an arrival, a failure
notification, a cancel or a close ends its leg, latches its fault and cancels the run
in all three. A robot-code callback that throws inside a tick, such as an endWhen
predicate or an aim supplier, cancels the run and propagates in all three. Through a
route command or a Setlist step, each of these ends the command at rest.
In every binding the failure stops at the auto’s root, the command schedule(), start()
and command() run (Java FreshRootCommand, Python _FreshRoot, C++ RootRunCore). A
hook that throws, a factory refusal as the hook runs, or anything else the tree throws ends
the whole auto as interrupted: its routes, steps, group members and recoveries end and its
finallyDo actions run. The root then sends zero through the bound drivetrain, whether or
not the auto holds a route, so a drivetrain step that threw leaves no speed behind; with no
drivetrain bound, or when that call fails, the line leaves out that the drivetrain is
stopped. One console line names the auto and
the hook and quotes the failure, and Java and Python follow it with the stack trace of an
exception Tempo did not raise. The root then reports itself finished, so the scheduler or
Tempo.update() ends it and releases what it requires, and nothing reaches the robot loop.
A failure as the root ends, such as a finallyDo action that throws, is said the same way.
The rule, the line and the cases each binding tests are autoFailure in
tests/fixtures/api/runnableAcceptance.json.
Four failures are not contained. A freeze error from schedule() or start() comes
before the run begins. A failure in a throwaway root of the Java or Python warm-up goes to
its caller. Python KeyboardInterrupt, SystemExit and other non-Exception errors pass
through, and so do Java Errors other than LinkageError. C++ contains every throw and says an unknown exception for one that
is no std::exception. A team’s own command group around the auto’s command goes on to its
next member.
A route command built through the public TempoCommand constructor cannot see its
hooks when built, so it requires the drivetrain alone and schedules its hooks and
recoveries on their own. Schedules requested during a tick wait until the tick’s
work is done. When the route ends it cancels every hook it scheduled, taken up or
not. The Java and Python schedulers queue a cancel made inside their loop behind
the schedule, and C++ schedules the deferred hook and then cancels it. So a hook
fired on the loop the route ends starts and ends with it, in a race or under a
timeout too. A hook or recovery whose subsystem the route command holds, or another
scheduled command holds, is skipped with a console line naming the holder, so a
hand-built route command inside a Setlist or group cannot cancel the command around
it. A subsystem’s default command gives way instead, and so does a hook or
recovery a hand-built route scheduled, this one’s or an earlier one’s, from the
scheduler starting it until it ends. A requested schedule waits in a pending set.
Each scheduler reports to the record through its initialize callback (a pending
command moves in) and its finish and interrupt callbacks (the command leaves),
registered once. A subsystem whose periodic marks the start of each loop, before
any binding runs, drops what is still pending, which the scheduler refused. It is registered
again, unregistered first, with every schedule, since unregistering
every subsystem drops it. C++ also drops a pending command as soon as frc2’s
synchronous Schedule returns. A schedule the scheduler refuses never counts, and
the same command run later by an operator is held like any other. In Java and
Python, a refused command that robot code starts before the marker’s periodic runs
in the next loop, from a mode init, a periodic method or another subsystem’s
periodic, is taken for the route’s. A
hook already running is looked up before that check, so the same command as
run and runAfter runs once. The three bindings print the same line.
The root starts the auto clock on its first loop and each route anchors
matchTime there through tempo_auto_set_auto_start. At freeze a hook that
requires the drivetrain fails, and concurrency checks count hook subsystems,
naming the hook and the colliding step. The shared subsystems are listed sorted,
duplicates kept.
A run’s own commands (after drive(path), or on Step.drive(path)) split by scope
in every binding. Leg-scoped ones (at(n), waypoint n counted from 1, which ends leg n) reach the Composer
through its access seam and merge into a separate occurrence of the route, never
into the Composer’s definition. Each list follows the path’s own, and run
triggers are numbered after the path’s. endWhen ends the leg when either check holds, the
shorter give-up time wins, and a run’s runOnFailure beside the path’s own forms a
recovery pair the route adopts member by member. Footprint inference runs again
over the merged legs, counting the whole-run commands before the first leg, during
every leg and after the last. A run with whole-run commands also builds its
connecting drive with their footprint. That is inference over the connector’s one leg with
runBefore before it and run during it (runAfter cannot change that leg). A run
without them builds the connector as a plain one.
Whole-run commands run in the route step itself: runBefore before its connecting
drive, run while the connector and route drive, endWhen and giveUpAfter checked each loop before the drive
runs, then runAfter, unless the whole-run give-up time ran out or the route’s last leg
failed (tempo_auto_failed_segments_v1). A connecting drive that fails also fails the run
(failJoin, _fail_join, fail_join): its one leg failed, its runtime could not be built
twice, or the drive could not be built at the join, which prints [Tempo] the drive to the next route's start could not be built ({reason}); the run fails. The step commands zero,
clears the join flow, starts the whole-run runOnFailure, discards the route’s runtime
without driving it and skips runAfter, as the give-up time does. A connecting drive built
ahead of the join that cannot be built prints nothing, since the join builds it again from
the live pose. The connectingDriveEndings table of routeJoins.json holds the endings and
every binding’s SetlistRunTest runs them. A loop of the step that throws, from the run’s endWhen, a
run predicate or anything else it runs, ends the step before the error leaves it.
The route or connecting drive commands zero and releases its runtime, and the whole-run
commands end, in every binding. They register with the AutoRun while the step runs, so
route hooks, steps and recoveries take over from them and they from those by the
same rule. A command already running as either is not started twice. A
whole-run run takes a fraction, Condition.progress, or a state: matchTime,
when, inside, near or a combination of them. Plain match time and predicate triggers
and the states the core decides are watched from the connecting drive on. A fraction, progress or window bound is a fraction of the route’s whole
path distance across all its legs, not the connector’s, so it fires only once the
route itself drives. A whole-run window ends when the route ends at the latest. The whole-run runOnFailure starts once per
run, when the route reports a leg failure (the watchdog fires, the core fires a
fail case, or the skipped or missed leg count grows) or the whole-run give-up time
runs out. As a route finishes, it checks for leg failures before releasing its
hooks. A whole-run recovery started by that check competes with those hooks for
subsystems under the claim rule. At freeze, for the whole run and for each leg scope, a run’s
runOnFailure recovery that shares subsystems with one of the same scope’s
runAfter commands prints a console line naming both. The warning neither
rejects the auto nor changes how the commands interrupt each other. A
leg’s recovery starts as the leg fails and its runAfter as the leg ends, so the
runAfter interrupts it then. A whole-run recovery starts at the first leg failure
while the run drives, and the whole-run runAfter interrupts it only if it is
still running when the drive ends. The whole-run give-up time starts the recovery
and ends the drive on the same loop, so there it interrupts at once. A group or
branch locks a Step.drive when it accepts the step, fixing its settings at that
point. Later builder calls on the step raise an error, but the locked step can
be passed to another group or branch. A failed group or branch call does not lock
an editable step. C++ DriveStep && verbs return a value, so an inline chain
produces a separate step. Leg range is checked at freeze against the route
section’s leg count.
when(check, a).otherwise(b) compiles to one branch command holding both compiled
sides. It evaluates the check once as it initializes (a supplier, or the auto clock
against Condition.matchTime, reading elapsed time as 0 before the root’s first
loop) and runs the side it picked. The freeze prepares both sides, so their
concurrency, drivetrain-hook and frame checks run, and the branch requires the
union of both sides’ subsystems. A missing check, or Condition.when without a
predicate, refuses at the call.
tests/fixtures/api/setlistMessages.json stores the text of every Setlist
call-time authoring error, the freeze-time leg-range error and every freeze
notice. Each binding’s tests read it. Validation errors use the same text in
every binding that can raise them, with one spelling difference. A freeze-time
error that names a hook command, such as a concurrency or drivetrain-hook error,
uses that binding’s spelling (runBefore in Java, run_before in Python and C++),
as Composer’s own messages do. All three bindings use the same null-argument
messages: blankName for a null or blank name, and
pathMissing, commandMissing, conditionMissing, checkMissing,
giveUpMissing and runMissing for the rest. C++ cannot pass a null path,
condition or give-up time. A method validates its first argument before the
others. A per-run method on a Setlist with no drive raises noDrive before
validating its argument. The message tests pin that order with
giveUpAfter(null), a null command and a null end check in Java and Python. C++ pins
it with a null command and an empty end check, since its give-up time is a
double. The refusal of a group, when or otherwise member of the wrong type
ends with the host’s word for the member’s type: java.lang.Integer in Java, int
in Python, and for a null member null in Java and C++ and NoneType in Python.
C++ refuses any other wrong type at compile time. callTime.python holds the
Python-only refusals, of argument types Java and C++ settle when compiling. Each
refusal names an error kind, and the table’s errorKinds maps each kind to the
class each binding throws:
| Kind | Java | Python | C++ |
|---|---|---|---|
| argument | IllegalArgumentException | ValueError | std::invalid_argument |
| state | IllegalStateException | RuntimeError | std::logic_error |
| type | IllegalArgumentException | TypeError | refused at compile time |
| missing | NullPointerException | ValueError | std::invalid_argument |
The tests compare the exact class.
The bindings share conformance fixtures (see rust/core/tests/conformance.rs and
the per-binding conformance tests). The same route authored in each language must lower
to byte-identical plan inputs. Extend the conformance fixtures for every new option
that affects planning.
Java command frameworks
Canonical core sources accept Object commands and requirements and
Supplier<?> factories. internal.commands owns the neutral lifecycle,
internal.cmd2 contains the v2 scheduler and composition adapter, and
internal.cmd3 exists only in the alpha-7 overlay. Classpath probing discovers
the available adapters. Commands and drivetrain
requirements select one without loading the other, but mixed v2 and v3 inputs
fail with both framework names. Freeze validates commands and
requirements before scheduling. Factory evaluation stays deferred until
execution, with the declared-requirement and drivetrain rules enforced.
CommandResults holds bundle-dependent return signatures. The 2026 and
alpha-6 methods return v2 Command, preserving direct decoration and
composition. Alpha-7 methods return generic command results, which need a
target type before framework member access. The public TempoCommand is a
thin v2 command facade on 2026 and alpha-6 and a neutral facade on alpha-7 and alpha-8.
All route execution is in the canonical RouteCommand.
Tempo.coroutine(CoroutineBody<C>, Object...) supplies a neutral payload
accepted by every hook, step and group. An explicit
(Coroutine co) parameter gives the body its v3 API without adding a v3
reference to core. Declared mechanisms participate in freeze checks and the
root’s requirement union. The adapter constructs a named v3 command at
freeze without running its body. V2 rejects the shorthand at freeze with
[Tempo] Tempo.coroutine needs Commands v3.
V2 keeps its native interruption behavior. V3 hook conflicts compare
numeric priorities. Neutral cancellation policies export as 0 and Integer.MAX_VALUE,
and equal priority permits interruption. Protected hook
roots start on the owning scheduler’s next event-loop poll and use a
private scheduler for descendants. AutoRun owns recoveries across route
boundaries and cancels them on interruption. Recovery tails keep the v3
root and its full requirements after the last step. Scheduler-free runs
poll their private v3 scheduler from Tempo.update(). Cancellation calls onCancel but suspended Java finally
blocks do not run. A command completing with an error receives no onCancel call. Tempo guards
its cleanup against repeated cancellation and runs finallyDo once on every exit.
Alpha-6’s annotation processor rejects annotated v3 commands, and runtime selection refuses v3 inputs when the bundle lacks its adapter. Unused v3 classes on a v2 robot’s classpath do not select v3. WPILib version guards reject a mismatched bundle before route execution. Public examples and the scheduler differences are documented in Commands v3 for Java.