Skip to Content
getting-starteddevelopment-environment

Last Updated: 3/9/2026


Development Environment

This guide covers IDE setup, tools, and best practices for developing the BREAD5940 2025 FRC robot code.

VS Code Configuration

WPILib VS Code

The project uses the WPILib-customized version of VS Code, which includes:

  • Java language support
  • WPILib command palette integration
  • Gradle build integration
  • Robot deployment tools
  • Simulation launcher

While WPILib VS Code includes essential extensions, consider adding:

  1. Extension Pack for Java (if not included)

    • Enhanced Java IntelliSense
    • Debugging support
    • Test runner
  2. Gradle for Java

    • Gradle task visualization
    • Build script editing
  3. GitLens

    • Advanced Git integration
    • Blame annotations
    • Commit history

Workspace Settings

The project includes .vscode/ configuration:

{ "java.configuration.updateBuildConfiguration": "automatic", "java.server.launchMode": "Standard", "files.exclude": { "**/.git": true, "**/.gradle": true, "**/build": true, "**/bin": true } }

Building and Deploying

WPILib Commands

Access via Ctrl+Shift+P (or Cmd+Shift+P on Mac):

Build Commands:

  • WPILib: Build Robot Code - Compile the project
  • WPILib: Clean Robot Code - Delete build artifacts
  • WPILib: Test Robot Code - Run unit tests

Deploy Commands:

  • WPILib: Deploy Robot Code - Deploy to RoboRIO
  • WPILib: Deploy Robot Code (Debug) - Deploy with debugging enabled

Simulation Commands:

  • WPILib: Simulate Robot Code - Launch robot simulator
  • WPILib: Simulate Robot Code (Debug) - Launch simulator with debugger

Gradle Tasks

View available Gradle tasks in VS Code:

  1. Open Gradle sidebar (elephant icon)
  2. Expand project tasks:
    • build tasks - build, clean, assemble
    • deploy tasks - deploy
    • test tasks - test

Command Line Alternatives

# Build ./gradlew build # Clean build ./gradlew clean build # Deploy to robot ./gradlew deploy # Run tests ./gradlew test # Simulate ./gradlew simulateJava

Robot Simulation

Starting Simulation

  1. Press Ctrl+Shift+P
  2. Select WPILib: Simulate Robot Code
  3. Choose simulation type: Desktop
  4. Simulation GUI launches

Simulation Components

Driver Station Simulation:

  • Enable/disable robot
  • Switch modes (Teleop, Auto, Test)
  • Select autonomous routine
  • View joystick inputs

Robot GUI:

  • Visualize subsystem states
  • View NetworkTables values
  • Monitor motors and sensors
  • Display field position

AdvantageScope Integration:

  • Logs generated in simulation
  • Real-time telemetry viewing
  • Replay simulation runs

Simulation Limitations

Not Simulated:

  • Physical hardware interactions
  • Vision processing (cameras)
  • Actual motor behavior
  • Network latency

Simulated:

  • Command scheduling
  • State machines
  • Path following
  • Basic kinematics

Debugging

Debugging on RoboRIO

  1. Deploy code in debug mode:
    • WPILib: Deploy Robot Code (Debug)
  2. VS Code attaches debugger automatically
  3. Set breakpoints in code
  4. Use debug console for variable inspection

Debugging in Simulation

  1. Launch simulation in debug mode:
    • WPILib: Simulate Robot Code (Debug)
  2. Debugger attaches to simulation process
  3. Full debugging capabilities available

Debug Tips

Breakpoints:

  • Click left margin to set breakpoints
  • Conditional breakpoints: Right-click breakpoint
  • Logpoints: Print without stopping execution

Watch Variables:

  • Add variables to Watch panel
  • Evaluate expressions in Debug Console
  • Inspect object hierarchies

Call Stack:

  • View execution path
  • Navigate between stack frames
  • Identify where exceptions occur

Logging with AdvantageKit

Log File Locations

On RoboRIO:

  • Logs saved to USB drive: /U/logs/
  • Insert USB drive before powering on robot
  • Logs written in WPILog format

