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