Package com.revrobotics.spark.config
Class MAXMotionConfig
java.lang.Object
com.revrobotics.spark.config.BaseConfig
com.revrobotics.spark.config.MAXMotionConfig
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallowedClosedLoopError
(double allowedError) Set the allowed closed loop error for the MAXMotion mode of the controller.allowedClosedLoopError
(double allowedError, ClosedLoopConfig.ClosedLoopSlot slot) Set the allowed closed loop error for the MAXMotion mode of the controller for a specific PID slot.apply
(MAXMotionConfig config) Applies settings from anotherMAXMotionConfig
to this one.maxAcceleration
(double maxAcceleration) Set the maximum acceleration for the MAXMotion mode of the controller.maxAcceleration
(double maxAcceleration, ClosedLoopConfig.ClosedLoopSlot slot) Set the maximum acceleration for the MAXMotion mode of the controller for a specific closed loop slot.maxVelocity
(double maxVelocity) Set the maximum velocity for the MAXMotion mode of the controller.maxVelocity
(double maxVelocity, ClosedLoopConfig.ClosedLoopSlot slot) Set the maximum velocity for the MAXMotion mode of the controller for a specific closed loop slot.Set the MAXMotion position control mode of the controller.Set the MAXMotion position control mode of the controller for a specific closed loop slot.Methods inherited from class com.revrobotics.spark.config.BaseConfig
flatten
-
Constructor Details
-
MAXMotionConfig
public MAXMotionConfig()
-
-
Method Details
-
apply
Applies settings from anotherMAXMotionConfig
to this one.Settings in the provided config will overwrite existing values in this object. Settings not specified in the provided config remain unchanged.
- Parameters:
config
- TheMAXMotionConfig
to copy settings from- Returns:
- The updated
MAXMotionConfig
for method chaining
-
maxVelocity
Set the maximum velocity for the MAXMotion mode of the controller. This is the cruising velocity of the profile. Natively, the units are in RPM but will be affected by the velocity conversion factor.This will set the value for closed loop slot 0. To set the value for a specific closed loop slot, use
maxVelocity(double, ClosedLoopSlot)
.- Parameters:
maxVelocity
- The maximum velocity with the velocity conversion factor applied- Returns:
- The modified
MAXMotionConfig
object for method chaining
-
maxVelocity
Set the maximum velocity for the MAXMotion mode of the controller for a specific closed loop slot. This is the cruising velocity of the profile. Natively, the units are in RPM but will be affected by the velocity conversion factor.- Parameters:
maxVelocity
- The maximum velocity with the velocity conversion factor appliedslot
- The closed loop slot to set the values for- Returns:
- The modified
MAXMotionConfig
object for method chaining
-
maxAcceleration
Set the maximum acceleration for the MAXMotion mode of the controller. This is the rate at which the velocity will increase until the max velocity is reached. Natively, the units are in RPM per second but will be affected by the velocity conversion factor.This will set the value for closed loop slot 0. To set the value for a specific closed loop slot, use
maxAcceleration(double, ClosedLoopSlot)
.- Parameters:
maxAcceleration
- The maximum acceleration with the velocity conversion factor applied- Returns:
- The modified
MAXMotionConfig
object for method chaining
-
maxAcceleration
public MAXMotionConfig maxAcceleration(double maxAcceleration, ClosedLoopConfig.ClosedLoopSlot slot) Set the maximum acceleration for the MAXMotion mode of the controller for a specific closed loop slot. This is the rate at which the velocity will increase until the max velocity is reached. Natively, the units are in RPM per second but will be affected by the velocity conversion factor.- Parameters:
maxAcceleration
- The maximum acceleration with the velocity conversion factor appliedslot
- The closed loop slot to set the values for- Returns:
- The modified
MAXMotionConfig
object for method chaining
-
allowedClosedLoopError
Set the allowed closed loop error for the MAXMotion mode of the controller. This value is how much deviation from the setpoint is tolerated and is useful in preventing oscillation around the setpoint. Natively, the units are in rotations but will be affected by the position conversion factor.This will set the value for closed loop slot 0. To set the value for a specific closed loop slot, use
allowedClosedLoopError(double, ClosedLoopSlot)
.- Parameters:
allowedError
- The allowed error with the position conversion factor applied- Returns:
- The modified
MAXMotionConfig
object for method chaining
-
allowedClosedLoopError
public MAXMotionConfig allowedClosedLoopError(double allowedError, ClosedLoopConfig.ClosedLoopSlot slot) Set the allowed closed loop error for the MAXMotion mode of the controller for a specific PID slot. This value is how much deviation from the setpoint is tolerated and is useful in preventing oscillation around the setpoint. Natively, the units are in rotations but will be affected by the position conversion factor.- Parameters:
allowedError
- The allowed error with the position conversion factor appliedslot
- The closed loop slot to set the values for- Returns:
- The modified
MAXMotionConfig
object for method chaining
-
positionMode
Set the MAXMotion position control mode of the controller.This will set the value for closed loop slot 0. To set the value for a specific closed loop slot, use
positionMode(MAXMotionPositionMode, ClosedLoopSlot)
.- Parameters:
mode
- The MAXmotion position mode- Returns:
- The modified
MAXMotionConfig
object for method chaining
-
positionMode
public MAXMotionConfig positionMode(MAXMotionConfig.MAXMotionPositionMode mode, ClosedLoopConfig.ClosedLoopSlot slot) Set the MAXMotion position control mode of the controller for a specific closed loop slot.- Parameters:
mode
- The MAXmotion position modeslot
- The closed loop slot to set the values for- Returns:
- The modified
MAXMotionConfig
object for method chaining
-