Skip to content

team401/2026-Robot-Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

314 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2026-Robot-Code

Code for our 2026 competition robot.

Table of Contents

Getting Started

Installing Dependencies

To get set up running simulation, follow the instructions here to install the latest version of WPILib.

Next, clone the project and open it in 2026 WPILib VS Code.

Starting Simulation

The first time you open the project, your editor might show you errors about undefined types ending in AutoLogged. This is because these classes are generated by AdvantageKit's annotation processor, and won't exist until you run a build. Try ./gradlew build in the terminal or the Build Robot Code in your command palette, which can be opened with Ctrl+Shift+P, or Cmd+Shift+P on mac. These won't fix the issue until you restart or refresh VSCode, but you can do that in the next step.

After building, try running simulation with Simulate Robot Code in the command palette. Select Sim GUI when prompted, and press OK. You will likely see a prompt warning you that the build failed. Rather than pressing Continue, click Fix... From the options, choose to clean the Java workspace cache and refresh. After this, try running Simulate Robot Code again. It should start up without issues. If you're still seeing errors, either in VSCode or from the simulate task failing, you can try restarting VSCode. In addition, clicking Continue on the warning that build failed is sometimes "good enough" to continue testing your code.

Using the Simulator

Installing dependencies

git clone https://github.com/team401/2026-Robot-Code

Setting up AdvantageScope custom assets folder

  • Launch AdvantageScope, either through:
    • WPILib VSCode : Ctrl+Shift+P -> Start Tool -> AdvantageScope
    • Your system app launcher/start menu
  • In the top menu bar, navigate to Help > Use Custom Assets Folder.
    • Navigate to the 2026-Robot-Code folder and select advantagekit_config.
    • Make sure you choose advantagekit_config and not Robot_401_2026. An easy way to do this is, when the file picker window opens to choose your custom assets folder, remain in 2026-Robot-Code, click on advantagekit_config, and then press Ok. If you select the inner folder, the robot model won't be detected by AdvantageScope.

Launching sim and viewing robot position

If certain menus aren't visible in your Sim GUI, select Workspace > Reset in the top menu bar and your layout should be restored. Sometimes windows can be moved off screen and rendered inaccessible.

  • Open the project in WPILib VSCode

  • Press Ctrl+Shift+P and type "Simulate Robot Code" to run the sim. When prompted, select "Sim GUI". This will launch Glass, the WPILib simulator application.

  • Open AdvantageScope. Open a 3D Field tab by clicking the + in the top right and picking 3D Field, or pressing Alt+3.

  • At the top left of the window, type Odometry/Robot into the search bar. Click on NT:/AdvantageKit/RealOutputs/Odometry/Robot from the list of options. This will your sidebar to the Robot field. For help navigating in AdvantageScope, see their Navigation Docs.

  • Click and drag the Robot field from the sidebar to the bottom of the screen under Poses. Right click on the entry it creates, and select Robot 2026 to use Typhon's CAD model.

    • If Robot 2026 isn't an option, wait a few seconds to make sure all models have loaded, and then make sure you've set up your custom assets folder correctly.
    • If it still isn't an option, please open an issue so we can update this README with better instructions.
  • Next, scroll in the sidebar back up to the search bar. This time, search for componentPositions. Select NT:/AdvantageKit/RealOutputs/componentPositions. Drag componentPositions from the sidebar on top of Robot 2026 in the Poses pane at the bottom of the screen. This will tell AdvantageScope to use the list of poses logged under componentPositions to position the elements from the robot's 3D model.

    If componentPositions shows up as a new robot, a ghost, or a game piece, it has been added as its own set of poses. Try dragging it from the sidebar again, but this time slightly higher, so that it is placed directly inside of the original Robot field. If done correctly, componentPositions should be indented slightly under the text of the Robot entry in the list.

    If componentPositions instead shows up as a vision estimate target, it is likely already dependent on the robot, but is still not configured correctly. Click on its icon to change it to a component (should be a puzzle piece).

  • This setup will be preserved by AdvantageScope every time you reopen the app unless you close the tab.

About

Code for our 2026 competition robot.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors