Table of Contents

Class Pigeon2SimState

Namespace
CTRE.Phoenix6.Sim
Assembly
Phoenix6.Hardware.dll

Class to control the state of a simulated Pigeon2.

public class Pigeon2SimState
Inheritance
Pigeon2SimState
Inherited Members

Constructors

Pigeon2SimState(CorePigeon2)

Creates an object to control the state of the given Pigeon2.

Note the recommended method of accessing simulation features is to use SimState.
public Pigeon2SimState(CorePigeon2 device)

Parameters

device CorePigeon2

Device to which this simulation state is attached

Methods

AddYaw(double)

Adds to the simulated yaw of the Pigeon2.

public StatusCode AddYaw(double dDeg)

Parameters

dDeg double

The change in yaw in degrees

Returns

StatusCode

Status code

SetAngularVelocityX(double)

Sets the simulated angular velocity X component of the Pigeon2.

public StatusCode SetAngularVelocityX(double dps)

Parameters

dps double

The X component of the angular velocity in degrees per second

Returns

StatusCode

Status code

SetAngularVelocityY(double)

Sets the simulated angular velocity Y component of the Pigeon2.

public StatusCode SetAngularVelocityY(double dps)

Parameters

dps double

The Y component of the angular velocity in degrees per second

Returns

StatusCode

Status code

SetAngularVelocityZ(double)

Sets the simulated angular velocity Z component of the Pigeon2.

public StatusCode SetAngularVelocityZ(double dps)

Parameters

dps double

The Z component of the angular velocity in degrees per second

Returns

StatusCode

Status code

SetPitch(double)

Sets the simulated pitch of the Pigeon2.

public StatusCode SetPitch(double deg)

Parameters

deg double

The pitch in degrees

Returns

StatusCode

Status code

SetRawYaw(double)

Sets the simulated raw yaw of the Pigeon2.

Inputs to this function over time should be continuous, as user calls of SetYaw(double, double) will be accounted for in the callee.

The Pigeon2 integrates this to calculate the true reported yaw.

When using the WPI Sim GUI, you will notice a readonly yaw and settable rawYawInput. The readonly signal is the emulated yaw which will match self-test in Tuner and the hardware API. Changes to rawYawInput will be integrated into the emulated yaw. This way a simulator can modify the yaw without overriding hardware API calls for home-ing the sensor.
public StatusCode SetRawYaw(double deg)

Parameters

deg double

The yaw in degrees

Returns

StatusCode

Status code

SetRoll(double)

Sets the simulated roll of the Pigeon2.

public StatusCode SetRoll(double deg)

Parameters

deg double

The roll in degrees

Returns

StatusCode

Status code

SetSupplyVoltage(double)

Sets the simulated supply voltage of the Pigeon2.

The minimum allowed supply voltage is 4 V - values below this will be promoted to 4 V.
public StatusCode SetSupplyVoltage(double volts)

Parameters

volts double

The supply voltage in Volts

Returns

StatusCode

Status code