WPILibC++ 2025.0.0-alpha-1-9-ga2beb75
SharpIRSim.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 <hal/SimDevice.h>
8#include <units/length.h>
9
10#include "frc/SharpIR.h"
11
12namespace frc {
13
14/** Simulation class for Sharp IR sensors. */
16 public:
17 /**
18 * Constructor.
19 *
20 * @param sharpIR The real sensor to simulate
21 */
22 explicit SharpIRSim(const SharpIR& sharpIR);
23
24 /**
25 * Constructor.
26 *
27 * @param channel Analog channel for this sensor
28 */
29 explicit SharpIRSim(int channel);
30
31 /**
32 * Set the range returned by the distance sensor.
33 *
34 * @param rng range of the target returned by the sensor
35 */
36 void SetRange(units::centimeter_t rng);
37
38 private:
39 hal::SimDouble m_simRange;
40};
41
42} // namespace frc
Definition: SharpIR.h:16
Simulation class for Sharp IR sensors.
Definition: SharpIRSim.h:15
void SetRange(units::centimeter_t rng)
Set the range returned by the distance sensor.
SharpIRSim(const SharpIR &sharpIR)
Constructor.
SharpIRSim(int channel)
Constructor.
C++ wrapper around a HAL simulator double value handle.
Definition: SimDevice.h:536
Definition: AprilTagDetector_cv.h:11