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
11namespace frc {
12
13/**
14 * @ingroup xrp_api
15 * @{
16 */
17
18/** This class represents the ultrasonic rangefinder on an XRP robot. */
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
Analog input class.
Definition AnalogInput.h:32
This class represents the ultrasonic rangefinder on an XRP robot.
Definition XRPRangefinder.h:19
units::meter_t GetDistance() const
Get the measured distance in meters.
Definition CAN.h:11