Team 4973's code for the 2026 "Rebuilt" FRC game, using RobotPy & CTRE Hardware.
- 0 through 5: Misc Devices (PDH [0], IMU [2])
- 6 through 9: Swerve Turn Motors
- 10 through 13: Swerve CANCoders
- 16 through 19: Swerve Drive Motors
- 30 through 35: Arm/Intake/Shooter
| Control | Action |
|---|---|
| Left stick | Drive (field-centric X/Y velocity) |
| Right stick X | Rotation |
| A button (hold) | Brake mode |
| B button (hold) | Point wheels at joystick direction |
| X | Reset field-centric heading |
uv manages Python and dependencies automatically - no global installs needed.
# Install uv (one time)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Run simulation (uv installs dependencies automatically)
uv run python -m robotpy simIf you prefer using system Python directly:
# Install dependencies
pip install robotpy[commands2,sim] phoenix6
# Run simulation
python3 -m robotpy sim- Run:
uv run python -m robotpy sim(orpython3 -m robotpy simif using pip) - The simulation GUI opens
- In the GUI:
- Go to Joysticks panel
- Map a virtual joystick to port 0
- Enable Teleop mode
- Test the controls:
- Use left stick to drive
- Use right stick to rotate
- Press A to brake
When connected to the robot (via WiFi or USB):
# Using uv:
uv run python -m robotpy sync # First time: sync dependencies to roboRIO
uv run python -m robotpy deploy # Deploy code
# Or using pip:
python3 -m robotpy sync
python3 -m robotpy deployThen in Driver Station:
- Connect to robot
- Enable Teleop
- Test controls
# Using uv:
uv run python -m robotpy test
# Or using pip:
python3 -m robotpy testSimulation won't start:
- If using uv: try
uv sync --refreshto reinstall dependencies - If using pip: reinstall with
pip install --force-reinstall robotpy[commands2,sim] phoenix6 - Check Python version:
python3 --version(need 3.12+)
Robot not responding in simulation:
- Check the Joysticks panel - make sure a joystick is mapped to port 0
- Make sure Teleop is enabled (not Disabled or Autonomous)
Deploy fails:
- Make sure you're connected to the robot network
- Run sync first:
uv run python -m robotpy sync(orpython3 -m robotpy sync)