WPILibC++
2025.1.1
Loading...
Searching...
No Matches
XRPRangefinder.h
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 <
frc/AnalogInput.h
>
8
9
#include <
units/length.h
>
10
11
namespace
frc
{
12
13
/**
14
* @ingroup xrp_api
15
* @{
16
*/
17
18
/** This class represents the ultrasonic rangefinder on an XRP robot. */
19
class
XRPRangefinder
{
20
public
:
21
/**
22
* Get the measured distance in meters. Distance further than 4m will be
23
* reported as 4m.
24
*
25
* @return distance in meters
26
*/
27
units::meter_t
GetDistance
()
const
;
28
29
private
:
30
frc::AnalogInput
m_rangefinder{2};
31
};
32
33
/** @} */
34
35
}
// namespace frc
frc::AnalogInput
Analog input class.
Definition
AnalogInput.h:32
frc::XRPRangefinder
This class represents the ultrasonic rangefinder on an XRP robot.
Definition
XRPRangefinder.h:19
frc::XRPRangefinder::GetDistance
units::meter_t GetDistance() const
Get the measured distance in meters.
length.h
frc
Definition
CAN.h:11
AnalogInput.h
frc
xrp
XRPRangefinder.h
Generated on Thu Jan 2 2025 00:19:46 for WPILibC++ by
1.12.0