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
8#include "wpi/units/length.hpp"
9
10namespace wpi::xrp {
11
12/**
13 * @ingroup xrp_api
14 * @{
15 */
16
17/** This class represents the ultrasonic rangefinder on an XRP robot. */
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
Analog input class.
Definition AnalogInput.hpp:29
This class represents the ultrasonic rangefinder on an XRP robot.
Definition XRPRangefinder.hpp:18
wpi::units::meter_t GetDistance() const
Get the measured distance in meters.
Definition XRPOnBoardIO.hpp:13