In Simulation:

  • Logs saved to project directory
  • Path displayed in console output

Viewing Logs

AdvantageScope:

  1. Download from GitHub 
  2. Open log file (.wpilog)
  3. Explore telemetry data:
    • Subsystem states
    • Motor outputs
    • Sensor readings
    • Field position
    • Command scheduling

NetworkTables (Live):

  • Use WPILib’s Glass or Shuffleboard
  • Connect to robot (10.59.40.2 or 172.22.11.2)
  • View real-time data

Adding Custom Logging

import org.littletonrobotics.junction.Logger; // Log a value Logger.recordOutput("Subsystem/Value", value); // Log a pose Logger.recordOutput("Swerve/Pose", swerve.getPose()); // Log an array Logger.recordOutput("Swerve/ModuleStates", moduleStates);

Testing

Unit Tests

The project uses JUnit 5 for testing.

Run Tests:

./gradlew test

Test Reports:

  • Generated in build/reports/tests/test/index.html
  • Open in browser to view results

Writing Tests:

import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; class SubsystemTest { @Test void testInitialization() { // Test code assertEquals(expected, actual); } }

Code Quality Tools

Spotless (Code Formatting)

The project includes Spotless for code formatting (currently commented out in build.gradle).

To enable:

  1. Uncomment Spotless configuration in build.gradle
  2. Run: ./gradlew spotlessApply

Format Code:

# Check formatting ./gradlew spotlessCheck # Apply formatting ./gradlew spotlessApply

Manual Formatting

In VS Code:

  • Shift+Alt+F (Windows/Linux)
  • Shift+Option+F (Mac)

Vendor Configuration Tools

Phoenix Tuner X

Purpose: Configure CTRE motor controllers and sensors

Usage:

  1. Download from CTRE 
  2. Connect to robot via USB or WiFi
  3. Configure motor IDs, inversions, limits
  4. Generate TunerConstants.java for swerve

PathPlanner

Purpose: Create and edit autonomous paths

Usage:

  1. Download from PathPlanner 
  2. Open project directory
  3. Edit paths in src/main/deploy/pathplanner/paths/
  4. Paths automatically loaded by robot code

PhotonVision

Purpose: Configure vision cameras

Usage:

  1. Access via web browser: http://photonvision.local:5800
  2. Configure pipelines for AprilTags
  3. Calibrate cameras
  4. Test vision processing

Version Control with Git

Common Git Workflows

Clone Repository:

git clone https://github.com/BREAD5940/2025-Public.git

Create Feature Branch:

git checkout -b feature/my-feature

Commit Changes:

git add . git commit -m "Descriptive commit message"

Push to Remote:

git push origin feature/my-feature

Pull Latest Changes:

git pull origin main

Git Best Practices

  1. Commit frequently - Small, logical commits
  2. Write clear messages - Explain what and why
  3. Pull before pushing - Avoid merge conflicts
  4. Use branches - Keep main branch stable
  5. Review changes - Use git diff before committing

Performance Monitoring

Loop Timing

Monitor robot loop timing:

Logger.recordOutput("Robot/LoopTime", Timer.getFPGATimestamp());

Target: 20ms loop time (50 Hz) Warning: Loops over 20ms indicate performance issues

NetworkTables Bandwidth

  • Minimize large data publishing
  • Use SmartDashboard.putBoolean() for simple values
  • Avoid sending large arrays at high frequency

Troubleshooting

VS Code Issues

Issue: Java language server crashes

  • Solution: Reload window (Ctrl+Shift+P → “Reload Window”)
  • Delete .vscode folder and restart

Issue: Gradle sync fails

  • Solution: Delete .gradle and build folders
  • Run ./gradlew clean build

Build Issues

Issue: “Could not resolve dependencies”

  • Solution: Check internet connection
  • Verify vendordeps/ files are valid JSON
  • Update vendor libraries

Issue: “Main class not found”

  • Solution: Verify ROBOT_MAIN_CLASS in build.gradle
  • Ensure Main.java exists

Next Steps

Additional Resources