#include <distanceSensor.hpp>
Definition at line 14 of file distanceSensor.hpp.
◆ DistanceSensor()
| okapi::DistanceSensor::DistanceSensor |
( |
std::uint8_t |
iport, |
|
|
std::unique_ptr< Filter > |
ifilter = std::make_unique< PassthroughFilter >() |
|
) |
| |
A distance sensor on a V5 port.
- Parameters
-
| iport | The V5 port the device uses. |
| ifilter | The filter to use for filtering the distance measurements. |
◆ ~DistanceSensor()
| virtual okapi::DistanceSensor::~DistanceSensor |
( |
| ) |
|
|
virtualdefault |
◆ controllerGet()
| double okapi::DistanceSensor::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::DistanceSensor::get |
( |
| ) |
|
Get the current filtered sensor value in mm.
- Returns
- The current filtered sensor value in mm.
◆ getConfidence()
| std::int32_t okapi::DistanceSensor::getConfidence |
( |
| ) |
const |
Get the confidence in the distance reading.
This value has a range of [0, 63]. 63 means high confidence, lower values imply less confidence. Confidence is only available when distance is greater than 200 mm.
- Returns
- The confidence value in the range
[0, 63].
◆ getObjectSize()
| std::int32_t okapi::DistanceSensor::getObjectSize |
( |
| ) |
const |
Get the current guess at relative object size.
This value has a range of [0, 400]. A 18" x
30" grey card will return a value of approximately 75 in typical room lighting.
- Returns
- The size value in the range
[0, 400] or PROS_ERR if the operation failed, setting errno.
◆ getObjectVelocity()
| double okapi::DistanceSensor::getObjectVelocity |
( |
| ) |
const |
Get the object velocity in m/s.
- Returns
- The object velocity in m/s.
◆ filter
| std::unique_ptr<Filter> okapi::DistanceSensor::filter |
|
protected |
◆ port
| std::uint8_t okapi::DistanceSensor::port |
|
protected |
The documentation for this class was generated from the following file: