Wiki
latest

Build

  • Tools
  • Machines
  • Electronics
  • Drive Bases
  • Gear Shift
  • Pneumatics
  • Sensors
  • Bumpers

Software

  • Introduction
  • Motors
  • Drive Bases
  • Pneumatics
  • Gear Shift
  • Sensors
    • DigitalInput
    • NavX IMU
      • MotionSensor Class
    • Color Sensor
  • Limelight
  • Control Theory
  • Shooters
  • Autonomous
  • Competition
  • Advanced Software

CAD

  • Introduction
  • Fusion 360
  • Practice
  • Organization
  • Conventions
  • Part Websites

Safety

  • Resources
  • First Aid Kits
  • Precautions
  • Safety Saturday
  • Battery Spills
  • Safety Boards and Pictures

Advanced Software

  • Data Structures & Algorithms
Wiki
  • »
  • Sensors »
  • NavX IMU
  • Edit on GitHub

NavX IMU

MotionSensor Class

It’s good practice to define this sensor as its own class so we have more flexibility in the event we swap out the sensor with something else. It should be in the subsystems folder, but remove the extends SubsystemBase.

Alongside this, be sure to add the library by doing the following:

  • Go to VSCode and press Ctrl + Shift + P

  • Search “WPILib: Manage Vendor Libraries”, and select “Install New Libraries (Online)”

  • Input https://www.kauailabs.com/dist/frc/2022/navx_frc.json

Now that this class has been created, you must create methods to access readings from the sensor. Just copy the methods from the sensor’s class and make methods which return that information. This may seem pointless, but offers us more flexibility in the event we want to change a sensor.

Previous Next

© Copyright Team 3624, 2022. Revision c09c88d2.

Built with Sphinx using a theme provided by Read the Docs.