|
StudicaLib
|
#include <Navx.h>
Public Types | |
| enum class | Port : int { kUSB1 = 2 , kUSB2 = 3 } |
| Enum for the user to select which USB port they connect the. More... | |
Public Member Functions | |
| Navx (int deviceId) | |
| NavX3 object constructor with default 100Hz update rate. | |
| Navx (Port port) | |
| NavX3 object constructor for USB communication with default 100Hz update rate. | |
| Navx (int deviceId, int updateRate) | |
| NavX3 object constructor with custom update rate. | |
| Navx (Port port, int updateRate) | |
| NavX3 object constructor for USB communication. | |
| Navx (Navx &&)=default | |
| Navx & | operator= (Navx &&)=default |
| ~Navx () | |
| Default destructor. | |
| units::degree_t | GetYaw () |
| Gets the converted yaw angle from the IMU filtering algorithm. | |
| units::degree_t | GetPitch () |
| Gets the converted pitch angle from the IMU filtering algorithm. | |
| units::degree_t | GetRoll () |
| Gets the converted roll angle from the IMU filtering algorithm. | |
| units::degree_t | GetAngle () |
| Gets the converted continous angle from the IMU filtering algorithm. | |
| bool | GetAlgoStates (float states[9]) |
| Get selected filtering algorithm parameters to observe settings or calibration. | |
| 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. | |
| bool | GetQuat6D (frc::Quaternion &quat) |
| Get 6-axis quaternions from filter i.e. | |
| bool | GetQuat9D (frc::Quaternion &quat) |
| Get 9-axis quaternions from filter i.e. | |
| bool | GetRotation2D (frc::Rotation2d &rotation) |
| Get the heading of the robot as a Rotation2d. | |
| bool | GetRotation3D (frc::Rotation3d &rotation) |
| Constructs a Rotation3d from the NavX Quaternion. | |
| 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. | |
| 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. | |
| 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. | |
| bool | SelfTest (int ret[8]) |
| Trigger IMU self test functionality on gyroscope and accelerometer unit. | |
| bool | ResetYaw () |
| Reset IMU Yaw back to 0. | |
| bool | SetODRHz (uint16_t odr_hz) |
| Set the CAN and USB user data output rate, must be less than 1000Hz (IMU update rate). | |
| bool | GetSensorUUID (int uuid[3]) |
| Get internal sensor UUID. | |
| units::celsius_t | GetTemperature () |
| Get the gyroscope chip temperature. | |
| bool | Enable9DYaw (bool enable) |
| Enable Yaw to use 9D instead of 6D. | |
|
strong |
|
explicit |
NavX3 object constructor with default 100Hz update rate.
| [in] | deviceId | CAN ID of the IMU. |
|
explicit |
NavX3 object constructor for USB communication with default 100Hz update rate.
| [in] | port | The USB port in use |
| Navx::Navx | ( | int | deviceId, |
| int | updateRate ) |
NavX3 object constructor with custom update rate.
| [in] | deviceId | CAN ID of the IMU. |
| [in] | updateRate | CAN message output rate. |
| Navx::Navx | ( | Port | port, |
| int | updateRate ) |
NavX3 object constructor for USB communication.
| [in] | port | The USB port in use |
| [in] | updateRate | USB update rate |
|
default |
| Navx::~Navx | ( | ) |
Default destructor.
| bool Navx::Enable9DYaw | ( | bool | enable | ) |
Enable Yaw to use 9D instead of 6D.
| bool Navx::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.
| yaw | Boolean value to enable yaw messages. |
| angle | Boolean value to enable angle messages. |
| quat6d | Boolean value to enable 6-axis quaternion messages. |
| quat9d | Boolean value to enable 9-axis quaternion messages. |
| algoStates | Boolean value to enable algorithm states messages. |
| pitchRoll | Boolean value to enable pitch and roll messages. |
| angularVel | Boolean value to enable angular velocity messages. |
| linearAccel | Boolean value to enable linear acceleration messages. |
| compass | Boolean value to enable mag compass measurement messages. |
| temperature | Boolean value to enable temperature messages. |
| bool Navx::GetAlgoStates | ( | float | states[9] | ) |
Get selected filtering algorithm parameters to observe settings or calibration.
| [out] | states | Array of 9 elements:
|
| units::degree_t Navx::GetAngle | ( | ) |
Gets the converted continous angle from the IMU filtering algorithm.
| bool Navx::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.
| [out] | x | X-axis angluar velocity. |
| [out] | y | Y-axis angluar velocity. |
| [out] | z | Z-axis angluar velocity. |
| bool Navx::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.
| [out] | x | X-axis magnetic flux density. |
| [out] | y | X-axis magnetic flux density. |
| [out] | z | X-axis magnetic flux density. |
| [out] | norm | Field vector magnitude. |
| bool Navx::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.
| [out] | x | X-axis acceleration. |
| [out] | y | Y-axis acceleration. |
| [out] | z | Z-axis acceleration. |
| units::degree_t Navx::GetPitch | ( | ) |
Gets the converted pitch angle from the IMU filtering algorithm.
| bool Navx::GetQuat6D | ( | frc::Quaternion & | quat | ) |
Get 6-axis quaternions from filter i.e.
without mag integration.
| [out] | quat | Output quaternion {w, x, y, z}. |
| bool Navx::GetQuat9D | ( | frc::Quaternion & | quat | ) |
Get 9-axis quaternions from filter i.e.
with mag integration included.
| [out] | quat | Output quaternion {w, x, y, z}. |
| units::degree_t Navx::GetRoll | ( | ) |
Gets the converted roll angle from the IMU filtering algorithm.
| bool Navx::GetRotation2D | ( | frc::Rotation2d & | rotation | ) |
Get the heading of the robot as a Rotation2d.
| [out] | rotation | Output heading. |
| bool Navx::GetRotation3D | ( | frc::Rotation3d & | rotation | ) |
Constructs a Rotation3d from the NavX Quaternion.
| [out] | rotation | Output rotation. |
| bool Navx::GetSensorUUID | ( | int | uuid[3] | ) |
Get internal sensor UUID.
| [out] | uuid | Retrieved 96-bit UUID |
| units::celsius_t Navx::GetTemperature | ( | ) |
Get the gyroscope chip temperature.
| units::degree_t Navx::GetYaw | ( | ) |
Gets the converted yaw angle from the IMU filtering algorithm.
| bool Navx::ResetYaw | ( | ) |
Reset IMU Yaw back to 0.
| bool Navx::SelfTest | ( | int | ret[8] | ) |
Trigger IMU self test functionality on gyroscope and accelerometer unit.
| [out] | ret | Array of 8 elements:
|
| bool Navx::SetODRHz | ( | uint16_t | odr_hz | ) |
Set the CAN and USB user data output rate, must be less than 1000Hz (IMU update rate).