AnalogEncoderSim

class wpilib.simulation.AnalogEncoderSim(encoder: wpilib.AnalogEncoder)

Bases: pybind11_builtins.pybind11_object

Class to control a simulated analog encoder.

Constructs from an AnalogEncoder object.

Parameters

encoder – AnalogEncoder to simulate

getPosition()wpimath.geometry.Rotation2d

Get the position as a Rotation2d.

getTurns()turns

Get the simulated position.

setPosition(angle: wpimath.geometry.Rotation2d)None

Set the position using an Rotation2d.

Parameters

angle – The angle.

setTurns(turns: turns)None

Set the position of the encoder.

Parameters

turns – The position.