WPILibC++
2027.0.0-alpha-4
Loading...
Searching...
No Matches
XRPRangefinder.hpp
Go to the documentation of this file.
1
// Copyright (c) FIRST and other WPILib contributors.
2
// Open Source Software; you can modify and/or share it under the terms of
3
// the WPILib BSD license file in the root directory of this project.
4
5
#pragma once
6
7
#include "
wpi/hardware/discrete/AnalogInput.hpp
"
8
#include "wpi/units/length.hpp"
9
10
namespace
wpi::xrp
{
11
12
/**
13
* @ingroup xrp_api
14
* @{
15
*/
16
17
/** This class represents the ultrasonic rangefinder on an XRP robot. */
18
class
XRPRangefinder
{
19
public
:
20
/**
21
* Get the measured distance in meters. Distance further than 4m will be
22
* reported as 4m.
23
*
24
* @return distance in meters
25
*/
26
wpi::units::meter_t
GetDistance
()
const
;
27
28
private
:
29
wpi::AnalogInput
m_rangefinder{2};
30
};
31
32
/** @} */
33
34
}
// namespace wpi::xrp
AnalogInput.hpp
wpi::AnalogInput
Analog input class.
Definition
AnalogInput.hpp:29
wpi::xrp::XRPRangefinder
This class represents the ultrasonic rangefinder on an XRP robot.
Definition
XRPRangefinder.hpp:18
wpi::xrp::XRPRangefinder::GetDistance
wpi::units::meter_t GetDistance() const
Get the measured distance in meters.
wpi::xrp
Definition
XRPOnBoardIO.hpp:13
wpi
xrp
XRPRangefinder.hpp
Generated on
for WPILibC++ by
1.15.0