3.24 AdvantageScope
AdvantageScope can draw Tempo’s planned path over the robot’s pose on its 2D field.
Copy the AdvantageKit sink into your project and add
this line once, after Tempo.configure(...):
import com.tempo.logging.TempoLogging;
TempoLogging.everything("Tempo", new AdvantageKitSink()).apply();AdvantageKit records the keys under RealOutputs/Tempo/ (ReplayOutputs/Tempo/ in a replay).
Without AdvantageKit, pass the
NetworkTables sink the same way. Its keys are under
NT:/Tempo/, as in the figure.
Copy the NetworkTables sink into your project and
pass it to everything with the Tempo prefix once, after Tempo.configure(...).
from tempo.logging import TempoLogging
# network_tables_sink is the NetworkTables sink copied from Log Tempo state.
TempoLogging.everything("Tempo", network_tables_sink).apply()The call is
tempo::wpi::TempoLogging::everything("Tempo", std::make_shared<NetworkTablesSink>()).apply().
The keys are under NT:/Tempo/ in AdvantageScope.
Keys
The full list is in TempoLogging.
Tempo/Path(Pose2d[]) is the planned trajectory, sent on the first loop of a run and again each time the plan changes.Tempo/Pose(Pose2d) is the pose Tempo read this loop, and it’s only logged while a route runs.Tempo/PlannedPose(Pose2d) is where the plan expects the robot to be this loop.Tempo/Target(Pose2d) is the target of the current leg.Tempo/Zones/0,Tempo/Zones/1and so on (Pose2d[]) are closed outlines of what the current leg plans around.
Field view
- Connect AdvantageScope to the robot or the simulator, or open a log file.
- Open the 2D Field tab and pick the field image for the game pack you’re using.
- Drag
Tempo/Pathonto the field and show it as a trajectory. - Drag
Tempo/Poseonto the field as a robot. You can use the drivetrain’s own odometry key instead, and that one keeps logging after the route ends.
Tempo/Path keeps its last value until the next plan, so the field still shows the last route
after an auto ends.
Planned and actual pose
Add Tempo/PlannedPose as a ghost robot. The distance between it and Tempo/Pose is the
tracking error, and it’s also logged as Tempo/Error/X and Tempo/Error/Y, in meters, in
the robot frame.
To compare commanded and planned speed, plot Tempo/Speeds/Vx and Tempo/PlannedSpeeds/Vx on
a line graph.
Zones
Add Tempo/Zones/0 and the keys after it as trajectories. They draw the obstacles (the pack’s
and the route’s own), avoid zones, keep-in regions and terrain that the current leg plans around.
Tempo/Zones/Names lists them in the same order, each as kind:name.
If it fails…
No leg could be planned, so no path was sent. Check Tempo/GiveUps/Cause.
No sink was installed, or it was installed after the route started. apply() only affects routes that start after it.
Without a USB stick, DataLogManager writes to /home/lvuser/logs. Set AdvantageScope’s roboRIO log folder to that, or plug in a USB stick.