Class SimScript
java.lang.Object
frc.robot.SimScript
A scripted drive for the desktop simulation, so the localization testbed can be exercised (and
checked) without a driver: sit disabled so the Limelights seed the pose, then drive a lap of
straights, strafes and spins in teleop while every pose source is logged.
Opt-in only: set the environment variable FM_SIM_SCRIPT before ./gradlew
simulateJava. With it unset the sim behaves normally and takes a real Driver Station.
drive: the localization lap.shoot: aiming and launching, standing and on the move, then each set shot from its spot, with fuel put in the hopper before each launch. For the aim feedforward, the shot gate, the set shots and the shot log.chords: the pilot's LB + face-button chords pressed and let go in sloppy orders, standing still. ForModifierChords: readSuperStructure/WantedSuperState.auto:<chooser name>: one PathPlanner auto.
With FM_SIM_EXIT=1 as well, the program closes the log and exits once the script is
done, so a scripted run can be the whole of a command line. With
FM_SIM_REBOOT=Hood@9,IntakeExtension@12, those mechanisms' motors reboot at those script
seconds, as in a brownout. With FM_SIM_MATCH=Q12 (or P3, E5), the Driver
Station reports that FMS match, so the end of teleop writes the match summary file.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe script's two non-driver actions, as an AdvantageKit input so a replay of a scripted run performs them on the same loop (the driving itself is already replayed, through the logged Driver Station). -
Method Summary
-
Method Details
-
requested
public static boolean requested()Whether the script runs: requested in simulation, and always in replay. -
periodic
public static void periodic()Advances the script. Call fromsimulationPeriodic, in simulation (script requested) and in replay (so a replayed scripted run repeats the script's actions).
-