CTRE_Phoenix  5.19.4
com.ctre.phoenix.motorcontrol.TalonSRXSimCollection Class Reference

Public Member Functions

 TalonSRXSimCollection (BaseTalon motorController)
 
ErrorCode setBusVoltage (double vbat)
 
ErrorCode setSupplyCurrent (double currA)
 
ErrorCode setStatorCurrent (double currA)
 
ErrorCode setLimitFwd (boolean isClosed)
 
ErrorCode setLimitRev (boolean isClosed)
 
ErrorCode setAnalogPosition (int newPos)
 
ErrorCode addAnalogPosition (int dPos)
 
ErrorCode setAnalogVelocity (int newVel)
 
ErrorCode setPulseWidthConnected (boolean isConnected)
 
ErrorCode setPulseWidthRiseToRiseUs (double periodUs)
 
ErrorCode setPulseWidthPosition (int newPos)
 
ErrorCode addPulseWidthPosition (int dPos)
 
ErrorCode setPulseWidthVelocity (int newVel)
 
ErrorCode setQuadratureRawPosition (int newPos)
 
ErrorCode addQuadraturePosition (int dPos)
 
ErrorCode setQuadratureVelocity (int newVel)
 

Detailed Description

Collection of simulation commands available to a TalonSRX motor controller.

Use the getSimCollection() routine inside your motor controller to create a sim collection.

Constructor & Destructor Documentation

◆ TalonSRXSimCollection()

com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.TalonSRXSimCollection ( BaseTalon  motorController)
inline

Constructor for TalonSRXSimCollection

Parameters
motorControllerMotor Controller to connect Collection to

Member Function Documentation

◆ addAnalogPosition()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.addAnalogPosition ( int  dPos)
inline

Adds to the simulated analog position of the TalonSRX.

Parameters
dPosthe change in position in native units
Returns
error code

◆ addPulseWidthPosition()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.addPulseWidthPosition ( int  dPos)
inline

Adds to the simulated pulse width position of the TalonSRX.

Parameters
dPosthe change in position in native units
Returns
error code

◆ addQuadraturePosition()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.addQuadraturePosition ( int  dPos)
inline

Adds to the simulated quadrature position of the TalonSRX.

Parameters
dPosthe change in position in native units
Returns
error code

◆ setAnalogPosition()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setAnalogPosition ( int  newPos)
inline

Sets the simulated analog position of the TalonSRX.

Parameters
newPosthe new position in native units
Returns
error code

◆ setAnalogVelocity()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setAnalogVelocity ( int  newVel)
inline

Sets the simulated analog velocity of the TalonSRX.

Parameters
newVelthe new velocity in native units per 100ms
Returns
error code

◆ setBusVoltage()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setBusVoltage ( double  vbat)
inline

Sets the simulated bus voltage of the TalonSRX.

Parameters
vbatthe bus voltage
Returns
error code

◆ setLimitFwd()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setLimitFwd ( boolean  isClosed)
inline

Sets the simulated forward limit switch of the TalonSRX.

Parameters
isClosedtrue if the limit switch is closed
Returns
error code

◆ setLimitRev()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setLimitRev ( boolean  isClosed)
inline

Sets the simulated reverse limit switch of the TalonSRX.

Parameters
isClosedtrue if the limit switch is closed
Returns
error code

◆ setPulseWidthConnected()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setPulseWidthConnected ( boolean  isConnected)
inline

Sets if the simulated pulse width sensor is connected to the TalonSRX.

Parameters
isConnectedtrue if the pulse width sensor is connected
Returns
error code

◆ setPulseWidthPosition()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setPulseWidthPosition ( int  newPos)
inline

Sets the simulated pulse width position of the TalonSRX.

Parameters
newPosthe new position in native units
Returns
error code

◆ setPulseWidthRiseToRiseUs()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setPulseWidthRiseToRiseUs ( double  periodUs)
inline

Sets the simulated pulse width rise to rise time of the TalonSRX.

Parameters
periodUsthe pulse width rise to rise time in microseconds
Returns
error code

◆ setPulseWidthVelocity()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setPulseWidthVelocity ( int  newVel)
inline

Sets the simulated pulse width velocity of the TalonSRX.

Parameters
newVelthe new velocity in native units per 100ms
Returns
error code

◆ setQuadratureRawPosition()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setQuadratureRawPosition ( int  newPos)
inline

Sets the simulated raw quadrature position of the TalonSRX.

The TalonSRX integrates this to calculate the true reported quadrature position.

When using the WPI Sim GUI, you will notice a readonly 'position' and settable 'rawPositionInput'. The readonly signal is the emulated position which will match self-test in Tuner and the hardware API. Changes to 'rawPositionInput' will be integrated into the emulated position. This way a simulator can modify the position without overriding your hardware API calls for home-ing your sensor.

Inputs to this function over time should be continuous, as user calls of setSelectedSensorPosition() and setQuadraturePosition() will be accounted for in the calculation.

Parameters
newPosthe new raw position in native units
Returns
error code

◆ setQuadratureVelocity()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setQuadratureVelocity ( int  newVel)
inline

Sets the simulated quadrature velocity of the TalonSRX.

Parameters
newVelthe new velocity in native units per 100ms
Returns
error code

◆ setStatorCurrent()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setStatorCurrent ( double  currA)
inline

Sets the simulated stator current of the TalonSRX.

Parameters
currAthe stator current in amps
Returns
error code

◆ setSupplyCurrent()

ErrorCode com.ctre.phoenix.motorcontrol.TalonSRXSimCollection.setSupplyCurrent ( double  currA)
inline

Sets the simulated supply current of the TalonSRX.

Parameters
currAthe supply current in amps
Returns
error code

The documentation for this class was generated from the following file: