3#include <frc/geometry/Quaternion.h>
4#include <frc/geometry/Rotation2d.h>
5#include <frc/geometry/Rotation3d.h>
6#include <units/angular_velocity.h>
7#include <units/acceleration.h>
8#include <units/angle.h>
9#include <units/temperature.h>
10#include <units/magnetic_field_strength.h>
41 explicit Navx(
int deviceId);
54 Navx(
int deviceId,
int updateRate);
122 bool EnableOptionalMessages(
bool yaw,
bool angle,
bool quat6d,
bool quat9d,
bool algoStates,
bool pitchRoll,
123 bool angularVel,
bool linearAccel,
bool compass,
bool temperature);
161 units::degrees_per_second_t& y,
162 units::degrees_per_second_t& z);
172 units::meters_per_second_squared_t& y,
173 units::meters_per_second_squared_t& z);
186 units::tesla_t& norm);
bool SetODRHz(uint16_t odr_hz)
Set the CAN and USB user data output rate, must be less than 1000Hz (IMU update rate).
Definition Navx.cpp:155
Port
Enum for the user to select which USB port they connect the.
Definition Navx.h:32
@ kUSB2
Definition Navx.h:34
@ kUSB1
Definition Navx.h:33
bool EnableOptionalMessages(bool yaw, bool angle, bool quat6d, bool quat9d, bool algoStates, bool pitchRoll, bool angularVel, bool linearAccel, bool compass, bool temperature)
Used to pick what sort of data is needed to be sent via the CAN bus.
Definition Navx.cpp:159
bool ResetYaw()
Reset IMU Yaw back to 0.
Definition Navx.cpp:151
bool GetCompass(units::tesla_t &x, units::tesla_t &y, units::tesla_t &z, units::tesla_t &norm)
Get yaw offset magnetic field values from the magnetometer.
Definition Navx.cpp:131
units::celsius_t GetTemperature()
Get the gyroscope chip temperature.
Definition Navx.cpp:188
units::degree_t GetRoll()
Gets the converted roll angle from the IMU filtering algorithm.
Definition Navx.cpp:36
~Navx()
Default destructor.
Definition Navx.cpp:22
bool GetQuat9D(frc::Quaternion &quat)
Get 9-axis quaternions from filter i.e.
Definition Navx.cpp:88
units::degree_t GetAngle()
Gets the converted continous angle from the IMU filtering algorithm.
Definition Navx.cpp:41
units::degree_t GetYaw()
Gets the converted yaw angle from the IMU filtering algorithm.
Definition Navx.cpp:26
bool GetQuat6D(frc::Quaternion &quat)
Get 6-axis quaternions from filter i.e.
Definition Navx.cpp:73
bool GetAngularVel(units::degrees_per_second_t &x, units::degrees_per_second_t &y, units::degrees_per_second_t &z)
Get angular velocity measurements from the gyroscope when not at rest.
Definition Navx.cpp:103
Navx & operator=(Navx &&)=default
bool GetSensorUUID(int uuid[3])
Get internal sensor UUID.
Definition Navx.cpp:184
bool GetRotation3D(frc::Rotation3d &rotation)
Constructs a Rotation3d from the NavX Quaternion.
Definition Navx.cpp:57
bool SelfTest(int ret[8])
Trigger IMU self test functionality on gyroscope and accelerometer unit.
Definition Navx.cpp:147
Navx(int deviceId)
NavX3 object constructor with default 100Hz update rate.
Definition Navx.cpp:6
bool Enable9DYaw(bool enable)
Enable Yaw to use 9D instead of 6D.
Definition Navx.cpp:193
units::degree_t GetPitch()
Gets the converted pitch angle from the IMU filtering algorithm.
Definition Navx.cpp:31
bool GetRotation2D(frc::Rotation2d &rotation)
Get the heading of the robot as a Rotation2d.
Definition Navx.cpp:46
bool GetAlgoStates(float states[9])
Get selected filtering algorithm parameters to observe settings or calibration.
Definition Navx.cpp:69
bool GetLinearAccel(units::meters_per_second_squared_t &x, units::meters_per_second_squared_t &y, units::meters_per_second_squared_t &z)
Get linear acceleration measurements from the accelerometer when not at rest.
Definition Navx.cpp:117