LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
adiUltrasonic.hpp
Go to the documentation of this file.
1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 */
6#pragma once
7
8#include "api.h"
11#include <memory>
12
13namespace okapi {
14class ADIUltrasonic : public ControllerInput<double> {
15 public:
30 ADIUltrasonic(std::uint8_t iportPing,
31 std::uint8_t iportEcho,
32 std::unique_ptr<Filter> ifilter = std::make_unique<PassthroughFilter>());
33
49 ADIUltrasonic(std::tuple<std::uint8_t, std::uint8_t, std::uint8_t> iports,
50 std::unique_ptr<Filter> ifilter = std::make_unique<PassthroughFilter>());
51
52 virtual ~ADIUltrasonic();
53
59 virtual double get();
60
65 virtual double controllerGet() override;
66
67 protected:
68 pros::c::ext_adi_ultrasonic_t ultra;
69 std::unique_ptr<Filter> filter;
70};
71} // namespace okapi
PROS API header provides high-level user functionality.
pros::c::ext_adi_ultrasonic_t ultra
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.
std::unique_ptr< Filter > filter
virtual ~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.
virtual double controllerGet() override
Get the sensor value for use in a control loop.
virtual double get()
Returns the current filtered sensor value.