Collection of simulation commands available to a CANCoder.
Use the getSimCollection() routine inside your CANCoder to create the respective sim collection.
ErrorCode com.ctre.phoenix.sensors.CANCoderSimCollection.setRawPosition |
( |
int |
newPos | ) |
|
|
inline |
Sets the simulated raw position of the CANCoder.
The CANCoder integrates this to calculate the true reported 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 setPosition() will be accounted for in the calculation.
- Parameters
-
newPos | the new raw position in native units |
- Returns
- error code