VMX-pi’s internal navX-sensor from a FRC Program

Accessing the VMX-pi navX-Sensor is identical to how navX-MXP and navX-Micro are accessed on a competition FRC Robot. If you’re unfamiliar with navX, check out the examples (available for Java and C++ on the VMX-pi of the many different features available with a navX-Sensor.

Installing navX FRC Libraries

Simply follow the same online 3rd-party library installation method used during FRC Competition Season, using this URL:

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

NOTE: navx_frc version 3.1.376 or higher is required for operation with VMX-pi; be sure to update if you have an earlier version.

Connecting to the VMX-pi navX-sensor

Then, in the FRC robot application instantiate the navX-sensor AHRS class on one of the “kMXP” Ports, including

JavaC++
SPI.Port.kMXPSPI::Port::kMXP
I2C.Port.kMXPI2C::Port::kMXP
SerialPort.Port.kMXPSerialPort::Port::kMXP

When the navx_frc library runs on a Raspberry Pi, and one of the kMXP ports is specified, the VMX-pi’s internal navX-Sensor is automatically used.