WPILibC++ 2023.4.3
|
Class to control a simulated analog encoder. More...
#include <frc/simulation/AnalogEncoderSim.h>
Public Member Functions | |
AnalogEncoderSim (const AnalogEncoder &encoder) | |
Constructs from an AnalogEncoder object. More... | |
void | SetPosition (Rotation2d angle) |
Set the position using an Rotation2d. More... | |
void | SetTurns (units::turn_t turns) |
Set the position of the encoder. More... | |
units::turn_t | GetTurns () |
Get the simulated position. More... | |
Rotation2d | GetPosition () |
Get the position as a Rotation2d. More... | |
Class to control a simulated analog encoder.
|
explicit |
Constructs from an AnalogEncoder object.
encoder | AnalogEncoder to simulate |
Rotation2d frc::sim::AnalogEncoderSim::GetPosition | ( | ) |
Get the position as a Rotation2d.
units::turn_t frc::sim::AnalogEncoderSim::GetTurns | ( | ) |
Get the simulated position.
void frc::sim::AnalogEncoderSim::SetPosition | ( | Rotation2d | angle | ) |
Set the position using an Rotation2d.
angle | The angle. |
void frc::sim::AnalogEncoderSim::SetTurns | ( | units::turn_t | turns | ) |
Set the position of the encoder.
turns | The position. |