Navx-mxp vscode vendor library install for linux and macos (non-windows)

Here is a navx_install.sh script for version 3.1.413 of the navx-mxp cross-platform libraries for linux and macos. It is based off of the one mandrews281 did back in 2019. -Updated for the 2021 season.

Works for me, but hasn’t had much testing. Please let me know if it works for you.

navx_install.sh (3.6 KB)

It assumes you have installed wpilib into the default location ~/wpilib/2021

It will:

  • create a ~/navx-mxp directory
  • download and unzip the navx mxp libs into it
  • download the navx_frc.json into ~/wpilib/2021/vendordeps
  • create the ~/wpilib/2021/maven directories for c++ and java
  • download the maven-metadata.xml and zip files into the correct directories

After running the script, you will still need to right-click on build.gradle in vscode, select manage vendor libraries, and “install new libraries (offline)” (or “check for updates (offline)” if there is an update)

If you re-run the script, it deletes existing files and downloads them again, so it makes for a clean reset. It should also continue to work if a new version gets released. The library version number is read from the navx_frc.json.

The curious things is that kauai still has the vendordeps/navx_frc.json file for the latest version of the libraries hosted on a 2020 url: https://www.kauailabs.com/dist/frc/2020/navx_frc.json. There is no 2021 url as of yet.

So when you check for updates, periodically check to see if Kauai decides to move this json file to https://www.kauailabs.com/dist/frc/2020/navx_frc.json. If so, you’ll need to update the bash script accordingly.

I just installed the library. It seems it hasn’t been updated since this time last year, which would explain the 2020 url.

1 Like

I’ll just say that there’s a new vendordep gradle task for downloading vendor json files:

./gradlew vendordep --url=https://www.kauailabs.com/dist/frc/2020/navx_frc.json 

This should work and is much simpler.
If you run into an problem with it, please open an issue on GitHub - wpilibsuite/GradleRIO: The official gradle plugin for the FIRST Robotics Competition.
The maven dependencies will be downloaded on build while connected to internet (run ./gradlew build if VS Code won’t build online).

Starlight220 this is great news! Thank you for implementing this.

I had missed mention of this in the wpilib documentation.

For folks reading along, this makes the navx-install.sh unnecessary. But you still need to know the location of the 3rd party vendor’s vendordep *.json file. Which unfortunately was not mentioned in the Kauai cross-platform libraries download.

Also beware that all the example folders in the current navx-mxp-libs.zip version 3.1.413 download contain copies of navx_frc.json for 3.1.377.

The url for the current/latest version of the library at the time I am writing is:

https://www.kauailabs.com/dist/frc/2020/navx_frc.json

But given that it is now the 2021 season, you make want to check periodically for updates at:

https://www.kauailabs.com/dist/frc/2021/navx_frc.json

The navx-install.sh and the gradlerio vendordep task appear to be somewhat orthogonal. navx-install.sh appears similar to a vendor’s offline installation, setting up maven and loading the vendordep in the wpilib location so that vscode can add it using the offline vendor library. navx-install.sh needs to be run while the computer is connected to the internet, but then it can be disconnected. The gradlerio vendordep task is equivalent to the vscode online install. You need to be online to run both the vendordep task and the first build, to download the maven artifacts. After the first build, the computer can be disconnected from the internet.

The gradlerio task is really there for teams that don’t use vscode.

2 Likes

The 2021 navX-sensor libraries for Roborio are now available, supporting both navX-MXP and navX2-MXP.

To access it, click on the “Download” link on the navX-MXP software page.

No firmware updates are required, so it’s not strictly necessary to run this installer. If you’re using online vendordeps, you can access them here:

https://www.kauailabs.com/dist/frc/2021/navx_frc.json

Aloha,

  • scott
2 Likes

Thanks Scott!

Here is an updated the navx_install.sh which points to the new navx-mxp.json location for 2021.

navx_install.sh (3.6 KB)

This one should be good for the rest of the 2021 season.