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