|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
#include <adiGyro.hpp>
Public Member Functions | |
| ADIGyro (std::uint8_t iport, double imultiplier=1) | |
| A gyroscope on the given ADI port. | |
| ADIGyro (std::pair< std::uint8_t, std::uint8_t > iports, double imultiplier=1) | |
| A gyroscope on the given ADI port. | |
| double | get () const override |
| Get the current sensor value. | |
| double | getRemapped (double iupperBound=1800, double ilowerBound=-1800) const |
Get the current sensor value remapped into the target range ([-1800, 1800] by default). | |
| std::int32_t | reset () override |
| Reset the sensor to zero. | |
| double | controllerGet () override |
| Get the sensor value for use in a control loop. | |
Public Member Functions inherited from okapi::RotarySensor | |
| virtual | ~RotarySensor () |
Protected Attributes | |
| pros::c::ext_adi_gyro_t | gyro |
Definition at line 13 of file adiGyro.hpp.
| okapi::ADIGyro::ADIGyro | ( | std::uint8_t | iport, |
| double | imultiplier = 1 |
||
| ) |
A gyroscope on the given ADI port.
If the port has not previously been configured as a gyro, then the constructor will block for 1 second for calibration. The gyro measures in tenths of a degree, so there are 3600 measurement points per revolution.
| iport | The ADI port number ([1, 8], [a, h], [A, H]). |
| imultiplier | A value multiplied by the gyro heading value. |
| okapi::ADIGyro::ADIGyro | ( | std::pair< std::uint8_t, std::uint8_t > | iports, |
| double | imultiplier = 1 |
||
| ) |
A gyroscope on the given ADI port.
If the port has not previously been configured as a gyro, then the constructor will block for 1 second for calibration. The gyro measures in tenths of a degree, so there are 3600 measurement points per revolution.
Note to developers: Keep the default value on imultiplier so that users get an error if they do ADIGyro({1, 'A'}). Without it, this calls the non-ext-adi constructor.
| iports | The ports the gyro is plugged in to in the order {smart port, gyro port}. The smart port is the smart port number ([1, 21]). The gyro port is the ADI port number ([1, 8], [a, h], [A, H]). |
| imultiplier | A value multiplied by the gyro heading value. |
|
overridevirtual |
Get the sensor value for use in a control loop.
This method might be automatically called in another thread by the controller.
PROS_ERR on a failure. Implements okapi::ControllerInput< double >.
|
overridevirtual |
Get the current sensor value.
PROS_ERR on a failure. Implements okapi::RotarySensor.
| double okapi::ADIGyro::getRemapped | ( | double | iupperBound = 1800, |
| double | ilowerBound = -1800 |
||
| ) | const |
Get the current sensor value remapped into the target range ([-1800, 1800] by default).
| iupperBound | the upper bound of the range. |
| ilowerBound | the lower bound of the range. |
|
overridevirtual |
Reset the sensor to zero.
1 on success, PROS_ERR on fail Implements okapi::ContinuousRotarySensor.
|
protected |
Definition at line 80 of file adiGyro.hpp.