Class TalonFXSimState
@Deprecated(forRemoval=true) public class TalonFXSimState extends Object
TalonFX
.-
Field Summary
Fields Modifier and Type Field Description ChassisReference
Orientation
Deprecated, for removal: This API element is subject to removal in a future version.The orientation of the TalonFX relative to the robot chassis. -
Constructor Summary
Constructors Constructor Description TalonFXSimState(CoreTalonFX device)
Deprecated, for removal: This API element is subject to removal in a future version.Classes in the phoenixpro package will be removed in 2024.TalonFXSimState(CoreTalonFX device, ChassisReference orientation)
Deprecated, for removal: This API element is subject to removal in a future version.Classes in the phoenixpro package will be removed in 2024. -
Method Summary
Modifier and Type Method Description StatusCode
addRotorPosition(double dRotations)
Deprecated, for removal: This API element is subject to removal in a future version.Adds to the simulated rotor position of the TalonFX.StatusCode
getLastStatusCode()
Deprecated, for removal: This API element is subject to removal in a future version.Gets the last status code generated by a simulation function.double
getMotorVoltage()
Deprecated, for removal: This API element is subject to removal in a future version.Gets the simulated output voltage of the motor.double
getSupplyCurrent()
Deprecated, for removal: This API element is subject to removal in a future version.Gets the simulated supply current of the TalonFX.double
getTorqueCurrent()
Deprecated, for removal: This API element is subject to removal in a future version.Gets the simulated output torque current of the motor.StatusCode
setForwardLimit(boolean closed)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the simulated forward limit switch of the TalonFX.StatusCode
setRawRotorPosition(double rotations)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the simulated raw rotor position of the TalonFX.StatusCode
setReverseLimit(boolean closed)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the simulated reverse limit switch of the TalonFX.StatusCode
setRotorVelocity(double rps)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the simulated rotor velocity of the TalonFX.StatusCode
setSupplyVoltage(double volts)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the simulated supply voltage of the TalonFX.
-
Field Details
-
Orientation
Deprecated, for removal: This API element is subject to removal in a future version.The orientation of the TalonFX relative to the robot chassis.This value should not be changed based on the TalonFX invert. Rather, this value should be changed when the mechanical linkage between the TalonFX and the robot changes.
-
-
Constructor Details
-
TalonFXSimState
Deprecated, for removal: This API element is subject to removal in a future version.Classes in the phoenixpro package will be removed in 2024. Users should instead use classes from the phoenix6 package.Creates an object to control the state of the givenTalonFX
.This constructor defaults to a counter-clockwise positive orientation relative to the robot chassis.
- Parameters:
device
- Device to which this simulation state is attached
-
TalonFXSimState
@Deprecated(forRemoval=true) public TalonFXSimState(CoreTalonFX device, ChassisReference orientation)Deprecated, for removal: This API element is subject to removal in a future version.Classes in the phoenixpro package will be removed in 2024. Users should instead use classes from the phoenix6 package.Creates an object to control the state of the givenTalonFX
.- Parameters:
device
- Device to which this simulation state is attachedorientation
- Orientation of the device relative to the robot chassis
-
-
Method Details
-
getLastStatusCode
Deprecated, for removal: This API element is subject to removal in a future version.Gets the last status code generated by a simulation function.Not all functions return a status code but can potentially report errors. This function can be used to retrieve those status codes.
- Returns:
- Last status code generated by a simulation function
-
getMotorVoltage
Deprecated, for removal: This API element is subject to removal in a future version.Gets the simulated output voltage of the motor.- Returns:
- Voltage applied to the motor in Volts
-
getTorqueCurrent
Deprecated, for removal: This API element is subject to removal in a future version.Gets the simulated output torque current of the motor.- Returns:
- Torque current applied to the motor in Amperes
-
getSupplyCurrent
Deprecated, for removal: This API element is subject to removal in a future version.Gets the simulated supply current of the TalonFX.- Returns:
- Supply current of the TalonFX in Amperes
-
setSupplyVoltage
Deprecated, for removal: This API element is subject to removal in a future version.Sets the simulated supply voltage of the TalonFX.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
-
setForwardLimit
Deprecated, for removal: This API element is subject to removal in a future version.Sets the simulated forward limit switch of the TalonFX.- Parameters:
closed
- Whether the limit switch is closed- Returns:
- Status code
-
setReverseLimit
Deprecated, for removal: This API element is subject to removal in a future version.Sets the simulated reverse limit switch of the TalonFX.- Parameters:
closed
- Whether the limit switch is closed- Returns:
- Status code
-
setRawRotorPosition
Deprecated, for removal: This API element is subject to removal in a future version.Sets the simulated raw rotor position of the TalonFX.Inputs to this function over time should be continuous, as user calls of
CoreTalonFX.setRotorPosition(double, double)
will be accounted for in the callee.The TalonFX integrates this to calculate the true reported rotor position.
When using the WPI Sim GUI, you will notice a readonly
position
and settablerawPositionInput
. The readonly signal is the emulated position which will match self-test in Tuner and the hardware API. Changes torawPositionInput
will be integrated into the emulated position. This way a simulator can modify the position without overriding hardware API calls for home-ing the sensor.- Parameters:
rotations
- The raw position in rotations- Returns:
- Status code
-
addRotorPosition
Deprecated, for removal: This API element is subject to removal in a future version.Adds to the simulated rotor position of the TalonFX.- Parameters:
dRotations
- The change in position in rotations- Returns:
- Status code
-
setRotorVelocity
Deprecated, for removal: This API element is subject to removal in a future version.Sets the simulated rotor velocity of the TalonFX.- Parameters:
rps
- The new velocity in rotations per second- Returns:
- Status code
-