#include <adiUltrasonic.hpp>
|
| | ADIUltrasonic (std::uint8_t iportPing, std::uint8_t iportEcho, std::unique_ptr< Filter > ifilter=std::make_unique< PassthroughFilter >()) |
| | An ultrasonic sensor in the ADI (3-wire) ports.
|
| |
| | ADIUltrasonic (std::tuple< std::uint8_t, std::uint8_t, std::uint8_t > iports, std::unique_ptr< Filter > ifilter=std::make_unique< PassthroughFilter >()) |
| | An ultrasonic sensor in the ADI (3-wire) ports.
|
| |
| virtual | ~ADIUltrasonic () |
| |
| virtual double | get () |
| | Returns the current filtered sensor value.
|
| |
| virtual double | controllerGet () override |
| | Get the sensor value for use in a control loop.
|
| |
Definition at line 14 of file adiUltrasonic.hpp.
◆ ADIUltrasonic() [1/2]
| okapi::ADIUltrasonic::ADIUltrasonic |
( |
std::uint8_t |
iportPing, |
|
|
std::uint8_t |
iportEcho, |
|
|
std::unique_ptr< Filter > |
ifilter = std::make_unique< PassthroughFilter >() |
|
) |
| |
An ultrasonic sensor in the ADI (3-wire) ports.
pros::c::ext_adi_ultrasonic_t ultra
- Parameters
-
| iportPing | The port connected to the orange OUTPUT cable. This must be in port 1, 3, 5, or 7 (A, C, E, or G). |
| iportEcho | The port connected to the yellow INPUT cable. This must be in the next highest port following iportPing. |
| ifilter | The filter to use for filtering the distance measurements. |
◆ ADIUltrasonic() [2/2]
| okapi::ADIUltrasonic::ADIUltrasonic |
( |
std::tuple< std::uint8_t, std::uint8_t, std::uint8_t > |
iports, |
|
|
std::unique_ptr< Filter > |
ifilter = std::make_unique< PassthroughFilter >() |
|
) |
| |
An ultrasonic sensor in the ADI (3-wire) ports.
auto filteredUltra =
ADIUltrasonic({1,
'A',
'B'}, std::make_unique<MedianFilter<5>>());
- Parameters
-
| iports | The ports the ultrasonic is plugged in to in the order {smart port, ping port, echo port}. The smart port is the smart port number ([1, 21]). The ping port is the port connected to the orange OUTPUT cable. This must be in port 1, 3, 5, or 7 (A, C, E, or G). The echo port is the port connected to the yellow INPUT cable. This must be in the next highest port following the ping port. |
| ifilter | The filter to use for filtering the distance measurements. |
◆ ~ADIUltrasonic()
| virtual okapi::ADIUltrasonic::~ADIUltrasonic |
( |
| ) |
|
|
virtual |
◆ controllerGet()
| virtual double okapi::ADIUltrasonic::controllerGet |
( |
| ) |
|
|
overridevirtual |
◆ get()
| virtual double okapi::ADIUltrasonic::get |
( |
| ) |
|
|
virtual |
Returns the current filtered sensor value.
- Returns
- current value
◆ filter
| std::unique_ptr<Filter> okapi::ADIUltrasonic::filter |
|
protected |
◆ ultra
| pros::c::ext_adi_ultrasonic_t okapi::ADIUltrasonic::ultra |
|
protected |
The documentation for this class was generated from the following file: