WPILibC++ 2023.4.3-108-ge5452e3
frc::sim::AnalogEncoderSim Class Reference

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...
 

Detailed Description

Class to control a simulated analog encoder.

Constructor & Destructor Documentation

◆ AnalogEncoderSim()

frc::sim::AnalogEncoderSim::AnalogEncoderSim ( const AnalogEncoder encoder)
explicit

Constructs from an AnalogEncoder object.

Parameters
encoderAnalogEncoder to simulate

Member Function Documentation

◆ GetPosition()

Rotation2d frc::sim::AnalogEncoderSim::GetPosition ( )

Get the position as a Rotation2d.

◆ GetTurns()

units::turn_t frc::sim::AnalogEncoderSim::GetTurns ( )

Get the simulated position.

◆ SetPosition()

void frc::sim::AnalogEncoderSim::SetPosition ( Rotation2d  angle)

Set the position using an Rotation2d.

Parameters
angleThe angle.

◆ SetTurns()

void frc::sim::AnalogEncoderSim::SetTurns ( units::turn_t  turns)

Set the position of the encoder.

Parameters
turnsThe position.

The documentation for this class was generated from the following file: