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
Java | C++ |
SPI.Port.kMXP | SPI::Port::kMXP |
I2C.Port.kMXP | I2C::Port::kMXP |
SerialPort.Port.kMXP | SerialPort::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.