Class Pigeon2SimState
Pigeon2
.-
Constructor Summary
ConstructorDescriptionPigeon2SimState
(CorePigeon2 device) Creates an object to control the state of the givenPigeon2
. -
Method Summary
Modifier and TypeMethodDescriptionaddYaw
(double dDeg) Adds to the simulated yaw of the Pigeon2.addYaw
(edu.wpi.first.units.measure.Angle dYaw) Adds to the simulated yaw of the Pigeon2.setAngularVelocityX
(double dps) Sets the simulated angular velocity X component of the Pigeon2.setAngularVelocityX
(edu.wpi.first.units.measure.AngularVelocity angularVel) Sets the simulated angular velocity X component of the Pigeon2.setAngularVelocityY
(double dps) Sets the simulated angular velocity Y component of the Pigeon2.setAngularVelocityY
(edu.wpi.first.units.measure.AngularVelocity angularVel) Sets the simulated angular velocity Y component of the Pigeon2.setAngularVelocityZ
(double dps) Sets the simulated angular velocity Z component of the Pigeon2.setAngularVelocityZ
(edu.wpi.first.units.measure.AngularVelocity angularVel) Sets the simulated angular velocity Z component of the Pigeon2.setPitch
(double deg) Sets the simulated pitch of the Pigeon2.setPitch
(edu.wpi.first.units.measure.Angle pitch) Sets the simulated pitch of the Pigeon2.setRawYaw
(double deg) Sets the simulated raw yaw of the Pigeon2.setRawYaw
(edu.wpi.first.units.measure.Angle yaw) Sets the simulated raw yaw of the Pigeon2.setRoll
(double deg) Sets the simulated roll of the Pigeon2.setRoll
(edu.wpi.first.units.measure.Angle roll) Sets the simulated roll of the Pigeon2.setSupplyVoltage
(double volts) Sets the simulated supply voltage of the Pigeon2.setSupplyVoltage
(edu.wpi.first.units.measure.Voltage voltage) Sets the simulated supply voltage of the Pigeon2.
-
Constructor Details
-
Pigeon2SimState
Creates an object to control the state of the givenPigeon2
.Note the recommended method of accessing simulation features is to use
CorePigeon2.getSimState()
- Parameters:
device
- Device to which this simulation state is attached
-
-
Method Details
-
setSupplyVoltage
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.
- Parameters:
volts
- The supply voltage in Volts- Returns:
- Status code
-
setSupplyVoltage
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.
- Parameters:
voltage
- The supply voltage- Returns:
- Status code
-
setRawYaw
Sets the simulated raw yaw of the Pigeon2.Inputs to this function over time should be continuous, as user calls of
CorePigeon2.setYaw(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 settablerawYawInput
. The readonly signal is the emulated yaw which will match self-test in Tuner and the hardware API. Changes torawYawInput
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.- Parameters:
deg
- The yaw in degrees- Returns:
- Status code
-
setRawYaw
Sets the simulated raw yaw of the Pigeon2.Inputs to this function over time should be continuous, as user calls of
CorePigeon2.setYaw(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 settablerawYawInput
. The readonly signal is the emulated yaw which will match self-test in Tuner and the hardware API. Changes torawYawInput
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.- Parameters:
yaw
- The yaw- Returns:
- Status code
-
addYaw
Adds to the simulated yaw of the Pigeon2.- Parameters:
dDeg
- The change in yaw in degrees- Returns:
- Status code
-
addYaw
Adds to the simulated yaw of the Pigeon2.- Parameters:
dYaw
- The change in yaw- Returns:
- Status code
-
setPitch
Sets the simulated pitch of the Pigeon2.- Parameters:
deg
- The pitch in degrees- Returns:
- Status code
-
setPitch
Sets the simulated pitch of the Pigeon2.- Parameters:
pitch
- The pitch- Returns:
- Status code
-
setRoll
Sets the simulated roll of the Pigeon2.- Parameters:
deg
- The roll in degrees- Returns:
- Status code
-
setRoll
Sets the simulated roll of the Pigeon2.- Parameters:
roll
- The roll- Returns:
- Status code
-
setAngularVelocityX
Sets the simulated angular velocity X component of the Pigeon2.- Parameters:
dps
- The X component of the angular velocity in degrees per second- Returns:
- Status code
-
setAngularVelocityX
Sets the simulated angular velocity X component of the Pigeon2.- Parameters:
angularVel
- The X component of the angular velocity- Returns:
- Status code
-
setAngularVelocityY
Sets the simulated angular velocity Y component of the Pigeon2.- Parameters:
dps
- The Y component of the angular velocity in degrees per second- Returns:
- Status code
-
setAngularVelocityY
Sets the simulated angular velocity Y component of the Pigeon2.- Parameters:
angularVel
- The Y component of the angular velocity- Returns:
- Status code
-
setAngularVelocityZ
Sets the simulated angular velocity Z component of the Pigeon2.- Parameters:
dps
- The Z component of the angular velocity in degrees per second- Returns:
- Status code
-
setAngularVelocityZ
Sets the simulated angular velocity Z component of the Pigeon2.- Parameters:
angularVel
- The Z component of the angular velocity- Returns:
- Status code
-