Package com.revrobotics.sim
Class SparkFlexSim
java.lang.Object
com.revrobotics.spark.SparkSim
com.revrobotics.sim.SparkFlexSim
-
Constructor Summary
ConstructorDescriptionSparkFlexSim
(SparkFlex sparkFlex, DCMotor motor) Create a simulated CAN Spark Flex object. -
Method Summary
Modifier and TypeMethodDescriptionGet theSparkFlexExternalEncoderSim
object associated with this Spark Device.Methods inherited from class com.revrobotics.spark.SparkSim
disable, enable, getAbsoluteEncoderSim, getAnalogSensorSim, getAppliedOutput, getBusVoltage, getClosedLoopSlot, getFaultManager, getForwardLimitSwitchSim, getMotorCurrent, getPosition, getRelativeEncoderSim, getReverseLimitSwitchSim, getSetpoint, getVelocity, iterate, setAppliedOutput, setBusVoltage, setMotorCurrent, setPosition, setVelocity, useDriverStationEnable
-
Constructor Details
-
SparkFlexSim
Create a simulated CAN Spark Flex object. This class simulates some of the internal behavior of the device. This class is not required to display to the sim GUI, but is required to interact with it or inject physics simulation.See
SparkSim.iterate(double, double, double)
for more information on physics simulation.- Parameters:
sparkFlex
- The Spark to simulatemotor
- The WPILib DCMotor class object to use for calculations. If multiple motors are connected to the same gearbox and follow each other, a single DCMotor and CANSparkSim can be used to represent all of them.
-
-
Method Details
-
getExternalEncoderSim
Get theSparkFlexExternalEncoderSim
object associated with this Spark Device. This will allow you to read/write data from the simulated sensor and view it in the Sim GUI.- Returns:
- The
SparkFlexExternalEncoderSim
object associated with this Spark Device
-