Kauai Labs navX2-MXP User Manual page 34

Robotics navigation sensor
Table of Contents

Advertisement

Software
Android Library (FTC)
Next, several configuration changes must be made in order that the Android Studio ftc_app-based project
can locate the navx_ftc library:
Modify any of the op mode example files to change the following line near the top of the file to
match the "Device name" given to the I2C port on the REV Expansion or Control Hub to which
you have connected the navX-Model device. By default, the Device name is "navx".
navx_device = AHRS.getInstance(hardwareMap.get(NavxMicroNavigatio
nSensor.class, "navx"), AHRS.DeviceDataType.kProcessedData);
See
FTC Robot Installation
Modify your robot application's (the "TeamCode" project) build.release.gradle file repository list
to add a reference the directory where the navx_ftc library is installed:
repositories {
flatDir {
dirs 'libs', 'C:\\Users\\Robot\\navx-mxp\\android\\libs'
}
}
Again in the same build.release.gradle file, add the navx_ftc library to the list of libraries the
ftc_app will link to – by adding this line near the bottom of the gradle build file, in the
dependencies section:
dependencies {
...
compile (name:'navx_ftc-release', ext:'aar')
}
Linux/MacOS distribution
For developers on Linux and Mac OS platforms, the latest
note that this build does not contain any of the navX2-Micro tools, but does contain the RoboRIO and
Android libraries.
This distribution is packaged as a .zip file; unzip the file and follow the instructions in the readme.txt file
in the top-level directory.
Once you have installed the Android libraries onto your computer, use the instructions in the Getting
Started section above to use the library. However, you will need to replace "C:\Users\Robot\navx-mxp"
in several places shown above with the corresponding path on Linux/MacOS where you installed the
for details on configuring the Device name.
non-Windows build
is also available. Please
31

Advertisement

Table of Contents
loading

Related Products for Kauai Labs navX2-MXP

Table of Contents