Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
distance_sensor.hpp
Go to the documentation of this file.
1/*****************************************************************************/
2/********** !!! WARNING: CODE GENERATED BY TAPROOT. DO NOT EDIT !!! **********/
3/*****************************************************************************/
4
5/*
6 * Copyright (c) 2020-2021 Advanced Robotics at the University of Washington <robomstr@uw.edu>
7 *
8 * This file is part of Taproot.
9 *
10 * Taproot is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * Taproot is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Taproot. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef TAPROOT_DISTANCE_SENSOR_HPP_
25#define TAPROOT_DISTANCE_SENSOR_HPP_
26
27namespace tap
28{
29namespace sensors
30{
32{
33public:
41
42 virtual ~DistanceSensor() = default;
43
44 virtual void init() = 0;
45
49 virtual float read() = 0;
50
54 virtual bool validReading() const = 0;
55
59 float getMinDistance() const;
60
64 float getMaxDistance() const;
65
69 float getDistance() const;
70
71protected:
72 float distance;
73
75
77};
78
79} // namespace sensors
80
81} // namespace tap
82
83#endif // TAPROOT_DISTANCE_SENSOR_HPP_
Definition distance_sensor.hpp:32
float maxDistance
Upper boundary for reliable readings.
Definition distance_sensor.hpp:76
float getMaxDistance() const
Definition distance_sensor.cpp:40
float getMinDistance() const
Definition distance_sensor.cpp:38
float getDistance() const
Definition distance_sensor.cpp:42
float distance
Distance from sensor.
Definition distance_sensor.hpp:72
virtual ~DistanceSensor()=default
virtual bool validReading() const =0
float minDistance
Lower boundary for reliable readings.
Definition distance_sensor.hpp:74
Definition ballistics.cpp:29