From 686494bdaf14bfb854ffee5b5c964db130ff249d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 18:26:35 +0000 Subject: [PATCH 1/5] Initial plan From 2e4028b735c84660448d0e53a7fb169983a59026 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 18:30:05 +0000 Subject: [PATCH 2/5] Add comprehensive documentation for Robot Simulator and AdvantageScope Co-authored-by: TaylerUva <8679670+TaylerUva@users.noreply.github.com> --- Software/Simulator and AdvantageScope.md | 205 +++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 Software/Simulator and AdvantageScope.md diff --git a/Software/Simulator and AdvantageScope.md b/Software/Simulator and AdvantageScope.md new file mode 100644 index 00000000..ef28c658 --- /dev/null +++ b/Software/Simulator and AdvantageScope.md @@ -0,0 +1,205 @@ +# Robot Simulator and AdvantageScope + +This guide explains what robot simulation and AdvantageScope are, how they differ, and how to connect them for testing and debugging your robot code. + +--- + +## What is Robot Simulation (Sim)? + +Robot simulation is a feature built into WPILib that allows you to test your robot code without having access to a physical robot. The simulator runs your robot code on your computer and simulates robot hardware, sensors, and actuators. + +### Key Features of Simulation: +- **Test Without Hardware**: Run and debug your code without needing the actual robot +- **Rapid Iteration**: Make code changes and test them immediately without deploying to hardware +- **Safe Testing**: Test dangerous or complex scenarios without risking damage to the robot +- **Physics Simulation**: Simulates robot physics including drivetrain movement, motor behavior, and sensor readings +- **Built into WPILib**: Integrated directly into VS Code with the WPILib extension + +### When to Use Simulation: +- During early development before the robot is built +- Testing autonomous routines and path following +- Debugging sensor logic and state machines +- Training new programmers without requiring robot access +- Verifying code changes before deploying to the real robot + +--- + +## What is AdvantageScope? + +AdvantageScope is a powerful log viewer and visualization tool specifically designed for FRC robots. It allows you to view telemetry data, analyze robot behavior, and visualize your robot in 3D. + +### Key Features of AdvantageScope: +- **Real-time Data Visualization**: View live data from your robot or simulator +- **3D Robot Visualization**: See your robot's position, orientation, and mechanisms in 3D space +- **Swerve Drive Display**: Visualize swerve module states and trajectories +- **Data Logging & Replay**: Record and replay robot sessions for analysis +- **Field Visualization**: View robot position on the FRC field +- **Graph Plotting**: Plot sensor values, motor outputs, and other telemetry over time +- **NetworkTables Integration**: Connects to your robot via NetworkTables + +### When to Use AdvantageScope: +- Debugging robot behavior during testing +- Verifying swerve offsets (swoffsets) +- Analyzing autonomous routines and paths +- Visualizing sensor data and state changes +- Reviewing recorded matches or test sessions + +--- + +## Simulator vs AdvantageScope: Which is Which? + +It's important to understand the difference between these two tools: + +| Feature | Robot Simulator (Sim) | AdvantageScope | +|---------|----------------------|----------------| +| **Purpose** | Runs robot code without hardware | Visualizes and analyzes robot data | +| **Built Into** | WPILib / VS Code | Standalone application | +| **Primary Use** | Testing code execution and logic | Viewing telemetry and debugging | +| **3D Visualization** | Basic physics simulation | Advanced 3D robot visualization | +| **Connection** | Runs your robot code locally | Connects to robot or simulator via NetworkTables | +| **When to Use** | Before hardware is ready or for safe testing | When debugging and analyzing robot behavior | + +**Simple Analogy**: +- **Simulator** is like running your code in a "practice mode" - it executes your robot program without needing real hardware +- **AdvantageScope** is like a "dashboard" - it shows you what your robot (real or simulated) is doing and displays telemetry data + +**You can use them together!** Run your code in the simulator and use AdvantageScope to visualize what the simulated robot is doing. + +--- + +## How to Connect Simulator in AdvantageScope + +### Prerequisites +- WPILib installed on your computer +- AdvantageScope installed ([download here](https://github.com/Mechanical-Advantage/AdvantageScope/releases)) +- A robot code project + +### Steps to Connect + +#### 1. Start the Robot Simulator +1. Open your robot code project in VS Code +2. Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac) to open the command palette +3. Type `WPILib: Simulate Robot Code` and select it +4. Choose the desktop GUI option when prompted +5. Wait for the simulation to start - you should see the Robot Simulation GUI window + +> **Note**: Screenshot showing the Robot Simulator GUI window should be added here once captured + +#### 2. Open AdvantageScope +1. Launch AdvantageScope on your computer +2. The application will open to the main interface + +#### 3. Connect to the Simulator +1. In AdvantageScope, click on the **connection icon** in the top-left corner (looks like a plug/connection symbol) +2. Select **Simulator** or **localhost** as the connection type +3. The default address should be `localhost` or `127.0.0.1` +4. Click **Connect** +5. You should see a green indicator showing that AdvantageScope is connected + +#### 4. Visualize Your Data +1. Navigate to the **3D Field** tab to see your robot on the field +2. Use the **Swerve** tab to view swerve drive states (if applicable) +3. Drag NetworkTables keys from the left panel to graphs or displays +4. Enable your robot in the Simulator GUI and start testing! + +### Troubleshooting Simulator Connection +- **AdvantageScope can't connect**: Make sure the simulator is running before connecting +- **No data appearing**: Verify your code is publishing data to NetworkTables +- **Simulator won't start**: Check that WPILib is properly installed and your code builds successfully + +--- + +## How to Connect Robot to AdvantageScope + +Connecting to a real robot is similar to connecting to the simulator, but uses your robot's IP address instead of localhost. + +### Prerequisites +- Robot is powered on and connected to your network +- FRC Driver Station is connected to the robot +- AdvantageScope installed on your laptop +- Your computer is on the same network as the robot + +### Steps to Connect + +#### 1. Verify Robot Connection +1. Open FRC Driver Station +2. Ensure the Driver Station shows a connection to the robot (green indicator) +3. Note your robot's team number (e.g., 3255 for Team 3255) + +#### 2. Open AdvantageScope +1. Launch AdvantageScope on your computer + +#### 3. Connect to the Robot +1. Click on the **connection icon** in the top-left corner +2. Select **Robot** or **Team Number** as the connection type +3. Enter your team number (e.g., `3255`) + - AdvantageScope will automatically calculate the robot's IP address: `10.TE.AM.2` (e.g., `10.32.55.2` for team 3255) + - Alternatively, you can manually enter the IP address +4. Click **Connect** +5. You should see a green indicator when connected successfully + +#### 4. View Live Robot Data +1. Navigate to the **3D Field** tab to see your robot's live position +2. Use the **Swerve** tab to verify swerve module alignment and offsets +3. Create custom graphs to monitor sensor values, motor outputs, and more +4. Enable your robot via Driver Station and start testing! + +### Connection Options + +**Team Number Connection** (Recommended): +- Enter your team number: `3255` +- AdvantageScope automatically resolves to: `10.32.55.2` + +**Direct IP Connection**: +- Robot over USB: `172.22.11.2` +- Robot over WiFi: `10.TE.AM.2` (e.g., `10.32.55.2`) + +**mDNS Connection**: +- Use `roboRIO-3255-FRC.local` (replace 3255 with your team number) +- May not work on all networks + +### Troubleshooting Robot Connection +- **Can't connect**: Verify FRC Driver Station is connected first +- **Connection drops**: Check WiFi signal strength and network stability +- **Wrong data**: Make sure you deployed the latest code to the robot +- **No 3D model**: Ensure your robot code is publishing pose data to NetworkTables and that your CAD models are properly configured (see [UpdateCAD.md](UpdateCAD.md)) + +--- + +## NetworkTables Keys for AdvantageScope + +To use AdvantageScope effectively, your robot code needs to publish data to NetworkTables. Common keys to publish: + +- **Robot Pose**: `SmartDashboard/Field/Robot` - 3D position for field visualization +- **Swerve States**: `AdvantageKit/Drive/ModuleStates` - Module positions and velocities +- **Autonomous Path**: Trajectory data for path visualization +- **Sensor Values**: Any sensor readings you want to monitor +- **Motor Outputs**: Current, voltage, and velocity data + +Refer to your robot code's NetworkTables configuration for specific key names. + +--- + +## Additional Resources + +- [WPILib Robot Simulation Documentation](https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/robot-simulation/introduction.html) +- [AdvantageScope Documentation](https://docs.advantagescope.org) +- [AdvantageScope GitHub Repository](https://github.com/Mechanical-Advantage/AdvantageScope) +- [Update CAD for Simulation](UpdateCAD.md) - Guide for configuring 3D robot models + +--- + +## Quick Reference + +**Starting Simulator:** +1. VS Code → `Ctrl+Shift+P` → "WPILib: Simulate Robot Code" +2. Open AdvantageScope → Connect to `localhost` + +**Connecting to Robot:** +1. Power on robot and connect Driver Station +2. Open AdvantageScope → Connect to team number or `10.TE.AM.2` + +**Common Issues:** +- Connection fails → Check Driver Station is connected first +- No 3D model → Verify CAD models are exported and config.json is set up +- No data → Verify NetworkTables keys are being published by your code From aa7e174afe8c3f5b906811b70b39fdee85577c3f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 18:31:10 +0000 Subject: [PATCH 3/5] Address code review feedback - clarify NetworkTables keys and remove placeholder note Co-authored-by: TaylerUva <8679670+TaylerUva@users.noreply.github.com> --- Software/Simulator and AdvantageScope.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Software/Simulator and AdvantageScope.md b/Software/Simulator and AdvantageScope.md index ef28c658..1a4998c5 100644 --- a/Software/Simulator and AdvantageScope.md +++ b/Software/Simulator and AdvantageScope.md @@ -83,8 +83,6 @@ It's important to understand the difference between these two tools: 4. Choose the desktop GUI option when prompted 5. Wait for the simulation to start - you should see the Robot Simulation GUI window -> **Note**: Screenshot showing the Robot Simulator GUI window should be added here once captured - #### 2. Open AdvantageScope 1. Launch AdvantageScope on your computer 2. The application will open to the main interface @@ -168,15 +166,18 @@ Connecting to a real robot is similar to connecting to the simulator, but uses y ## NetworkTables Keys for AdvantageScope -To use AdvantageScope effectively, your robot code needs to publish data to NetworkTables. Common keys to publish: +To use AdvantageScope effectively, your robot code needs to publish data to NetworkTables. The specific key names depend on your robot code implementation, but common data types to publish include: -- **Robot Pose**: `SmartDashboard/Field/Robot` - 3D position for field visualization -- **Swerve States**: `AdvantageKit/Drive/ModuleStates` - Module positions and velocities +- **Robot Pose**: Field position and orientation for 3D visualization (key path varies by implementation) + - Example: `SmartDashboard/Field/Robot` or custom pose keys +- **Swerve States**: Module positions and velocities for swerve visualization + - Example for AdvantageKit: `AdvantageKit/Drive/ModuleStates` + - Example for custom implementations: Check your drivetrain subsystem's NetworkTables output - **Autonomous Path**: Trajectory data for path visualization - **Sensor Values**: Any sensor readings you want to monitor - **Motor Outputs**: Current, voltage, and velocity data -Refer to your robot code's NetworkTables configuration for specific key names. +**Note**: The exact NetworkTables key paths will vary based on your team's code structure and logging framework (e.g., AdvantageKit, custom telemetry). Refer to your robot code's NetworkTables configuration or logging setup for the specific key names used by your implementation. --- From 1ed06abc973ec86cf9ddf60c302909baa67912e3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 16:14:40 +0000 Subject: [PATCH 4/5] Address review feedback: move Quick Reference to top, fix AdvantageScope opening method, correct connection instructions, remove redundant sections Co-authored-by: TaylerUva <8679670+TaylerUva@users.noreply.github.com> --- Software/Simulator and AdvantageScope.md | 113 ++++++++--------------- 1 file changed, 41 insertions(+), 72 deletions(-) diff --git a/Software/Simulator and AdvantageScope.md b/Software/Simulator and AdvantageScope.md index 1a4998c5..a8069737 100644 --- a/Software/Simulator and AdvantageScope.md +++ b/Software/Simulator and AdvantageScope.md @@ -2,7 +2,22 @@ This guide explains what robot simulation and AdvantageScope are, how they differ, and how to connect them for testing and debugging your robot code. ---- +## Quick Reference + +**Starting Simulator:** +1. VS Code → `Ctrl+Shift+P` → "WPILib: Simulate Robot Code" +2. Open AdvantageScope → `Ctrl+Shift+P` → "WPILib: Start Tool" → "AdvantageScope" +3. In AdvantageScope, connect to NetworkTables using the address `localhost` + +**Connecting to Robot:** +1. Power on robot and connect Driver Station +2. Open AdvantageScope → `Ctrl+Shift+P` → "WPILib: Start Tool" → "AdvantageScope" +3. In AdvantageScope, connect to NetworkTables using your team number (e.g., `3255`) + +**Common Issues:** +- Connection fails → Check Driver Station is connected first +- No 3D model → Verify CAD models are exported and config.json is set up +- No data → Verify NetworkTables keys are being published by your code ## What is Robot Simulation (Sim)? @@ -12,18 +27,14 @@ Robot simulation is a feature built into WPILib that allows you to test your rob - **Test Without Hardware**: Run and debug your code without needing the actual robot - **Rapid Iteration**: Make code changes and test them immediately without deploying to hardware - **Safe Testing**: Test dangerous or complex scenarios without risking damage to the robot -- **Physics Simulation**: Simulates robot physics including drivetrain movement, motor behavior, and sensor readings - **Built into WPILib**: Integrated directly into VS Code with the WPILib extension ### When to Use Simulation: - During early development before the robot is built - Testing autonomous routines and path following - Debugging sensor logic and state machines -- Training new programmers without requiring robot access - Verifying code changes before deploying to the real robot ---- - ## What is AdvantageScope? AdvantageScope is a powerful log viewer and visualization tool specifically designed for FRC robots. It allows you to view telemetry data, analyze robot behavior, and visualize your robot in 3D. @@ -39,13 +50,10 @@ AdvantageScope is a powerful log viewer and visualization tool specifically desi ### When to Use AdvantageScope: - Debugging robot behavior during testing -- Verifying swerve offsets (swoffsets) - Analyzing autonomous routines and paths - Visualizing sensor data and state changes - Reviewing recorded matches or test sessions ---- - ## Simulator vs AdvantageScope: Which is Which? It's important to understand the difference between these two tools: @@ -55,7 +63,7 @@ It's important to understand the difference between these two tools: | **Purpose** | Runs robot code without hardware | Visualizes and analyzes robot data | | **Built Into** | WPILib / VS Code | Standalone application | | **Primary Use** | Testing code execution and logic | Viewing telemetry and debugging | -| **3D Visualization** | Basic physics simulation | Advanced 3D robot visualization | +| **Visualization** | Raw NetworkTables Data | Advanced 3D robot visualization | | **Connection** | Runs your robot code locally | Connects to robot or simulator via NetworkTables | | **When to Use** | Before hardware is ready or for safe testing | When debugging and analyzing robot behavior | @@ -65,13 +73,10 @@ It's important to understand the difference between these two tools: **You can use them together!** Run your code in the simulator and use AdvantageScope to visualize what the simulated robot is doing. ---- - ## How to Connect Simulator in AdvantageScope ### Prerequisites - WPILib installed on your computer -- AdvantageScope installed ([download here](https://github.com/Mechanical-Advantage/AdvantageScope/releases)) - A robot code project ### Steps to Connect @@ -84,37 +89,35 @@ It's important to understand the difference between these two tools: 5. Wait for the simulation to start - you should see the Robot Simulation GUI window #### 2. Open AdvantageScope -1. Launch AdvantageScope on your computer -2. The application will open to the main interface +1. Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac) to open the command palette +2. Type `WPILib: Start Tool` and select it +3. Select `AdvantageScope` from the list of tools +4. AdvantageScope will launch #### 3. Connect to the Simulator -1. In AdvantageScope, click on the **connection icon** in the top-left corner (looks like a plug/connection symbol) -2. Select **Simulator** or **localhost** as the connection type -3. The default address should be `localhost` or `127.0.0.1` -4. Click **Connect** -5. You should see a green indicator showing that AdvantageScope is connected +1. In AdvantageScope, look for the connection settings in the left sidebar +2. Under "Live Sources", select **NetworkTables** +3. Enter the address `localhost` or `127.0.0.1` +4. The connection should establish automatically +5. You should see NetworkTables data appearing in the left panel #### 4. Visualize Your Data 1. Navigate to the **3D Field** tab to see your robot on the field -2. Use the **Swerve** tab to view swerve drive states (if applicable) -3. Drag NetworkTables keys from the left panel to graphs or displays -4. Enable your robot in the Simulator GUI and start testing! +2. Drag NetworkTables keys from the left panel to graphs or displays +3. Enable your robot in the Simulator GUI and start testing! ### Troubleshooting Simulator Connection - **AdvantageScope can't connect**: Make sure the simulator is running before connecting - **No data appearing**: Verify your code is publishing data to NetworkTables - **Simulator won't start**: Check that WPILib is properly installed and your code builds successfully ---- - ## How to Connect Robot to AdvantageScope -Connecting to a real robot is similar to connecting to the simulator, but uses your robot's IP address instead of localhost. +Connecting to a real robot is similar to connecting to the simulator, but uses your robot's team number or IP address. ### Prerequisites - Robot is powered on and connected to your network - FRC Driver Station is connected to the robot -- AdvantageScope installed on your laptop - Your computer is on the same network as the robot ### Steps to Connect @@ -125,36 +128,23 @@ Connecting to a real robot is similar to connecting to the simulator, but uses y 3. Note your robot's team number (e.g., 3255 for Team 3255) #### 2. Open AdvantageScope -1. Launch AdvantageScope on your computer +1. Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac) to open the command palette +2. Type `WPILib: Start Tool` and select it +3. Select `AdvantageScope` from the list of tools #### 3. Connect to the Robot -1. Click on the **connection icon** in the top-left corner -2. Select **Robot** or **Team Number** as the connection type -3. Enter your team number (e.g., `3255`) - - AdvantageScope will automatically calculate the robot's IP address: `10.TE.AM.2` (e.g., `10.32.55.2` for team 3255) - - Alternatively, you can manually enter the IP address -4. Click **Connect** -5. You should see a green indicator when connected successfully +1. In AdvantageScope, look for the connection settings in the left sidebar +2. Under "Live Sources", select **NetworkTables** +3. Enter your team number (e.g., `3255`) or the robot's IP address + - By team number: AdvantageScope will automatically calculate the IP address `10.TE.AM.2` (e.g., `10.32.55.2` for team 3255) + - Direct IP: `172.22.11.2` (USB) or `10.TE.AM.2` (WiFi) +4. The connection should establish automatically +5. You should see NetworkTables data appearing in the left panel #### 4. View Live Robot Data 1. Navigate to the **3D Field** tab to see your robot's live position -2. Use the **Swerve** tab to verify swerve module alignment and offsets -3. Create custom graphs to monitor sensor values, motor outputs, and more -4. Enable your robot via Driver Station and start testing! - -### Connection Options - -**Team Number Connection** (Recommended): -- Enter your team number: `3255` -- AdvantageScope automatically resolves to: `10.32.55.2` - -**Direct IP Connection**: -- Robot over USB: `172.22.11.2` -- Robot over WiFi: `10.TE.AM.2` (e.g., `10.32.55.2`) - -**mDNS Connection**: -- Use `roboRIO-3255-FRC.local` (replace 3255 with your team number) -- May not work on all networks +2. Create custom graphs to monitor sensor values, motor outputs, and more +3. Enable your robot via Driver Station and start testing! ### Troubleshooting Robot Connection - **Can't connect**: Verify FRC Driver Station is connected first @@ -162,8 +152,6 @@ Connecting to a real robot is similar to connecting to the simulator, but uses y - **Wrong data**: Make sure you deployed the latest code to the robot - **No 3D model**: Ensure your robot code is publishing pose data to NetworkTables and that your CAD models are properly configured (see [UpdateCAD.md](UpdateCAD.md)) ---- - ## NetworkTables Keys for AdvantageScope To use AdvantageScope effectively, your robot code needs to publish data to NetworkTables. The specific key names depend on your robot code implementation, but common data types to publish include: @@ -179,28 +167,9 @@ To use AdvantageScope effectively, your robot code needs to publish data to Netw **Note**: The exact NetworkTables key paths will vary based on your team's code structure and logging framework (e.g., AdvantageKit, custom telemetry). Refer to your robot code's NetworkTables configuration or logging setup for the specific key names used by your implementation. ---- - ## Additional Resources - [WPILib Robot Simulation Documentation](https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/robot-simulation/introduction.html) - [AdvantageScope Documentation](https://docs.advantagescope.org) - [AdvantageScope GitHub Repository](https://github.com/Mechanical-Advantage/AdvantageScope) - [Update CAD for Simulation](UpdateCAD.md) - Guide for configuring 3D robot models - ---- - -## Quick Reference - -**Starting Simulator:** -1. VS Code → `Ctrl+Shift+P` → "WPILib: Simulate Robot Code" -2. Open AdvantageScope → Connect to `localhost` - -**Connecting to Robot:** -1. Power on robot and connect Driver Station -2. Open AdvantageScope → Connect to team number or `10.TE.AM.2` - -**Common Issues:** -- Connection fails → Check Driver Station is connected first -- No 3D model → Verify CAD models are exported and config.json is set up -- No data → Verify NetworkTables keys are being published by your code From be028b4025d5a3e3265f88ff1afb6a06d3a5a6fd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 16:15:19 +0000 Subject: [PATCH 5/5] Add Mac keyboard shortcuts to Quick Reference section Co-authored-by: TaylerUva <8679670+TaylerUva@users.noreply.github.com> --- Software/Simulator and AdvantageScope.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Software/Simulator and AdvantageScope.md b/Software/Simulator and AdvantageScope.md index a8069737..3ef22d44 100644 --- a/Software/Simulator and AdvantageScope.md +++ b/Software/Simulator and AdvantageScope.md @@ -5,13 +5,13 @@ This guide explains what robot simulation and AdvantageScope are, how they diffe ## Quick Reference **Starting Simulator:** -1. VS Code → `Ctrl+Shift+P` → "WPILib: Simulate Robot Code" -2. Open AdvantageScope → `Ctrl+Shift+P` → "WPILib: Start Tool" → "AdvantageScope" +1. VS Code → `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac) → "WPILib: Simulate Robot Code" +2. Open AdvantageScope → `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac) → "WPILib: Start Tool" → "AdvantageScope" 3. In AdvantageScope, connect to NetworkTables using the address `localhost` **Connecting to Robot:** 1. Power on robot and connect Driver Station -2. Open AdvantageScope → `Ctrl+Shift+P` → "WPILib: Start Tool" → "AdvantageScope" +2. Open AdvantageScope → `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac) → "WPILib: Start Tool" → "AdvantageScope" 3. In AdvantageScope, connect to NetworkTables using your team number (e.g., `3255`) **Common Issues:**