Class Pigeon2SimState
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
deviceCorePigeon2Device to which this simulation state is attached
Methods
AddYaw(double)
Adds to the simulated yaw of the Pigeon2.
public StatusCode AddYaw(double dDeg)
Parameters
dDegdoubleThe 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
dpsdoubleThe 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
dpsdoubleThe 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
dpsdoubleThe 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
degdoubleThe 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 readonlyyaw 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
degdoubleThe yaw in degrees
Returns
- StatusCode
Status code
SetRoll(double)
Sets the simulated roll of the Pigeon2.
public StatusCode SetRoll(double deg)
Parameters
degdoubleThe 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
voltsdoubleThe supply voltage in Volts
Returns
- StatusCode
Status code