AnalogGyroSim

class wpilib.simulation.AnalogGyroSim(*args, **kwargs)

Bases: pybind11_object

Class to control a simulated analog gyro.

Overloaded function.

  1. __init__(self: wpilib.simulation._simulation.AnalogGyroSim, gyro: wpilib._wpilib.AnalogGyro) -> None

Constructs from an AnalogGyro object.

Parameters:

gyro – AnalogGyro to simulate

  1. __init__(self: wpilib.simulation._simulation.AnalogGyroSim, channel: int) -> None

Constructs from an analog input channel number.

Parameters:

channel – Channel number

getAngle() float

Get the current angle of the gyro.

Returns:

the angle measured by the gyro

getInitialized() bool

Check if the gyro is initialized.

Returns:

true if initialized

getRate() float

Get the rate of angle change on this gyro.

Returns:

the rate

registerAngleCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback on the angle.

Parameters:
  • callback – the callback that will be called whenever the angle changes

  • initialNotify – if true, the callback will be run on the initial value

Returns:

the CallbackStore object associated with this callback

registerInitializedCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback on whether the gyro is initialized.

Parameters:
  • callback – the callback that will be called whenever the gyro is initialized

  • initialNotify – if true, the callback will be run on the initial value

Returns:

the CallbackStore object associated with this callback

registerRateCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback on the rate.

Parameters:
  • callback – the callback that will be called whenever the rate changes

  • initialNotify – if true, the callback will be run on the initial value

Returns:

the CallbackStore object associated with this callback

resetData() None

Reset all simulation data for this object.

setAngle(angle: float) None

Change the angle measured by the gyro.

Parameters:

angle – the new value

setInitialized(initialized: bool) None

Set whether this gyro is initialized.

Parameters:

initialized – the new value

setRate(rate: float) None

Change the rate of the gyro.

Parameters:

rate – the new rate