YAGSL
  • Welcome to Yet Another Swerve Document
    • Resources
  • Overview
    • What we do
    • Our Features
      • Telemetry
      • Simulation
      • Lock Pose
      • Max Speed
      • Chassis Speed Discretization
      • Vision Odometry
      • Heading Correction
      • Auto-centering Modules
      • Offset Offloading
      • Cosine Compensation
      • Module Auto-synchronization
      • Angular Velocity Compensation
    • Changelog
    • Java API
    • Example Code
    • Config Generator
    • 💸Donations
    • 👕Merch
    • Discord
  • Fundamentals
    • Swerve Drive
    • Swerve Modules
  • Bringing up swerve
    • Preface
    • Swerve Information
    • Check your gyroscope
    • Check your motors
    • Creating your first configuration
  • Configuring YAGSL
    • Getting to know your robot
      • Gear Ratio
    • Dependency Installation
    • Configuration
      • Swerve Drive Configuration
      • Physical Properties Configuration
      • PIDF Properties Configuration
        • PIDF
      • Swerve Module Configuration
      • Controller Properties Configuration
      • Device Configuration
    • Code Setup
    • Standard Conversion Factors
    • How to tune PIDF
    • When to invert?
    • Flowcharts
    • The eight steps
    • Swerve Drive Drift
    • SparkMAX Common Problems
    • Verifying your Module Locations
    • Tuning out Drift
  • Devices
    • Gyroscope
      • NavX
      • Pigeon
      • Pigeon 2.0
      • ADXRS450
      • ADIS16448
      • ADIS16470
    • Motor Controllers
      • SparkMAX
      • SparkFlex
      • TalonFX
    • Absolute Encoders
  • Analytics and Debugging
    • FRC Web Components
    • Advantage Scope
  • Product Guides
    • Java API
    • PathPlanner
    • ❌Tuning PID with REV Hardware Client
    • ❌Drive Code
  • Legacy Documentation
Powered by GitBook
On this page
  • Getting started
  • NavX Omni-Mount
  • NavXUI Installation
  • Calibration
  • YAGSL Checklist
  • Connection Methods
  • SPI (navx, navx_spi)
  • Serial (navx_mxp_serial, navx_usb)
  • I2C (navx_i2c)
  • NavX Micro

Was this helpful?

Edit on GitHub
  1. Devices
  2. Gyroscope

NavX

Calibrating a NavX 2

PreviousGyroscopeNextPigeon

Last updated 11 months ago

Was this helpful?

The NavX2 is the latest iteration of the NavX series by Studica (formally by KauiLabs) and offers excellent readings and documentation on how to calibrate and really get the most out of your gyroscope.

Getting started

You now have a NavX, congratulations! Time to configure and calibrate it, if you do not follow these steps it will not work as good as possible.

The java class for the NavX is AHRS imported from import com.kauailabs.navx.frc.AHRS;

NavX Omni-Mount

NavX can reconfigure the yaw to any position! Here is their guide one how.

NavXUI Installation

Java 1.7 or higher is required

Useful for advanced calibration to ensure optimal accuracy on the robot.

Calibration

Full documentation for calibration is here. The original calibration is done at the factory in Hawaii so it is highly reccommended you do this at least once!

We will provide a brief summary here.

Gyroscopes are sensitive to ambient temperature, so it is imperative that you recalibrate them upon reception AND at events. NavX instructions are as follows.

  1. Place them NavX on a still platform parallel to the earth's surface (use a level!).

  2. Press and hold the CAL button for at least 10 seconds.

  3. When you release the CAL button ensure that the CAL led flashes briefly.

  4. Press the RESET button.

  5. Wait up to 15 seconds.

  6. yaw accuracy may be diminished until the next On-the-fly Gyro calibration completes. (which means your first autonomous may not act right!)

YAGSL Checklist

Connection Methods

SPI (navx, navx_spi)

YAGSL supports the NavX SPI communication over the roboRIO MXP. This is the recommended method of communicating with NavX devices.

{
  "imu": {
    "type": ,
    "id": ,
    "canbus": 
  },
  "invertedIMU": true,
  "modules": [
    "frontleft.json",
    "frontright.json",
    "backleft.json",
    "backright.json"
  ]
}
{
  "imu": {
    "type": ,
    "id": ,
    "canbus": 
  },
  "invertedIMU": true,
  "modules": [
    "frontleft.json",
    "frontright.json",
    "backleft.json",
    "backright.json"
  ]
}

Serial (navx_mxp_serial, navx_usb)

{
  "imu": {
    "type": ,
    "id": ,
    "canbus": 
  },
  "invertedIMU": true,
  "modules": [
    "frontleft.json",
    "frontright.json",
    "backleft.json",
    "backright.json"
  ]
}
{
  "imu": {
    "type": ,
    "id": ,
    "canbus": 
  },
  "invertedIMU": true,
  "modules": [
    "frontleft.json",
    "frontright.json",
    "backleft.json",
    "backright.json"
  ]
}

I2C (navx_i2c)

I2C communication on the MXP is supported however this is known to cause permanent lockouts on the roboRIO randomly, this issue has been thoroughly investigated and no known cause can be found. It is encouraged to avoid using this option at all costs!!

{
  "imu": {
    "type": ,
    "id": ,
    "canbus": 
  },
  "invertedIMU": true,
  "modules": [
    "frontleft.json",
    "frontright.json",
    "backleft.json",
    "backright.json"
  ]
}

NavX Micro

If you are using the NavX micro please select the type of navx_usb to indicate you are communicating over serial via the USB or else the gyrscope will not work with YAGSL!

Serial communication is slower than SPI communication and could be more prone to interference however this is the only out of the box way to communicate with the (navx_usb) so this must be selected if you are using one. The MXP serial communication can be used incase the SPI MXP communication is not working at the moment.

NavX2 micro
OmniMountnavX-MXP
navXUInavX-MXP
https://www.kauailabs.com/public_files/navx-mxp/navx-mxp.zip
Installation ZIP
Automatic Gyro/Accelerometer CalibrationnavX-MXP
NavX micro from andymark
navX2-MXP Robotics Navigation SensorStudica Limited
Logo