Robot Simulation Setup Guide
This guide will help you set up a simulation environment to practice driving or operating our robot on your own computer.
Prerequisites
You’ll need:
- Xbox controller
- USB cable to connect controller to computer
- VSCode with WPILib and RobotPy library installed
- Python with pip
- AdvantageScope application
- Downloaded asset files for the simulation
Installation Steps
1. Clone the Repository
- Open VSCode
- Press
Ctrl+Shift+P
to open the command palette - Type “Git: Clone” and select it
- Enter the repository URL:
https://github.com/CtrlZ-FRC4096/Robot-2025
- Select a location to save the repository
2. Install Dependencies
Open a terminal in VSCode (Ctrl+Shift+
`) and run:
pip install shapely
3. Code Configuration
- Navigate to
subsystems/drivetrain
- Uncomment the shapely import line
- Uncomment the
in_reef
function
Setting Up AdvantageScope
- Open AdvantageScope
- Click the + symbol at the top right and select “3D Field”
- Click Help → Show Assets Folder
- Create a new folder called
Robot_Pozeidon
- Copy all provided asset files into this folder (except for “Sim Layout”)
- In AdvantageScope, click File → Import Layout
- Select the “Sim Layout” file and import it
Running the Simulation
- In VSCode, open a terminal and make sure you’re in the “robot” directory (not “Robot-2025”)
- Start the simulation - a window with a blue background should appear
- Go back to AdvantageScope
- Click File → Connect to Simulator
- In the 3D field view, you should see our robot
- On the right side, change the field from “evergreen” to “2025 reefscape welded”
Controller Setup
- In the simulator window, find the FMS dropdown
- Change “red 1” to “blue 2”
- Connect your Xbox controller via USB
- Under System Joysticks, you should see “Xbox Controller”
- Under Joysticks → Joystick[0] (driver 1), it should say “0: Xbox Controller”
- If not, drag and drop the Xbox Controller from System Joysticks to Joystick[0]
- Make sure “Map Gamepad” is checked
- Under Robot State, click “Teleop” to start
Usage Tips
- For a cleaner interface, hide the Network Tables publishers panel and the Poses panel
- To change camera positions, left click and then quickly right click
- Useful views: “driver station” and “orbit field”
- Control mappings can be found in
oi.py
(starting around line 210) or in this presentation (Driver for 1 Drive)- Look for lines starting with
@
that mentiondriver1
- Comments explain what each button does
- Look for lines starting with
- Note that manual scoring is not yet implemented in the simulation
- Instead of zeroing the gyro (not available in sim), use POV.down to clear scored coral
- You can practice swerve driving around obstacles (feature coming soon)
Happy practicing, and try not to break any virtual walls!