Simulation lets you run the full robot program on a laptop without any physical hardware. Spectrum’s simulation setup combines WPILib’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/spectrum3847/2026-Spectrum/llms.txt
Use this file to discover all available pages before exploring further.
Mechanism2d visualization, IronMaple’s REBUILT 2026 game physics, and PhotonVision’s camera simulation so that most robot behaviors — intake, launching, autonomous paths, and pose estimation — can be tested and debugged before touching the real robot.
Benefits of simulation-first development
- Start early. Programmers can write and test subsystem logic before the robot is assembled.
- Parallel workflows. Multiple team members can work on different subsystems simultaneously without competing for robot time.
- Catch logic errors early. A misrouted command or bad state transition is much cheaper to find in simulation than on the field.
- Safer iteration. Tuning trajectory or state machine logic in sim avoids damaging hardware.
IronMaple season physics
RobotSim.java uses two IronMaple classes specific to the REBUILT 2026 game:
| Class | Package | Purpose |
|---|---|---|
RebuiltFuelOnFly | org.ironmaple.simulation.seasonspecific.rebuilt2026 | Simulates fuel game pieces as projectiles with trajectory physics |
Arena2026Rebuilt (via SimulatedArena) | org.ironmaple.simulation.seasonspecific.rebuilt2026 | Provides the simulated field environment and game piece positions |
IntakeSimulation configured for the robot’s bumper geometry:
Launching fuel projectiles in simulation
When the robot fires in simulation,mapleSimCreateFuelProjectile() constructs a RebuiltFuelOnFly projectile using real shot parameters from ShotCalculator:
Telemetry.log.
Mechanism2d visualization
RobotSim builds a side-view (leftView) Mechanism2d canvas published to SmartDashboard under "Sim/LeftView". The robot chassis is drawn as a purple rectangle using chained MechanismLigament2d segments:
LinearSim, ArmSim, or RollerSim roots to leftView, so the complete mechanism assembly moves together in AdvantageScope or Elastic Dashboard.
SpectrumLib simulation classes
SpectrumLib provides three mechanism simulation classes used across subsystems:| Class | Simulates | Notes |
|---|---|---|
LinearSim | Elevator or linear extension | Tracks position against motor state |
ArmSim | Rotating arm | Uses angle and gravity compensation |
RollerSim | Spinning roller or wheel | Displays direction and relative velocity |
PhotonVision camera simulation
VisionSystem.java registers PhotonCameraSim instances with a VisionSystemSim and calls visionSim.update(pose) every simulation cycle. This lets the vision pipeline produce realistic AprilTag detections based on the simulated robot pose. See the vision systems page for full details.
Running simulation
Open the project in VS Code
Ensure the WPILib extension is installed and the project builds without errors.
Launch simulation
Press Ctrl+Shift+P and run WPILib: Simulate Robot Code, or click the WPILib icon and select Simulate Robot Code.
Connect a driver station
Open the FRC Driver Station (or use the simulated DS). Enable the robot in autonomous or teleop to trigger the relevant init methods.
What simulation covers and does not cover
| Covered | Not covered |
|---|---|
| Command scheduling and state machine logic | Real motor torque and electrical behavior |
| PathPlanner path following | Sensor drift and encoder noise |
| IronMaple fuel projectile physics | Vision accuracy on real field lighting |
| PhotonVision AprilTag detections | Mechanical compliance and friction |
| Telemetry and log output | CAN bus latency and brownouts |
Vision systems
PhotonVision camera simulation and AprilTag field layout configuration.
Logging and telemetry
How simulation shot trajectories and mechanism states are captured in logs.
