Package org.texastorque.torquelib.legacy
Class TorqueSparkMax
java.lang.Object
org.texastorque.torquelib.legacy.base.TorqueMotor
org.texastorque.torquelib.legacy.TorqueSparkMax
- All Implemented Interfaces:
TorqueEncoderMotor
,TorquePIDMotor
,TorqueSmartMotor
Deprecated.
NOT SUITABLE FOR 2023
The Texas Torque wrapper for the SparkMax motor controller.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal double
Deprecated.Clicks per rotation on the motor encoder.Fields inherited from class org.texastorque.torquelib.legacy.base.TorqueMotor
port
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addFollower
(int port) Deprecated.Add a follower SparkMax.final void
addFollower
(int port, boolean invert) Deprecated.Add a follower SparkMax and optionally invert.final void
Deprecated.Burns the SparkMax flash.final void
Deprecated.Configure the CAN frames for a "dumb motor," which won't need to access CAN data often or at all.final void
Deprecated.Configure the CAN frames for a "dumb motor" leader, which won't give data often but will update fast for its follower.final void
Deprecated.Configures CAN frames to be quick on the lead motor.final void
configureIZone
(double iZone) Deprecated.I-Zone is now included in KPID.final void
configurePID
(TorquePID pid) Deprecated.Configures the PID controller for the motor.final void
configurePID
(KPID kPID) Deprecated.final void
Deprecated.Configures the CAN frame for a no-follower encoder-positional only sparkmax; such as would be in a climber.final void
configureSmartMotion
(double maxVelocity, double minVelocity, double maxAcceleration, double allowedError, int id) Deprecated.Configure needed variables for smart motion.final void
Deprecated.final double
Deprecated.Get the acceleration of the motor in encoder units per second per second.final double
Deprecated.Get the acceleration of the motor in RPM/s.final double
Deprecated.Get the acceleration of the motor in RPS/s.final double
Deprecated.Gets current used by the SparkMax.final double
Deprecated.Get the position of the motor in encoder units.final double
Deprecated.Get the position of the motor in degrees.final double
Deprecated.Get the position of the motor in rotations.final double
Deprecated.Get the velocity of the motor in encoder units per second.final double
Deprecated.Get the velocity of the motor in RPM.final double
Deprecated.Get the velocity of the motor in RPS.final double
Deprecated.Gets voltage used by the SparkMax.final void
invert
(boolean invert) Deprecated.Sets the inversion status of the lead motor.final void
Deprecated.Reduce the CAN frame interval for a follower.final void
Deprecated.Restores the lead SparkMax to factory defaults.final void
setCurrent
(double setpoint) Deprecated.Set the motor to output a certain current setpoint.final void
setEncoderZero
(double position) Deprecated.final void
setPercent
(double percent) Deprecated.Sets the output of the motor to the given percent.final void
setPosition
(double setpoint) Deprecated.Set the motor's position in encoder units.final void
setPositionConversionFactor
(double positionFactor) Deprecated.final void
setPositionDegrees
(double setpoint) Deprecated.Set the motor's position in degrees.final void
setPositionRotations
(double setpoint) Deprecated.Set the motor's position in rotations.final void
setSupplyLimit
(int limit) Deprecated.Set a supply limit for the SparkMax.final void
setVelocity
(double setpoint) Deprecated.Set the motor's velocity in encoder units per second.final void
setVelocityConversionFactor
(double velocityFactor) Deprecated.final void
setVelocityRPM
(double setpoint) Deprecated.Set the motor's velocity in RPM.final void
setVelocityRPS
(double setpoint) Deprecated.Set the motor's velocity in RPS.final void
setVoltage
(double setpoint) Deprecated.Set the motor to output a certain voltage setpoint.
-
Field Details
-
CLICKS_PER_ROTATION
public final double CLICKS_PER_ROTATIONDeprecated.Clicks per rotation on the motor encoder.
-
-
Constructor Details
-
TorqueSparkMax
public TorqueSparkMax(int port) Deprecated.Construct a new TorqueSparkMax motor.- Parameters:
port
- The port (ID) of the motor.
-
-
Method Details
-
addFollower
public final void addFollower(int port) Deprecated.Add a follower SparkMax.- Specified by:
addFollower
in classTorqueMotor
- Parameters:
port
- The port (ID) of the follower SparkMax.
-
addFollower
public final void addFollower(int port, boolean invert) Deprecated.Add a follower SparkMax and optionally invert.- Specified by:
addFollower
in classTorqueMotor
- Parameters:
port
- The port (ID) of the follower SparkMax.
-
invert
public final void invert(boolean invert) Deprecated.Sets the inversion status of the lead motor.- Specified by:
invert
in classTorqueMotor
- Parameters:
invert
- To invert or not to invert.
-
setPosition
public final void setPosition(double setpoint) Deprecated.Set the motor's position in encoder units.- Specified by:
setPosition
in interfaceTorquePIDMotor
- Parameters:
setpoint
- The encoder units to set the motor to.
-
configurePID
Deprecated.Configures the PID controller for the motor.- Specified by:
configurePID
in interfaceTorquePIDMotor
- Parameters:
kPID
- The KPID value to configure the motor too.
-
configurePID
Deprecated.Configures the PID controller for the motor.- Specified by:
configurePID
in interfaceTorquePIDMotor
- Parameters:
pid
- The PID to configure the motor with.
-
setPercent
public final void setPercent(double percent) Deprecated.Sets the output of the motor to the given percent.- Specified by:
setPercent
in classTorqueMotor
- Parameters:
percent
- The percent the motor should output at.
-
setVoltage
public final void setVoltage(double setpoint) Deprecated.Set the motor to output a certain voltage setpoint.- Specified by:
setVoltage
in classTorqueMotor
- Parameters:
setpoint
- The voltage to output.
-
setPositionDegrees
public final void setPositionDegrees(double setpoint) Deprecated.Set the motor's position in degrees.- Specified by:
setPositionDegrees
in interfaceTorquePIDMotor
- Parameters:
setpoint
- The degrees to set the motor to.
-
setPositionRotations
public final void setPositionRotations(double setpoint) Deprecated.Set the motor's position in rotations.- Specified by:
setPositionRotations
in interfaceTorquePIDMotor
- Parameters:
setpoint
- The rotations to set the motor to.
-
setVelocity
public final void setVelocity(double setpoint) Deprecated.Set the motor's velocity in encoder units per second.- Specified by:
setVelocity
in interfaceTorquePIDMotor
- Parameters:
setpoint
- The encoder units per second to set the motor to.
-
setVelocityRPS
public final void setVelocityRPS(double setpoint) Deprecated.Set the motor's velocity in RPS.- Specified by:
setVelocityRPS
in interfaceTorquePIDMotor
- Parameters:
setpoint
- The RPS to set the motor to.
-
setVelocityRPM
public final void setVelocityRPM(double setpoint) Deprecated.Set the motor's velocity in RPM.- Specified by:
setVelocityRPM
in interfaceTorquePIDMotor
- Parameters:
setpoint
- The RPM to set the motor to.
-
getPosition
public final double getPosition()Deprecated.Get the position of the motor in encoder units.- Specified by:
getPosition
in interfaceTorqueEncoderMotor
- Returns:
- The position of the encoder in encoder units.
-
getPositionDegrees
public final double getPositionDegrees()Deprecated.Get the position of the motor in degrees.- Specified by:
getPositionDegrees
in interfaceTorqueEncoderMotor
- Returns:
- The position of the encoder in degrees.
-
getPositionRotations
public final double getPositionRotations()Deprecated.Get the position of the motor in rotations.- Specified by:
getPositionRotations
in interfaceTorqueEncoderMotor
- Returns:
- The position of the encoder in rotations.
-
getVelocity
public final double getVelocity()Deprecated.Get the velocity of the motor in encoder units per second.- Specified by:
getVelocity
in interfaceTorqueEncoderMotor
- Returns:
- acceleration in encoder units per second.
-
getVelocityRPS
public final double getVelocityRPS()Deprecated.Get the velocity of the motor in RPS.- Specified by:
getVelocityRPS
in interfaceTorqueEncoderMotor
- Returns:
- acceleration in RPS.
-
getVelocityRPM
public final double getVelocityRPM()Deprecated.Get the velocity of the motor in RPM.- Specified by:
getVelocityRPM
in interfaceTorqueEncoderMotor
- Returns:
- acceleration in RPM.
-
getAcceleration
public final double getAcceleration()Deprecated.Get the acceleration of the motor in encoder units per second per second.- Specified by:
getAcceleration
in interfaceTorqueEncoderMotor
- Returns:
- acceleration in encoder units per second per second.
-
getAccelerationRPS
public final double getAccelerationRPS()Deprecated.Get the acceleration of the motor in RPS/s.- Specified by:
getAccelerationRPS
in interfaceTorqueEncoderMotor
- Returns:
- acceleration in RPM/s.
-
getAccelerationRPM
public final double getAccelerationRPM()Deprecated.Get the acceleration of the motor in RPM/s.- Specified by:
getAccelerationRPM
in interfaceTorqueEncoderMotor
- Returns:
- acceleration in RPM/s.
-
restoreFactoryDefaults
public final void restoreFactoryDefaults()Deprecated.Restores the lead SparkMax to factory defaults. -
disableVoltageCompensation
public final void disableVoltageCompensation()Deprecated. -
getVoltage
public final double getVoltage()Deprecated.Gets voltage used by the SparkMax.- Returns:
- The voltage used by the SparkMax.
-
getCurrent
public final double getCurrent()Deprecated.Gets current used by the SparkMax.- Returns:
- The current used by the SparkMax.
-
setCurrent
public final void setCurrent(double setpoint) Deprecated.Set the motor to output a certain current setpoint.- Parameters:
setpoint
- The current to output.
-
burnFlash
public final void burnFlash()Deprecated.Burns the SparkMax flash. -
configureIZone
Deprecated.I-Zone is now included in KPID.Configures an I-Zone on PID.- Parameters:
iZone
- The I-Zone value to set.
-
setSupplyLimit
public final void setSupplyLimit(int limit) Deprecated.Set a supply limit for the SparkMax.- Parameters:
limit
- max amps.
-
configureSmartMotion
public final void configureSmartMotion(double maxVelocity, double minVelocity, double maxAcceleration, double allowedError, int id) Deprecated.Configure needed variables for smart motion. - setSmartMotionMaxVelocity() will limit the velocity in RPM of the pid controller in Smart Motion mode - setSmartMotionMinOutputVelocity() will put a lower bound in RPM of the pid controller in Smart Motion mode - setSmartMotionMaxAccel() will limit the acceleration in RPM^2 of the pid controller in Smart Motion mode - setSmartMotionAllowedClosedLoopError() will set the max allowed error for the pid controller in Smart Motion mode- Parameters:
maxVelocity
- the max velocityminVelocity
- the min velocitymaxAcceleration
- the maxAccelerationallowedError
- the allowed amount of errorid
- the id for the pid (usually 0)
-
configureFastLeader
public final void configureFastLeader()Deprecated.Configures CAN frames to be quick on the lead motor. -
configureDumbCANFrame
public final void configureDumbCANFrame()Deprecated.Configure the CAN frames for a "dumb motor," which won't need to access CAN data often or at all. -
configureDumbLeaderCANFrame
public final void configureDumbLeaderCANFrame()Deprecated.Configure the CAN frames for a "dumb motor" leader, which won't give data often but will update fast for its follower. -
configurePositionalCANFrame
public final void configurePositionalCANFrame()Deprecated.Configures the CAN frame for a no-follower encoder-positional only sparkmax; such as would be in a climber. -
lowerFollowerCANFrame
public final void lowerFollowerCANFrame()Deprecated.Reduce the CAN frame interval for a follower. -
setPositionConversionFactor
public final void setPositionConversionFactor(double positionFactor) Deprecated. -
setVelocityConversionFactor
public final void setVelocityConversionFactor(double velocityFactor) Deprecated. -
setEncoderZero
public final void setEncoderZero(double position) Deprecated.
-