Skip to content
learnFRC.org
programminglesson25 min

Desktop Simulation Setup

Launching WPILib SimGUI, configuring virtual Xbox controllers, and verifying robot code execution without physical hardware.

What you will learn

  • Launch WPILib SimGUI from VS Code without physical robot hardware.
  • Map physical USB gamepads and virtual joystick controls in the simulator.
  • Test autonomous routines and teleoperated drive commands in software simulation.

Prerequisites:Tooling Installation

Testing code exclusively on physical hardware creates a bottleneck: battery voltage drops, mechanisms suffer mechanical wear, and a bug in a control loop can damage hardware.

WPILib includes a desktop simulation engine that runs robot code natively on Windows, macOS, and Linux, complete with simulated physics and graphical debugging.


Robot code can be run directly on your development machine using WPILib’s simulation tools:

  1. Open your robot project in WPILib VS Code.
  2. Press F5 or open the Command Palette and run:
    WPILib: Simulate Robot Code on Desktop
  3. A prompt will appear asking for simulation extensions. Check SimGUI and click OK.
  4. The WPILib Simulation GUI window will open on your desktop.

The SimGUI consists of several modular windows:

  1. Robot State: Located at the top left. Allows toggling between Disabled, Autonomous, Teleoperated, and Test modes, mimicking the physical Driver Station.
  2. System Joysticks: Displays physical USB gamepads connected to your laptop.
  3. Joysticks (DS): The virtual joystick slots (0 through 5) exposed to your code’s CommandXboxController or Joystick objects.
  4. Timing: Shows loop execution timing (target 20 ms loop period).
  5. NetworkTables: Real-time tree view of all variables published by subsystems and telemetry routines.

To test driver controls without physical hardware:

  1. Under the System Joysticks pane, find your connected gamepad (e.g. Xbox Controller or DualShock).
  2. Drag the device from System Joysticks into the Joysticks -> 0 slot.
  3. If no physical gamepad is available, use Keyboard 0 to map keyboard keys to buttons and joystick axes.
Mechanism2d Windows

When your code includes WPILib physics simulation (like an elevator or arm), open NetworkTables -> SmartDashboard -> Field or Mechanism2d from the top menu to view 2D graphical animations of your mechanism moving in real time.


  • Symptom: Terminal reports simulation completed or exited immediately without opening a window.
  • Cause: SimGUI extension was unchecked, or graphics drivers do not support OpenGL 3.3.
  • Fix: Re-run simulation and ensure SimGUI is checked in the extension selector.
  • Symptom: Code runs in Teleop mode, but pressing buttons produces no response.
  • Cause: The gamepad is listed under System Joysticks but was not dragged into Joysticks -> 0.
  • Fix: Drag the controller from the system list into slot 0.

  1. Launch simulation (F5).
  2. In the Robot State window, switch mode from Disabled to Teleoperated.
  3. Press buttons on your controller or keyboard and observe state changes in the NetworkTables viewer.
  4. Switch mode back to Disabled and close the simulation window.

Verified Sources & Standards

Evergreen Standard Verified: Sep 25, 2026