WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
AnalogEncoderSim.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
9namespace wpi {
10
11class AnalogEncoder;
12
13namespace sim {
14
15/**
16 * Class to control a simulated analog encoder.
17 */
19 public:
20 /**
21 * Constructs from an AnalogEncoder object.
22 *
23 * @param encoder AnalogEncoder to simulate
24 */
25 explicit AnalogEncoderSim(const AnalogEncoder& encoder);
26
27 /**
28 * Set the position.
29 *
30 * @param value The position.
31 */
32 void Set(double value);
33
34 /**
35 * Get the simulated position.
36 */
37 double Get();
38
39 private:
40 wpi::hal::SimDouble m_positionSim;
41};
42} // namespace sim
43} // namespace wpi
Class for supporting continuous analog encoders, such as the US Digital MA3.
Definition AnalogEncoder.hpp:20
C++ wrapper around a HAL simulator double value handle.
Definition SimDevice.hpp:169
double Get()
Get the simulated position.
AnalogEncoderSim(const AnalogEncoder &encoder)
Constructs from an AnalogEncoder object.
void Set(double value)
Set the position.
Definition CTREPCMSim.hpp:13
Definition CvSource.hpp:15