Skip to main content

Setting up VS Code for the VMX

By default, the software setup configures VS Code for a roboRIO. Follow the steps below to switch the configuration to a VMX.

VMX VS Code Extension​

The VMX VS Code extension converts the build.gradle for the roboRIO into a build.gradle for the VMX. The extension also allows GradleRIO version updates for the VMX whenever a new version becomes available.

Installing the Extension​

To install the extension head over to the Extensions tab on the left panel of VS Code or hit Ctrl + Shift + X.

VS Code ConfigVS Code Config

In the search bar, search for VMX.

VS Code ConfigVS Code Config

Select the extension VMX-PI WPILib.

VS Code ConfigVS Code Config

Click on Install to install the extension.

The white VMXpi logo will pop up next to the WPILib logo after a successful installation.

VS Code ConfigVS Code Config

Using the Extension​

The extension palette contains four commands.

VS Code ConfigVS Code Config
  • Update WPILib Version updates the project to the current GradleRIO version for the VMX. Ensure the project already targets a VMX project and not a roboRIO project before running this command.
  • Change the deploy target to VMX-Pi (from RoboRIO) updates the build.gradle file to use the VMX as a target.
  • Change the deploy target to RoboRIO (from VMX-Pi) updates the build.gradle file to use the roboRIO as a target.
  • Verify the Project's build.gradle file checks that everything in build.gradle looks ready to go.

After creating a new WPILib project, the project defaults to a roboRIO target. Run the command Change the deploy target to VMX-Pi (from RoboRIO). The command will then grab and cache the appropriate GradleRIO version for the project.

Installing the Raspbian Toolchain (C++ Only)​

Anyone using C++ for WPILib requires the Raspbian toolchain for building and redeploying to the VMX.

Open the WPILib extension and use the command Run a command in Gradle.

VS Code ConfigVS Code Config

In the popup window, type installRaspbianToolchain and hit enter. The toolchain will then install and cache onto the computer.

VS Code ConfigVS Code Config