#include <rotationSensor.hpp>
|
| | RotationSensor (std::uint8_t iport, bool ireversed=false) |
| | A rotation sensor in a V5 port.
|
| |
| double | get () const override |
| | Get the current rotation in degrees.
|
| |
| std::int32_t | reset () override |
| | Reset the sensor to zero.
|
| |
| double | controllerGet () override |
| | Get the sensor value for use in a control loop.
|
| |
| double | getVelocity () const |
| | Get the current rotational velocity estimate in degrees per second.
|
| |
| virtual | ~RotarySensor () |
| |
Definition at line 12 of file rotationSensor.hpp.
◆ RotationSensor()
| okapi::RotationSensor::RotationSensor |
( |
std::uint8_t |
iport, |
|
|
bool |
ireversed = false |
|
) |
| |
A rotation sensor in a V5 port.
- Parameters
-
| iport | The V5 port the device uses. |
| ireversed | Whether the sensor is reversed. This will set the reversed state in the kernel. |
◆ controllerGet()
| double okapi::RotationSensor::controllerGet |
( |
| ) |
|
|
overridevirtual |
Get the sensor value for use in a control loop.
This method might be automatically called in another thread by the controller.
- Returns
- The same as get.
Implements okapi::ControllerInput< double >.
◆ get()
| double okapi::RotationSensor::get |
( |
| ) |
const |
|
overridevirtual |
Get the current rotation in degrees.
- Returns
- The current rotation in degrees or
PROS_ERR_F if the operation failed, setting errno.
Implements okapi::RotarySensor.
◆ getVelocity()
| double okapi::RotationSensor::getVelocity |
( |
| ) |
const |
Get the current rotational velocity estimate in degrees per second.
- Returns
- The current rotational velocity estimate in degrees per second or
PROS_ERR_F if the operation failed, setting errno.
◆ reset()
| std::int32_t okapi::RotationSensor::reset |
( |
| ) |
|
|
overridevirtual |
Reset the sensor to zero.
- Returns
1 if the operation was successful or PROS_ERR if the operation failed, setting errno.
Implements okapi::ContinuousRotarySensor.
◆ port
| std::uint8_t okapi::RotationSensor::port |
|
protected |
◆ reversed
| std::int8_t okapi::RotationSensor::reversed {1} |
|
protected |
The documentation for this class was generated from the following file: