Example
This REEFSCAPE route drives from the starting line to reef branch G and scores on L4. The poses need the REEFSCAPE 2025 pack, which isn’t Tempo’s default pack.
- A
Composeris one route the robot drives. startAtsets the pose the route starts from, here the middle of the blue starting line.resetOdometry(true)sets the robot’s pose to the start pose when the route begins.originAlliancesets the alliance the route was written for. On the other alliance, Tempo mirrors the route (alliance flipping).speedsets how fast the robot drives.FULL, the default, uses every configured limit, and the slower speeds scale them down.toadds a pose to drive to, here the reef in front of branch G.runAfteradds a command that runs after the drive, here scoring on L4.
In C++ the route keeps the pointer from score.get(), so score has to
outlive the route. Keep it as a member next to the route.
Java
import com.tempo.Alliance;
import com.tempo.Composer;
import com.tempo.Speed;
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
Composer scoreG = Composer
.startAt(new Pose2d(7.58, 4.03, Rotation2d.fromDegrees(180)))
.resetOdometry(true)
.originAlliance(Alliance.BLUE)
.speed(Speed.FULL)
.to(5.77, 3.86, Rotation2d.fromDegrees(180))
.runAfter(superstructure.scoreL4());Python
import math
from tempo import Alliance, Composer, Speed
from wpimath.geometry import Pose2d, Rotation2d
score_g = (Composer
.start_at(Pose2d(7.58, 4.03, Rotation2d.fromDegrees(180)))
.reset_odometry(True)
.origin_alliance(Alliance.BLUE)
.speed(Speed.FULL)
.to(5.77, 3.86, math.radians(180))
.run_after(superstructure.score_l4()))C++
#include <frc2/command/CommandPtr.h>
#include <tempo/Angles.h>
#include <tempo/Composer.h>
#include <tempo/wpi/Setlist.h>
frc2::CommandPtr score = superstructure.ScoreL4();
auto scoreG = tempo::Composer
::start_at(tempo::wpilib::Pose2d{
tempo::wpilib::units::meter_t{7.58},
tempo::wpilib::units::meter_t{4.03},
tempo::wpilib::units::degree_t{180}})
.reset_odometry(true)
.origin_alliance(tempo::Alliance::Blue)
.speed(tempo::Speed::Full)
.to(5.77, 3.86, tempo::angles::deg(180))
.run_after(score.get());Find a topic
Shape a route
Face a target or aim while drivingRotation →Stay inside or keep out of part of the fieldZones & regions →Cross a bump or rampTerrain crossings → Run mechanisms
Run an intake or shooter during a routeRun commands on a route →Let a vision align drive the last stretchHand off the arrival →Chain routes into one autoBuild an auto from routes →