1.2 Configure the robot
Tempo needs to know about your drivetrain, how big the robot is with bumpers, and what field it’s on before it can plan a path.
1. Describe the robot
Add this to your robot code.
import com.tempo.config.*;
import com.tempo.config.SwerveModules.SdsMk4iGear;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.system.plant.DCMotor;
import static edu.wpi.first.units.Units.*;
public static final TempoConfig CONFIG = new TempoConfig()
.withModule(SwerveModules.SDS.MK4i(SdsMk4iGear.L2, DCMotor.getKrakenX60Foc(1), Amps.of(60)))
.withModuleOffsets(new Translation2d(0.3, 0.3), new Translation2d(0.3, -0.3),
new Translation2d(-0.3, 0.3), new Translation2d(-0.3, -0.3))
.withMass(Kilograms.of(55))
.withFrame(Meters.of(0.71), Meters.of(0.71))
.withBumpers(new BumperConfigs().thickness(Meters.of(0.09)));from tempo import BumperConfigs, SwerveModules, TempoConfig
from wpimath.system.plant import DCMotor
CONFIG = (TempoConfig()
.with_module(SwerveModules.SDS.MK4i(SwerveModules.SdsMk4iGear.L2, DCMotor.krakenX60FOC(1), 60.0))
.with_module_offsets((0.3, 0.3), (0.3, -0.3), (-0.3, 0.3), (-0.3, -0.3))
.with_mass(55.0)
.with_frame(0.71, 0.71)
.with_bumpers(BumperConfigs().thickness(0.09)))#include <tempo/Tempo.h>
#include <tempo/SwerveModules.h>
inline const tempo::TempoConfig kConfig = tempo::TempoConfig{}
.with_module(tempo::SwerveModules::SDS::MK4i(
tempo::SwerveModules::SdsMk4iGear::L2, tempo::DcMotor::kraken_x60_foc(), 60.0))
.with_module_offsets({{0.3, 0.3}, {0.3, -0.3}, {-0.3, 0.3}, {-0.3, -0.3}})
.with_mass(55.0)
.with_frame(0.71, 0.71)
.with_bumpers(tempo::BumperConfigs{}.thickness(0.09));The example is a 55 kg robot on SDS MK4i L2 modules with Kraken X60s and a 60 A stator current limit per drive motor, so replace the numbers with your robot’s.
- Weigh the robot with the battery and bumpers on.
- Module offsets are measured from the center of the frame, with +x toward the front of the robot and +y toward its left. They go in the order front-left, front-right, back-left, back-right.
- The frame size is the width (left to right), then the length (front to back). It doesn’t include the bumpers, and the bumper value is how thick they are.
If your modules or motors aren’t the ones shown, pick yours from the list on Swerve drive.
CONFIG (kConfig in C++) is passed to Tempo.configure(...) on the next
page, Connect the drivetrain.
Python takes plain numbers in SI units (meters, kilograms, amps and
radians), and if you have inches or degrees you can convert them with
Distances.inches(...) and Angles.deg(...). Method names are the Java
names in snake_case, so withModuleOffsets is with_module_offsets.
If you have a mecanum or differential-drive robot, use withMecanum(...)
or withTank(...) in place of withModule(...). See Mecanum drive
and Differential drive.
Tempo’s GUI can also write this code for you from its Robot screen. See Export robot code.
2. Add the field
The field comes from a game pack, which is a game.toml file in your
project’s deploy folder. The Field screen in the desktop app of Tempo’s GUI
copies one into your project
(Sending the pack to the robot).
| Language | Pack file |
|---|---|
| Java, C++ | src/main/deploy/tempo/game.toml |
| Python | deploy/tempo/game.toml, with deploy next to robot.py |
Tempo looks for a game pack in this order and uses the first one it finds:
- A pack picked in robot code. See game pack selection.
tempo/game.tomlin the deploy folder.- The pack that comes with Tempo for your WPILib year, which is REBUILT 2026 on both 2026 and Alpha 2027.
If your robot is playing the game in that pack you can skip this step, but on any other field you need to add that field’s pack or Tempo will plan around obstacles that aren’t there. The examples in these docs are on the REEFSCAPE 2025 field, and Write the first auto has that pack to download.
If it fails…
No game pack was found, so Tempo used the pack that comes with it for your WPILib year. Put your pack at tempo/game.toml in the deploy folder.