diff --git a/docs/allclasses-index.html b/docs/allclasses-index.html index 8e7c319..7373c73 100644 --- a/docs/allclasses-index.html +++ b/docs/allclasses-index.html @@ -1,11 +1,11 @@
- +Alert for if the absolute encoder's offset is set in the json instead of the hardware client.SwerveAbsoluteEncoder for the SwerveModule.SwerveDrive.attainableMaxRotationalVelocityRadiansPerSecond or
+ SwerveControllerConfiguration.maxAngularVelocity.SwerveDrive.attainableMaxTranslationalSpeedMetersPerSecond or
+ SwerveDrive.maxSpeedMPS whichever is higher.SwerveDrive.swerveController for the SwerveDrive which can be used to
@@ -490,7 +506,9 @@ loadScripts(document, 'script');
edu.wpi.first.math.Matrix<edu.wpi.first.math.numbers.N3,edu.wpi.first.math.numbers.N1> private final Alertedu.wpi.first.math.Matrix<edu.wpi.first.math.numbers.N3,edu.wpi.first.math.numbers.N1> addVisionMeasurement(Pose2d, double, Matrix)
with the calculated optimal standard deviation.SwerveDrivePoseEstimator and update the SwerveIMU gyro reading with
the given timestamp of the vision measurement.voiddrive(edu.wpi.first.math.geometry.Translation2d translation,
+private void
+
+
+Check all components to ensure that Tuner X Swerve Generator is recommended instead.
+
+void
+drive(edu.wpi.first.math.geometry.Translation2d translation,
double rotation,
boolean fieldRelative,
boolean isOpenLoop)
-
+
The primary method for controlling the drivebase.
-void
-drive(edu.wpi.first.math.geometry.Translation2d translation,
+void
+drive(edu.wpi.first.math.geometry.Translation2d translation,
double rotation,
boolean fieldRelative,
boolean isOpenLoop,
edu.wpi.first.math.geometry.Translation2d centerOfRotationMeters)
-
+
The primary method for controlling the drivebase.
-void
-drive(edu.wpi.first.math.kinematics.ChassisSpeeds velocity)
-
+void
+drive(edu.wpi.first.math.kinematics.ChassisSpeeds velocity)
+
Secondary method for controlling the drivebase.
-void
-drive(edu.wpi.first.math.kinematics.ChassisSpeeds velocity,
+void
+drive(edu.wpi.first.math.kinematics.ChassisSpeeds velocity,
boolean isOpenLoop,
edu.wpi.first.math.geometry.Translation2d centerOfRotationMeters)
-
+
The primary method for controlling the drivebase.
-void
-drive(edu.wpi.first.math.kinematics.ChassisSpeeds velocity,
+void
+drive(edu.wpi.first.math.kinematics.ChassisSpeeds velocity,
edu.wpi.first.math.geometry.Translation2d centerOfRotationMeters)
-
+
Secondary method for controlling the drivebase.
-void
-driveFieldOriented(edu.wpi.first.math.kinematics.ChassisSpeeds velocity)
-
-Secondary method of controlling the drive base given velocity and adjusting it for field oriented use.
-
void
-driveFieldOriented(edu.wpi.first.math.kinematics.ChassisSpeeds velocity,
- edu.wpi.first.math.geometry.Translation2d centerOfRotationMeters)
+driveFieldOriented(edu.wpi.first.math.kinematics.ChassisSpeeds velocity)
Secondary method of controlling the drive base given velocity and adjusting it for field oriented use.
-Optional<edu.wpi.first.math.geometry.Translation3d>
-getAccel()
+void
+driveFieldOriented(edu.wpi.first.math.kinematics.ChassisSpeeds velocity,
+ edu.wpi.first.math.geometry.Translation2d centerOfRotationMeters)
+Secondary method of controlling the drive base given velocity and adjusting it for field oriented use.
+
+Optional<edu.wpi.first.math.geometry.Translation3d>
+getAccel()
+
Gets current acceleration of the robot in m/s/s.
-edu.wpi.first.math.kinematics.ChassisSpeeds
-
-
+edu.wpi.first.math.kinematics.ChassisSpeeds
+
+
Gets the current field-relative velocity (x, y and omega) of the robot
-edu.wpi.first.math.geometry.Rotation3d
-
-
+edu.wpi.first.math.geometry.Rotation3d
+
+
Gets the current gyro Rotation3d of the robot, as reported by the imu.
-edu.wpi.first.math.kinematics.SwerveModulePosition[]
-
+double
+
+
+Get the maximum angular velocity, either attainableMaxRotationalVelocityRadiansPerSecond or
+ SwerveControllerConfiguration.maxAngularVelocity.
+
+double
+
+Get the maximum velocity from attainableMaxTranslationalSpeedMetersPerSecond or
+ maxSpeedMPS whichever is higher.
+
+edu.wpi.first.math.kinematics.SwerveModulePosition[]
+
+
Gets the current module positions (azimuth and wheel position (meters)).
-
-
-
+
+
+
Get the SwerveModules associated with the SwerveDrive.
-edu.wpi.first.math.geometry.Rotation2d
-getPitch()
-
+edu.wpi.first.math.geometry.Rotation2d
+getPitch()
+
Gets the current pitch angle of the robot, as reported by the imu.
-edu.wpi.first.math.geometry.Pose2d
-getPose()
-
+edu.wpi.first.math.geometry.Pose2d
+getPose()
+
Gets the current pose (position and rotation) of the robot, as reported by odometry.
-edu.wpi.first.math.kinematics.ChassisSpeeds
-
-
+edu.wpi.first.math.kinematics.ChassisSpeeds
+
+
Gets the current robot-relative velocity (x, y and omega) of the robot
-edu.wpi.first.math.geometry.Rotation2d
-getRoll()
-
+edu.wpi.first.math.geometry.Rotation2d
+getRoll()
+
Gets the current roll angle of the robot, as reported by the imu.
-edu.wpi.first.math.kinematics.SwerveModuleState[]
-
-
+edu.wpi.first.math.kinematics.SwerveModuleState[]
+
+
Gets the current module states (azimuth and velocity)
-
-
-
+
+
+
Helper function to get the swerveController for the SwerveDrive which can be used to
generate ChassisSpeeds for the robot to orient it correctly given axis or angles, and apply
SlewRateLimiter to given inputs.
-edu.wpi.first.math.geometry.Pose2d[]
-getSwerveModulePoses(edu.wpi.first.math.geometry.Pose2d robotPose)
-
+edu.wpi.first.math.geometry.Pose2d[]
+getSwerveModulePoses(edu.wpi.first.math.geometry.Pose2d robotPose)
+
Get the swerve module poses and on the field relative to the robot.
-edu.wpi.first.math.geometry.Rotation2d
-getYaw()
-
+edu.wpi.first.math.geometry.Rotation2d
+getYaw()
+
Gets the current yaw angle of the robot, as reported by the imu.
-void
-lockPose()
-
+void
+lockPose()
+
Point all modules toward the robot center, thus making the robot very difficult to move.
-void
-postTrajectory(edu.wpi.first.math.trajectory.Trajectory trajectory)
-
+void
+postTrajectory(edu.wpi.first.math.trajectory.Trajectory trajectory)
+
Post the trajectory to the field
-void
-
-
+void
+
+
Pushes the Absolute Encoder offsets to the Encoder or Motor Controller, depending on type.
-void
-replaceSwerveModuleFeedforward(edu.wpi.first.math.controller.SimpleMotorFeedforward feedforward)
-
+void
+replaceSwerveModuleFeedforward(edu.wpi.first.math.controller.SimpleMotorFeedforward feedforward)
+
Setup the swerve module feedforward.
-void
-
-
+void
+
+
Reset the drive encoders on the robot, useful when manually resetting the robot without a reboot, like in
autonomous.
-void
-resetOdometry(edu.wpi.first.math.geometry.Pose2d pose)
-
+void
+resetOdometry(edu.wpi.first.math.geometry.Pose2d pose)
+
Resets odometry to the given pose.
-void
-
-
+void
+
+
Restores Internal YAGSL Encoder offsets and sets the Encoder stored offset back to 0
-void
-setAngleMotorConversionFactor(double conversionFactor)
-
+void
+setAngleMotorConversionFactor(double conversionFactor)
+
Set the conversion factor for the angle/azimuth motor controller.
-void
-setChassisSpeeds(edu.wpi.first.math.kinematics.ChassisSpeeds chassisSpeeds)
-
+void
+setChassisSpeeds(edu.wpi.first.math.kinematics.ChassisSpeeds chassisSpeeds)
+
Set chassis speeds with closed-loop velocity control.
-void
-setDriveMotorConversionFactor(double conversionFactor)
-
+void
+setDriveMotorConversionFactor(double conversionFactor)
+
Set the conversion factor for the drive motor controller.
-void
-setGyro(edu.wpi.first.math.geometry.Rotation3d gyro)
-
+void
+setGyro(edu.wpi.first.math.geometry.Rotation3d gyro)
+
Set the expected gyroscope angle using a Rotation3d object.
-void
-setGyroOffset(edu.wpi.first.math.geometry.Rotation3d offset)
-
+void
+setGyroOffset(edu.wpi.first.math.geometry.Rotation3d offset)
+
Set the gyro scope offset to a desired known rotation.
-void
-setHeadingCorrection(boolean state)
-
+void
+setHeadingCorrection(boolean state)
+
Set the heading correction capabilities of YAGSL.
-void
-setMaximumSpeed(double maximumSpeed)
-
+void
+setMaximumSpeed(double maximumSpeed)
+
Set the maximum speed of the drive motors, modified maxSpeedMPS which is used for the
setRawModuleStates(SwerveModuleState[], boolean) function and
SwerveController.getTargetSpeeds(double, double, double, double, double) functions.
-void
-setMaximumSpeed(double maximumSpeed,
+void
+setMaximumSpeed(double maximumSpeed,
boolean updateModuleFeedforward,
double optimalVoltage)
-
+
Set the maximum speed of the drive motors, modified maxSpeedMPS which is used for the
setRawModuleStates(SwerveModuleState[], boolean) function and
SwerveController.getTargetSpeeds(double, double, double, double, double) functions.
-void
-setMaximumSpeeds(double attainableMaxModuleSpeedMetersPerSecond,
+void
+setMaximumSpeeds(double attainableMaxModuleSpeedMetersPerSecond,
double attainableMaxTranslationalSpeedMetersPerSecond,
double attainableMaxRotationalVelocityRadiansPerSecond)
-
+
Set the maximum speeds for desaturation.
-void
-setModuleStates(edu.wpi.first.math.kinematics.SwerveModuleState[] desiredStates,
+void
+setModuleStates(edu.wpi.first.math.kinematics.SwerveModuleState[] desiredStates,
boolean isOpenLoop)
-
+
Set the module states (azimuth and velocity) directly.
-void
-setMotorIdleMode(boolean brake)
-
+void
+setMotorIdleMode(boolean brake)
+
Sets the drive motors to brake/coast mode.
-void
-setOdometryPeriod(double period)
-
+void
+setOdometryPeriod(double period)
+
Set the odometry update period in seconds.
-private void
-setRawModuleStates(edu.wpi.first.math.kinematics.SwerveModuleState[] desiredStates,
+private void
+setRawModuleStates(edu.wpi.first.math.kinematics.SwerveModuleState[] desiredStates,
boolean isOpenLoop)
-
+
Set the module states (azimuth and velocity) directly.
-void
-
-
+void
+
+
Stop the odometry thread in favor of manually updating odometry.
-void
-
-
+void
+
+
Synchronize angle motor integrated encoders with data from absolute encoders.
-void
-
-
+void
+
+
Update odometry should be run every loop.
-void
-zeroGyro()
-
+void
+zeroGyro()
+
Resets the gyro angle to zero and resets odometry to the same position, but facing toward 0.
@@ -678,6 +700,13 @@ loadScripts(document, 'script');
Maximum speed of the robot in meters per second.
+
+
+tunerXRecommendation
+
+Alert to recommend Tuner X if the configuration is compatible.
+
+
@@ -716,6 +745,13 @@ loadScripts(document, 'script');
Method Details
-
+
+checkIfTunerXCompatible
+private void checkIfTunerXCompatible()
+Check all components to ensure that Tuner X Swerve Generator is recommended instead.
+
+
+-
setOdometryPeriod
public void setOdometryPeriod(double period)
@@ -904,6 +940,30 @@ loadScripts(document, 'script');
-
+
+getMaximumVelocity
+public double getMaximumVelocity()
+Get the maximum velocity from attainableMaxTranslationalSpeedMetersPerSecond or
+ maxSpeedMPS whichever is higher.
+
+- Returns:
+- Maximum speed in meters/second.
+
+
+
+-
+
+getMaximumAngularVelocity
+public double getMaximumAngularVelocity()
+Get the maximum angular velocity, either attainableMaxRotationalVelocityRadiansPerSecond or
+ SwerveControllerConfiguration.maxAngularVelocity.
+
+- Returns:
+- Maximum angular velocity in radians per second.
+
+
+
+-
setRawModuleStates
private void setRawModuleStates(edu.wpi.first.math.kinematics.SwerveModuleState[] desiredStates,
diff --git a/docs/swervelib/SwerveModule.html b/docs/swervelib/SwerveModule.html
index ccf3a14..e4b0a8b 100644
--- a/docs/swervelib/SwerveModule.html
+++ b/docs/swervelib/SwerveModule.html
@@ -1,11 +1,11 @@
-
+
SwerveModule
-
+
@@ -187,101 +187,106 @@ loadScripts(document, 'script');
Modifier and Type
Method
Description
-boolean
-
+
+
+Get the SwerveAbsoluteEncoder for the SwerveModule.
+
+boolean
+
+
Get if the last Absolute Encoder had a read issue, such as it does not exist.
-double
-
-
+double
+
+
Get the absolute position.
-
-
-
+
+
+
Get the angle SwerveMotor for the SwerveModule.
-
-
-
+
+
+
Fetch the SwerveModuleConfiguration for the SwerveModule with the parsed configurations.
-
-
-
+
+
+
Get the drive SwerveMotor for the SwerveModule.
-edu.wpi.first.math.kinematics.SwerveModulePosition
-
-
+edu.wpi.first.math.kinematics.SwerveModulePosition
+
+
Get the position of the swerve module.
-double
-
-
+double
+
+
Get the relative angle in degrees.
-edu.wpi.first.math.kinematics.SwerveModuleState
-getState()
-
+edu.wpi.first.math.kinematics.SwerveModuleState
+getState()
+
Get the Swerve Module state.
-void
-
-
+void
+
+
Push absolute encoder offset in the memory of the encoder or controller.
-void
-
-
+void
+
+
Queue synchronization of the integrated angle encoder with the absolute encoder.
-void
-
-
+void
+
+
Restore internal offset in YAGSL and either sets absolute encoder offset to 0 or restores old value.
-void
-setAngle(double angle)
-
+void
+setAngle(double angle)
+
Set the angle for the module.
-void
-setAngleMotorConversionFactor(double conversionFactor)
-
+void
+setAngleMotorConversionFactor(double conversionFactor)
+
Set the conversion factor for the angle/azimuth motor controller.
-void
-setAngleMotorVoltageCompensation(double optimalVoltage)
-
+void
+setAngleMotorVoltageCompensation(double optimalVoltage)
+
Set the voltage compensation for the swerve module motor.
-void
-setDesiredState(edu.wpi.first.math.kinematics.SwerveModuleState desiredState,
+void
+setDesiredState(edu.wpi.first.math.kinematics.SwerveModuleState desiredState,
boolean isOpenLoop,
boolean force)
-
+
Set the desired state of the swerve module.
-void
-setDriveMotorConversionFactor(double conversionFactor)
-
+void
+setDriveMotorConversionFactor(double conversionFactor)
+
Set the conversion factor for the drive motor controller.
-void
-setDriveMotorVoltageCompensation(double optimalVoltage)
-
+void
+setDriveMotorVoltageCompensation(double optimalVoltage)
+
Set the voltage compensation for the swerve module motor.
-void
-setMotorBrake(boolean brake)
-
+void
+setMotorBrake(boolean brake)
+
Set the brake mode.
-void
-
-
@@ -583,6 +588,17 @@ loadScripts(document, 'script');
-
+
+getAbsoluteEncoder
+
+Get the SwerveAbsoluteEncoder for the SwerveModule.
+
+- Returns:
+SwerveAbsoluteEncoder for the swerve module.
+
+
+
+-
getConfiguration
diff --git a/docs/swervelib/encoders/AnalogAbsoluteEncoderSwerve.html b/docs/swervelib/encoders/AnalogAbsoluteEncoderSwerve.html
index e4f854a..e1a9423 100644
--- a/docs/swervelib/encoders/AnalogAbsoluteEncoderSwerve.html
+++ b/docs/swervelib/encoders/AnalogAbsoluteEncoderSwerve.html
@@ -1,11 +1,11 @@
-
+
AnalogAbsoluteEncoderSwerve
-
+
diff --git a/docs/swervelib/encoders/CANCoderSwerve.html b/docs/swervelib/encoders/CANCoderSwerve.html
index eadf8cd..21b1f4f 100644
--- a/docs/swervelib/encoders/CANCoderSwerve.html
+++ b/docs/swervelib/encoders/CANCoderSwerve.html
@@ -1,11 +1,11 @@
-
+
CANCoderSwerve
-
+
diff --git a/docs/swervelib/encoders/CanAndCoderSwerve.html b/docs/swervelib/encoders/CanAndCoderSwerve.html
index 7226cea..611e65f 100644
--- a/docs/swervelib/encoders/CanAndCoderSwerve.html
+++ b/docs/swervelib/encoders/CanAndCoderSwerve.html
@@ -1,11 +1,11 @@
-
+
CanAndCoderSwerve
-
+
diff --git a/docs/swervelib/encoders/PWMDutyCycleEncoderSwerve.html b/docs/swervelib/encoders/PWMDutyCycleEncoderSwerve.html
index b66e922..b245b47 100644
--- a/docs/swervelib/encoders/PWMDutyCycleEncoderSwerve.html
+++ b/docs/swervelib/encoders/PWMDutyCycleEncoderSwerve.html
@@ -1,11 +1,11 @@
-
+
PWMDutyCycleEncoderSwerve
-
+
diff --git a/docs/swervelib/encoders/SparkMaxAnalogEncoderSwerve.html b/docs/swervelib/encoders/SparkMaxAnalogEncoderSwerve.html
index afd0650..33e61d6 100644
--- a/docs/swervelib/encoders/SparkMaxAnalogEncoderSwerve.html
+++ b/docs/swervelib/encoders/SparkMaxAnalogEncoderSwerve.html
@@ -1,11 +1,11 @@
-
+
SparkMaxAnalogEncoderSwerve
-
+
diff --git a/docs/swervelib/encoders/SparkMaxEncoderSwerve.html b/docs/swervelib/encoders/SparkMaxEncoderSwerve.html
index 417be30..a038f5f 100644
--- a/docs/swervelib/encoders/SparkMaxEncoderSwerve.html
+++ b/docs/swervelib/encoders/SparkMaxEncoderSwerve.html
@@ -1,11 +1,11 @@
-
+
SparkMaxEncoderSwerve
-
+
diff --git a/docs/swervelib/encoders/SwerveAbsoluteEncoder.html b/docs/swervelib/encoders/SwerveAbsoluteEncoder.html
index dd5ebca..cb27828 100644
--- a/docs/swervelib/encoders/SwerveAbsoluteEncoder.html
+++ b/docs/swervelib/encoders/SwerveAbsoluteEncoder.html
@@ -1,11 +1,11 @@
-
+
SwerveAbsoluteEncoder
-
+
diff --git a/docs/swervelib/encoders/package-summary.html b/docs/swervelib/encoders/package-summary.html
index e5c3a18..e847a9c 100644
--- a/docs/swervelib/encoders/package-summary.html
+++ b/docs/swervelib/encoders/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib.encoders
-
+
diff --git a/docs/swervelib/encoders/package-tree.html b/docs/swervelib/encoders/package-tree.html
index 964026a..0b72088 100644
--- a/docs/swervelib/encoders/package-tree.html
+++ b/docs/swervelib/encoders/package-tree.html
@@ -1,11 +1,11 @@
-
+
swervelib.encoders Class Hierarchy
-
+
diff --git a/docs/swervelib/imu/ADIS16448Swerve.html b/docs/swervelib/imu/ADIS16448Swerve.html
index 2d1f31b..9d856e5 100644
--- a/docs/swervelib/imu/ADIS16448Swerve.html
+++ b/docs/swervelib/imu/ADIS16448Swerve.html
@@ -1,11 +1,11 @@
-
+
ADIS16448Swerve
-
+
diff --git a/docs/swervelib/imu/ADIS16470Swerve.html b/docs/swervelib/imu/ADIS16470Swerve.html
index 6f60d23..53f94da 100644
--- a/docs/swervelib/imu/ADIS16470Swerve.html
+++ b/docs/swervelib/imu/ADIS16470Swerve.html
@@ -1,11 +1,11 @@
-
+
ADIS16470Swerve
-
+
diff --git a/docs/swervelib/imu/ADXRS450Swerve.html b/docs/swervelib/imu/ADXRS450Swerve.html
index 48fe70b..cd880d1 100644
--- a/docs/swervelib/imu/ADXRS450Swerve.html
+++ b/docs/swervelib/imu/ADXRS450Swerve.html
@@ -1,11 +1,11 @@
-
+
ADXRS450Swerve
-
+
diff --git a/docs/swervelib/imu/AnalogGyroSwerve.html b/docs/swervelib/imu/AnalogGyroSwerve.html
index a262ccc..35c928e 100644
--- a/docs/swervelib/imu/AnalogGyroSwerve.html
+++ b/docs/swervelib/imu/AnalogGyroSwerve.html
@@ -1,11 +1,11 @@
-
+
AnalogGyroSwerve
-
+
diff --git a/docs/swervelib/imu/NavXSwerve.html b/docs/swervelib/imu/NavXSwerve.html
index def3394..51a67ea 100644
--- a/docs/swervelib/imu/NavXSwerve.html
+++ b/docs/swervelib/imu/NavXSwerve.html
@@ -1,11 +1,11 @@
-
+
NavXSwerve
-
+
diff --git a/docs/swervelib/imu/Pigeon2Swerve.html b/docs/swervelib/imu/Pigeon2Swerve.html
index 75aa273..c755240 100644
--- a/docs/swervelib/imu/Pigeon2Swerve.html
+++ b/docs/swervelib/imu/Pigeon2Swerve.html
@@ -1,11 +1,11 @@
-
+
Pigeon2Swerve
-
+
diff --git a/docs/swervelib/imu/PigeonSwerve.html b/docs/swervelib/imu/PigeonSwerve.html
index ee191bf..e0015dc 100644
--- a/docs/swervelib/imu/PigeonSwerve.html
+++ b/docs/swervelib/imu/PigeonSwerve.html
@@ -1,11 +1,11 @@
-
+
PigeonSwerve
-
+
diff --git a/docs/swervelib/imu/SwerveIMU.html b/docs/swervelib/imu/SwerveIMU.html
index e601106..09ed4fb 100644
--- a/docs/swervelib/imu/SwerveIMU.html
+++ b/docs/swervelib/imu/SwerveIMU.html
@@ -1,11 +1,11 @@
-
+
SwerveIMU
-
+
diff --git a/docs/swervelib/imu/package-summary.html b/docs/swervelib/imu/package-summary.html
index a7c3bcd..b70a81f 100644
--- a/docs/swervelib/imu/package-summary.html
+++ b/docs/swervelib/imu/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib.imu
-
+
diff --git a/docs/swervelib/imu/package-tree.html b/docs/swervelib/imu/package-tree.html
index 5722446..42f6473 100644
--- a/docs/swervelib/imu/package-tree.html
+++ b/docs/swervelib/imu/package-tree.html
@@ -1,11 +1,11 @@
-
+
swervelib.imu Class Hierarchy
-
+
diff --git a/docs/swervelib/math/Matter.html b/docs/swervelib/math/Matter.html
index 27d5fa1..bdc9818 100644
--- a/docs/swervelib/math/Matter.html
+++ b/docs/swervelib/math/Matter.html
@@ -1,11 +1,11 @@
-
+
Matter
-
+
diff --git a/docs/swervelib/math/SwerveMath.html b/docs/swervelib/math/SwerveMath.html
index 718e199..5ff2bcf 100644
--- a/docs/swervelib/math/SwerveMath.html
+++ b/docs/swervelib/math/SwerveMath.html
@@ -1,11 +1,11 @@
-
+
SwerveMath
-
+
diff --git a/docs/swervelib/math/package-summary.html b/docs/swervelib/math/package-summary.html
index b53c127..ed2028f 100644
--- a/docs/swervelib/math/package-summary.html
+++ b/docs/swervelib/math/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib.math
-
+
diff --git a/docs/swervelib/math/package-tree.html b/docs/swervelib/math/package-tree.html
index 135f69f..4298f0f 100644
--- a/docs/swervelib/math/package-tree.html
+++ b/docs/swervelib/math/package-tree.html
@@ -1,11 +1,11 @@
-
+
swervelib.math Class Hierarchy
-
+
diff --git a/docs/swervelib/motors/SparkFlexSwerve.SparkMAX_slotIdx.html b/docs/swervelib/motors/SparkFlexSwerve.SparkMAX_slotIdx.html
index 5140720..b23c48f 100644
--- a/docs/swervelib/motors/SparkFlexSwerve.SparkMAX_slotIdx.html
+++ b/docs/swervelib/motors/SparkFlexSwerve.SparkMAX_slotIdx.html
@@ -1,11 +1,11 @@
-
+
SparkFlexSwerve.SparkMAX_slotIdx
-
+
diff --git a/docs/swervelib/motors/SparkFlexSwerve.html b/docs/swervelib/motors/SparkFlexSwerve.html
index 0ea86f6..399de6c 100644
--- a/docs/swervelib/motors/SparkFlexSwerve.html
+++ b/docs/swervelib/motors/SparkFlexSwerve.html
@@ -1,11 +1,11 @@
-
+
SparkFlexSwerve
-
+
diff --git a/docs/swervelib/motors/SparkMaxBrushedMotorSwerve.html b/docs/swervelib/motors/SparkMaxBrushedMotorSwerve.html
index 56611b5..6c6a3b5 100644
--- a/docs/swervelib/motors/SparkMaxBrushedMotorSwerve.html
+++ b/docs/swervelib/motors/SparkMaxBrushedMotorSwerve.html
@@ -1,11 +1,11 @@
-
+
SparkMaxBrushedMotorSwerve
-
+
diff --git a/docs/swervelib/motors/SparkMaxSwerve.SparkMAX_slotIdx.html b/docs/swervelib/motors/SparkMaxSwerve.SparkMAX_slotIdx.html
index 7143786..8ef3ff1 100644
--- a/docs/swervelib/motors/SparkMaxSwerve.SparkMAX_slotIdx.html
+++ b/docs/swervelib/motors/SparkMaxSwerve.SparkMAX_slotIdx.html
@@ -1,11 +1,11 @@
-
+
SparkMaxSwerve.SparkMAX_slotIdx
-
+
diff --git a/docs/swervelib/motors/SparkMaxSwerve.html b/docs/swervelib/motors/SparkMaxSwerve.html
index a6e8b3b..875c25a 100644
--- a/docs/swervelib/motors/SparkMaxSwerve.html
+++ b/docs/swervelib/motors/SparkMaxSwerve.html
@@ -1,11 +1,11 @@
-
+
SparkMaxSwerve
-
+
diff --git a/docs/swervelib/motors/SwerveMotor.html b/docs/swervelib/motors/SwerveMotor.html
index bdbcddb..b05c1d8 100644
--- a/docs/swervelib/motors/SwerveMotor.html
+++ b/docs/swervelib/motors/SwerveMotor.html
@@ -1,11 +1,11 @@
-
+
SwerveMotor
-
+
diff --git a/docs/swervelib/motors/TalonFXSwerve.html b/docs/swervelib/motors/TalonFXSwerve.html
index 90e93bc..36ebba4 100644
--- a/docs/swervelib/motors/TalonFXSwerve.html
+++ b/docs/swervelib/motors/TalonFXSwerve.html
@@ -1,11 +1,11 @@
-
+
TalonFXSwerve
-
+
@@ -103,24 +103,29 @@ loadScripts(document, 'script');
Current TalonFX configuration.
-private final boolean
-
+private double
+
+Conversion factor for the motor.
+
+private final boolean
+
+
Factory default already occurred.
-private final com.ctre.phoenix6.controls.MotionMagicVoltage
-
-
+private final com.ctre.phoenix6.controls.MotionMagicVoltage
+
+
Motion magic angle voltage setter.
-private final com.ctre.phoenix6.controls.VelocityVoltage
-
-
+private final com.ctre.phoenix6.controls.VelocityVoltage
+
+
Velocity voltage setter for controlling drive motor.
-(package private) com.ctre.phoenix6.hardware.TalonFX
-
-
@@ -354,6 +359,13 @@ loadScripts(document, 'script');
-
+
+conversionFactor
+private double conversionFactor
+Conversion factor for the motor.
+
+
+-
motor
com.ctre.phoenix6.hardware.TalonFX motor
diff --git a/docs/swervelib/motors/TalonSRXSwerve.html b/docs/swervelib/motors/TalonSRXSwerve.html
index 1f9bce1..15a0153 100644
--- a/docs/swervelib/motors/TalonSRXSwerve.html
+++ b/docs/swervelib/motors/TalonSRXSwerve.html
@@ -1,11 +1,11 @@
-
+
TalonSRXSwerve
-
+
diff --git a/docs/swervelib/motors/package-summary.html b/docs/swervelib/motors/package-summary.html
index a19e0bb..f1dcebe 100644
--- a/docs/swervelib/motors/package-summary.html
+++ b/docs/swervelib/motors/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib.motors
-
+
diff --git a/docs/swervelib/motors/package-tree.html b/docs/swervelib/motors/package-tree.html
index be3ac35..bc17137 100644
--- a/docs/swervelib/motors/package-tree.html
+++ b/docs/swervelib/motors/package-tree.html
@@ -1,11 +1,11 @@
-
+
swervelib.motors Class Hierarchy
-
+
diff --git a/docs/swervelib/package-summary.html b/docs/swervelib/package-summary.html
index 8391586..8886d87 100644
--- a/docs/swervelib/package-summary.html
+++ b/docs/swervelib/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib
-
+
diff --git a/docs/swervelib/package-tree.html b/docs/swervelib/package-tree.html
index 7d10c5c..76287be 100644
--- a/docs/swervelib/package-tree.html
+++ b/docs/swervelib/package-tree.html
@@ -1,11 +1,11 @@
-
+
swervelib Class Hierarchy
-
+
diff --git a/docs/swervelib/parser/PIDFConfig.html b/docs/swervelib/parser/PIDFConfig.html
index cb63ce7..e2d8f0c 100644
--- a/docs/swervelib/parser/PIDFConfig.html
+++ b/docs/swervelib/parser/PIDFConfig.html
@@ -1,11 +1,11 @@
-
+
PIDFConfig
-
+
diff --git a/docs/swervelib/parser/SwerveControllerConfiguration.html b/docs/swervelib/parser/SwerveControllerConfiguration.html
index e6a6ec4..0feed05 100644
--- a/docs/swervelib/parser/SwerveControllerConfiguration.html
+++ b/docs/swervelib/parser/SwerveControllerConfiguration.html
@@ -1,11 +1,11 @@
-
+
SwerveControllerConfiguration
-
+
diff --git a/docs/swervelib/parser/SwerveDriveConfiguration.html b/docs/swervelib/parser/SwerveDriveConfiguration.html
index c9f24d6..ba0498d 100644
--- a/docs/swervelib/parser/SwerveDriveConfiguration.html
+++ b/docs/swervelib/parser/SwerveDriveConfiguration.html
@@ -1,11 +1,11 @@
-
+
SwerveDriveConfiguration
-
+
@@ -163,7 +163,7 @@ loadScripts(document, 'script');
double
-Assume the first module is the furthest.
+Calculate the Drive Base Radius
@@ -279,7 +279,7 @@ loadScripts(document, 'script');
getDriveBaseRadiusMeters
public double getDriveBaseRadiusMeters()
-Assume the first module is the furthest. Usually front-left.
+Calculate the Drive Base Radius
- Returns:
- Drive base radius from center of robot to the farthest wheel in meters.
diff --git a/docs/swervelib/parser/SwerveModuleConfiguration.html b/docs/swervelib/parser/SwerveModuleConfiguration.html
index 1e77243..5b96858 100644
--- a/docs/swervelib/parser/SwerveModuleConfiguration.html
+++ b/docs/swervelib/parser/SwerveModuleConfiguration.html
@@ -1,11 +1,11 @@
-
+
SwerveModuleConfiguration
-
+
diff --git a/docs/swervelib/parser/SwerveModulePhysicalCharacteristics.html b/docs/swervelib/parser/SwerveModulePhysicalCharacteristics.html
index b272e44..913dc87 100644
--- a/docs/swervelib/parser/SwerveModulePhysicalCharacteristics.html
+++ b/docs/swervelib/parser/SwerveModulePhysicalCharacteristics.html
@@ -1,11 +1,11 @@
-
+
SwerveModulePhysicalCharacteristics
-
+
diff --git a/docs/swervelib/parser/SwerveParser.html b/docs/swervelib/parser/SwerveParser.html
index fd2d538..f4295c0 100644
--- a/docs/swervelib/parser/SwerveParser.html
+++ b/docs/swervelib/parser/SwerveParser.html
@@ -1,11 +1,11 @@
-
+
SwerveParser
-
+
diff --git a/docs/swervelib/parser/deserializer/PIDFRange.html b/docs/swervelib/parser/deserializer/PIDFRange.html
index d6c629e..784c2fa 100644
--- a/docs/swervelib/parser/deserializer/PIDFRange.html
+++ b/docs/swervelib/parser/deserializer/PIDFRange.html
@@ -1,11 +1,11 @@
-
+
PIDFRange
-
+
diff --git a/docs/swervelib/parser/deserializer/package-summary.html b/docs/swervelib/parser/deserializer/package-summary.html
index 70c2bed..19e670f 100644
--- a/docs/swervelib/parser/deserializer/package-summary.html
+++ b/docs/swervelib/parser/deserializer/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib.parser.deserializer
-
+
diff --git a/docs/swervelib/parser/deserializer/package-tree.html b/docs/swervelib/parser/deserializer/package-tree.html
index 284fed0..3202a45 100644
--- a/docs/swervelib/parser/deserializer/package-tree.html
+++ b/docs/swervelib/parser/deserializer/package-tree.html
@@ -1,11 +1,11 @@
-
+
swervelib.parser.deserializer Class Hierarchy
-
+
diff --git a/docs/swervelib/parser/json/ControllerPropertiesJson.html b/docs/swervelib/parser/json/ControllerPropertiesJson.html
index c833d89..ca2d3ac 100644
--- a/docs/swervelib/parser/json/ControllerPropertiesJson.html
+++ b/docs/swervelib/parser/json/ControllerPropertiesJson.html
@@ -1,11 +1,11 @@
-
+
ControllerPropertiesJson
-
+
diff --git a/docs/swervelib/parser/json/DeviceJson.html b/docs/swervelib/parser/json/DeviceJson.html
index b39d9de..89b4633 100644
--- a/docs/swervelib/parser/json/DeviceJson.html
+++ b/docs/swervelib/parser/json/DeviceJson.html
@@ -1,11 +1,11 @@
-
+
DeviceJson
-
+
diff --git a/docs/swervelib/parser/json/ModuleJson.html b/docs/swervelib/parser/json/ModuleJson.html
index fede32e..130e49f 100644
--- a/docs/swervelib/parser/json/ModuleJson.html
+++ b/docs/swervelib/parser/json/ModuleJson.html
@@ -1,11 +1,11 @@
-
+
ModuleJson
-
+
diff --git a/docs/swervelib/parser/json/MotorConfigDouble.html b/docs/swervelib/parser/json/MotorConfigDouble.html
index 5cc7fe6..89718fe 100644
--- a/docs/swervelib/parser/json/MotorConfigDouble.html
+++ b/docs/swervelib/parser/json/MotorConfigDouble.html
@@ -1,11 +1,11 @@
-
+
MotorConfigDouble
-
+
diff --git a/docs/swervelib/parser/json/MotorConfigInt.html b/docs/swervelib/parser/json/MotorConfigInt.html
index b294108..e77594b 100644
--- a/docs/swervelib/parser/json/MotorConfigInt.html
+++ b/docs/swervelib/parser/json/MotorConfigInt.html
@@ -1,11 +1,11 @@
-
+
MotorConfigInt
-
+
diff --git a/docs/swervelib/parser/json/PIDFPropertiesJson.html b/docs/swervelib/parser/json/PIDFPropertiesJson.html
index 3c1e8d4..3cd60e5 100644
--- a/docs/swervelib/parser/json/PIDFPropertiesJson.html
+++ b/docs/swervelib/parser/json/PIDFPropertiesJson.html
@@ -1,11 +1,11 @@
-
+
PIDFPropertiesJson
-
+
diff --git a/docs/swervelib/parser/json/PhysicalPropertiesJson.html b/docs/swervelib/parser/json/PhysicalPropertiesJson.html
index 0216fa7..1d51528 100644
--- a/docs/swervelib/parser/json/PhysicalPropertiesJson.html
+++ b/docs/swervelib/parser/json/PhysicalPropertiesJson.html
@@ -1,11 +1,11 @@
-
+
PhysicalPropertiesJson
-
+
diff --git a/docs/swervelib/parser/json/SwerveDriveJson.html b/docs/swervelib/parser/json/SwerveDriveJson.html
index 1dbb187..c0b83cf 100644
--- a/docs/swervelib/parser/json/SwerveDriveJson.html
+++ b/docs/swervelib/parser/json/SwerveDriveJson.html
@@ -1,11 +1,11 @@
-
+
SwerveDriveJson
-
+
diff --git a/docs/swervelib/parser/json/modules/BoolMotorJson.html b/docs/swervelib/parser/json/modules/BoolMotorJson.html
index 8d2882f..334ca7c 100644
--- a/docs/swervelib/parser/json/modules/BoolMotorJson.html
+++ b/docs/swervelib/parser/json/modules/BoolMotorJson.html
@@ -1,11 +1,11 @@
-
+
BoolMotorJson
-
+
diff --git a/docs/swervelib/parser/json/modules/LocationJson.html b/docs/swervelib/parser/json/modules/LocationJson.html
index 0aa9390..c3ad072 100644
--- a/docs/swervelib/parser/json/modules/LocationJson.html
+++ b/docs/swervelib/parser/json/modules/LocationJson.html
@@ -1,11 +1,11 @@
-
+
LocationJson
-
+
diff --git a/docs/swervelib/parser/json/modules/package-summary.html b/docs/swervelib/parser/json/modules/package-summary.html
index adfe9e6..01d4398 100644
--- a/docs/swervelib/parser/json/modules/package-summary.html
+++ b/docs/swervelib/parser/json/modules/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib.parser.json.modules
-
+
diff --git a/docs/swervelib/parser/json/modules/package-tree.html b/docs/swervelib/parser/json/modules/package-tree.html
index 85125c7..1cd0c08 100644
--- a/docs/swervelib/parser/json/modules/package-tree.html
+++ b/docs/swervelib/parser/json/modules/package-tree.html
@@ -1,11 +1,11 @@
-
+
swervelib.parser.json.modules Class Hierarchy
-
+
diff --git a/docs/swervelib/parser/json/package-summary.html b/docs/swervelib/parser/json/package-summary.html
index e01d91a..205992a 100644
--- a/docs/swervelib/parser/json/package-summary.html
+++ b/docs/swervelib/parser/json/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib.parser.json
-
+
diff --git a/docs/swervelib/parser/json/package-tree.html b/docs/swervelib/parser/json/package-tree.html
index 51a4eda..6d6e168 100644
--- a/docs/swervelib/parser/json/package-tree.html
+++ b/docs/swervelib/parser/json/package-tree.html
@@ -1,11 +1,11 @@
-
+
swervelib.parser.json Class Hierarchy
-
+
diff --git a/docs/swervelib/parser/package-summary.html b/docs/swervelib/parser/package-summary.html
index aed9151..ae7b217 100644
--- a/docs/swervelib/parser/package-summary.html
+++ b/docs/swervelib/parser/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib.parser
-
+
diff --git a/docs/swervelib/parser/package-tree.html b/docs/swervelib/parser/package-tree.html
index 6837783..fcb4815 100644
--- a/docs/swervelib/parser/package-tree.html
+++ b/docs/swervelib/parser/package-tree.html
@@ -1,11 +1,11 @@
-
+
swervelib.parser Class Hierarchy
-
+
diff --git a/docs/swervelib/simulation/SwerveIMUSimulation.html b/docs/swervelib/simulation/SwerveIMUSimulation.html
index 54b4163..bff9495 100644
--- a/docs/swervelib/simulation/SwerveIMUSimulation.html
+++ b/docs/swervelib/simulation/SwerveIMUSimulation.html
@@ -1,11 +1,11 @@
-
+
SwerveIMUSimulation
-
+
diff --git a/docs/swervelib/simulation/SwerveModuleSimulation.html b/docs/swervelib/simulation/SwerveModuleSimulation.html
index 0a81674..1ae8eaf 100644
--- a/docs/swervelib/simulation/SwerveModuleSimulation.html
+++ b/docs/swervelib/simulation/SwerveModuleSimulation.html
@@ -1,11 +1,11 @@
-
+
SwerveModuleSimulation
-
+
diff --git a/docs/swervelib/simulation/package-summary.html b/docs/swervelib/simulation/package-summary.html
index 5327ce5..79d3f46 100644
--- a/docs/swervelib/simulation/package-summary.html
+++ b/docs/swervelib/simulation/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib.simulation
-
+
diff --git a/docs/swervelib/simulation/package-tree.html b/docs/swervelib/simulation/package-tree.html
index 9f5f0fd..c1fd4e2 100644
--- a/docs/swervelib/simulation/package-tree.html
+++ b/docs/swervelib/simulation/package-tree.html
@@ -1,11 +1,11 @@
-
+
swervelib.simulation Class Hierarchy
-
+
diff --git a/docs/swervelib/telemetry/Alert.AlertType.html b/docs/swervelib/telemetry/Alert.AlertType.html
index 5fac1bf..00541fa 100644
--- a/docs/swervelib/telemetry/Alert.AlertType.html
+++ b/docs/swervelib/telemetry/Alert.AlertType.html
@@ -1,11 +1,11 @@
-
+
Alert.AlertType
-
+
diff --git a/docs/swervelib/telemetry/Alert.SendableAlerts.html b/docs/swervelib/telemetry/Alert.SendableAlerts.html
index 7fbcb24..572b8cc 100644
--- a/docs/swervelib/telemetry/Alert.SendableAlerts.html
+++ b/docs/swervelib/telemetry/Alert.SendableAlerts.html
@@ -1,11 +1,11 @@
-
+
Alert.SendableAlerts
-
+
@@ -87,6 +87,7 @@ loadScripts(document, 'script');
private static class Alert.SendableAlerts
extends Object
implements edu.wpi.first.util.sendable.Sendable
+Sendable alert for advantage scope.
@@ -101,7 +102,9 @@ implements edu.wpi.first.util.sendable.Sendable
Description
-
+
+Alert list for sendable.
+
@@ -133,7 +136,9 @@ implements edu.wpi.first.util.sendable.Sendable
Description
String[]
getStrings(Alert.AlertType type)
-
+
+Get alerts based off of type.
+
void
initSendable(edu.wpi.first.util.sendable.SendableBuilder builder)
@@ -158,6 +163,7 @@ implements edu.wpi.first.util.sendable.Sendable
alerts
+Alert list for sendable.
@@ -186,6 +192,13 @@ implements edu.wpi.first.util.sendable.Sendable
getStrings
+Get alerts based off of type.
+
+- Parameters:
+type - Type of alert to fetch.
+- Returns:
+- Active alert strings.
+
-
diff --git a/docs/swervelib/telemetry/Alert.html b/docs/swervelib/telemetry/Alert.html
index f7fbf24..a6831ae 100644
--- a/docs/swervelib/telemetry/Alert.html
+++ b/docs/swervelib/telemetry/Alert.html
@@ -1,11 +1,11 @@
-
+
Alert
-
+
@@ -98,7 +98,9 @@ loadScripts(document, 'script');
private static class
-
+
+Sendable alert for advantage scope.
+
@@ -113,19 +115,29 @@ loadScripts(document, 'script');
Description
private boolean
-
+
+Activation state of alert.
+
private double
-
+
+When the alert was raised.
+
private static Map<String,Alert.SendableAlerts>
-
+
+Group of the alert.
+
private String
-
+
+Text of the alert.
+
private final Alert.AlertType
-
+
+Type of the Alert to raise.
+
@@ -193,30 +205,35 @@ loadScripts(document, 'script');
groups
+Group of the alert.
-
type
+Type of the Alert to raise.
-
active
private boolean active
+Activation state of alert.
-
activeStartTime
private double activeStartTime
+When the alert was raised.
-
text
+Text of the alert.
@@ -271,6 +288,10 @@ loadScripts(document, 'script');
public void set(boolean active)
Sets whether the alert should currently be displayed. When activated, the alert text will also be sent to the
console.
+
+- Parameters:
+active - Set the alert as active and report it to the driver station.
+
-
@@ -278,6 +299,10 @@ loadScripts(document, 'script');
setText
Updates current alert text.
+
+- Parameters:
+text - The text for the alert.
+
diff --git a/docs/swervelib/telemetry/SwerveDriveTelemetry.TelemetryVerbosity.html b/docs/swervelib/telemetry/SwerveDriveTelemetry.TelemetryVerbosity.html
index 98bfb17..26005bb 100644
--- a/docs/swervelib/telemetry/SwerveDriveTelemetry.TelemetryVerbosity.html
+++ b/docs/swervelib/telemetry/SwerveDriveTelemetry.TelemetryVerbosity.html
@@ -1,11 +1,11 @@
-
+
SwerveDriveTelemetry.TelemetryVerbosity
-
+
diff --git a/docs/swervelib/telemetry/SwerveDriveTelemetry.html b/docs/swervelib/telemetry/SwerveDriveTelemetry.html
index 91f0b78..97954ff 100644
--- a/docs/swervelib/telemetry/SwerveDriveTelemetry.html
+++ b/docs/swervelib/telemetry/SwerveDriveTelemetry.html
@@ -1,11 +1,11 @@
-
+
SwerveDriveTelemetry
-
+
diff --git a/docs/swervelib/telemetry/package-summary.html b/docs/swervelib/telemetry/package-summary.html
index e2d2e11..b01ae51 100644
--- a/docs/swervelib/telemetry/package-summary.html
+++ b/docs/swervelib/telemetry/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib.telemetry
-
+
@@ -98,7 +98,9 @@ loadScripts(document, 'script');
Represents an alert's level of urgency.
-
+
+Sendable alert for advantage scope.
+
Telemetry to describe the SwerveDrive following frc-web-components.
diff --git a/docs/swervelib/telemetry/package-tree.html b/docs/swervelib/telemetry/package-tree.html
index c253900..2e86300 100644
--- a/docs/swervelib/telemetry/package-tree.html
+++ b/docs/swervelib/telemetry/package-tree.html
@@ -1,11 +1,11 @@
-
+
swervelib.telemetry Class Hierarchy
-
+
diff --git a/swervelib/SwerveDrive.java b/swervelib/SwerveDrive.java
index aeef17b..5e6874d 100644
--- a/swervelib/SwerveDrive.java
+++ b/swervelib/SwerveDrive.java
@@ -28,11 +28,16 @@ import java.util.List;
import java.util.Optional;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
+import swervelib.encoders.CANCoderSwerve;
+import swervelib.imu.Pigeon2Swerve;
import swervelib.imu.SwerveIMU;
import swervelib.math.SwerveMath;
+import swervelib.motors.TalonFXSwerve;
import swervelib.parser.SwerveControllerConfiguration;
import swervelib.parser.SwerveDriveConfiguration;
import swervelib.simulation.SwerveIMUSimulation;
+import swervelib.telemetry.Alert;
+import swervelib.telemetry.Alert.AlertType;
import swervelib.telemetry.SwerveDriveTelemetry;
import swervelib.telemetry.SwerveDriveTelemetry.TelemetryVerbosity;
@@ -139,6 +144,13 @@ public class SwerveDrive
* Maximum speed of the robot in meters per second.
*/
private double maxSpeedMPS;
+ /**
+ * Alert to recommend Tuner X if the configuration is compatible.
+ */
+ private final Alert tunerXRecommendation = new Alert("Swerve Drive",
+ "Your Swerve Drive is compatible with Tuner X swerve generator, please consider using that instead of YAGSL. More information here!\n" +
+ "https://pro.docs.ctr-electronics.com/en/latest/docs/tuner/tuner-swerve/index.html",
+ AlertType.WARNING);
/**
* Creates a new swerve drivebase subsystem. Robot is controlled via the {@link SwerveDrive#drive} method, or via the
@@ -224,6 +236,29 @@ public class SwerveDrive
odometryThread.startPeriodic(SwerveDriveTelemetry.isSimulation ? 0.01 : 0.02);
}
+ /**
+ * Check all components to ensure that Tuner X Swerve Generator is recommended instead.
+ */
+ private void checkIfTunerXCompatible()
+ {
+ boolean compatible = imu instanceof Pigeon2Swerve;
+ for (SwerveModule module : swerveModules)
+ {
+ compatible = compatible && module.getDriveMotor() instanceof TalonFXSwerve &&
+ module.getAngleMotor() instanceof TalonFXSwerve &&
+ module.getAbsoluteEncoder() instanceof CANCoderSwerve;
+ if (!compatible)
+ {
+ break;
+ }
+ }
+ if (compatible)
+ {
+ tunerXRecommendation.set(true);
+ }
+
+ }
+
/**
* Set the odometry update period in seconds.
*
@@ -465,6 +500,29 @@ public class SwerveDrive
setMaximumSpeed(attainableMaxModuleSpeedMetersPerSecond);
this.attainableMaxTranslationalSpeedMetersPerSecond = attainableMaxTranslationalSpeedMetersPerSecond;
this.attainableMaxRotationalVelocityRadiansPerSecond = attainableMaxRotationalVelocityRadiansPerSecond;
+ this.swerveController.config.maxAngularVelocity = attainableMaxRotationalVelocityRadiansPerSecond;
+ }
+
+ /**
+ * Get the maximum velocity from {@link SwerveDrive#attainableMaxTranslationalSpeedMetersPerSecond} or
+ * {@link SwerveDrive#maxSpeedMPS} whichever is higher.
+ *
+ * @return Maximum speed in meters/second.
+ */
+ public double getMaximumVelocity()
+ {
+ return Math.max(this.attainableMaxTranslationalSpeedMetersPerSecond, maxSpeedMPS);
+ }
+
+ /**
+ * Get the maximum angular velocity, either {@link SwerveDrive#attainableMaxRotationalVelocityRadiansPerSecond} or
+ * {@link SwerveControllerConfiguration#maxAngularVelocity}.
+ *
+ * @return Maximum angular velocity in radians per second.
+ */
+ public double getMaximumAngularVelocity()
+ {
+ return Math.max(this.attainableMaxRotationalVelocityRadiansPerSecond, swerveController.config.maxAngularVelocity);
}
/**
diff --git a/swervelib/SwerveModule.java b/swervelib/SwerveModule.java
index fe3989a..8e7d94d 100644
--- a/swervelib/SwerveModule.java
+++ b/swervelib/SwerveModule.java
@@ -394,6 +394,16 @@ public class SwerveModule
return driveMotor;
}
+ /**
+ * Get the {@link SwerveAbsoluteEncoder} for the {@link SwerveModule}.
+ *
+ * @return {@link SwerveAbsoluteEncoder} for the swerve module.
+ */
+ public SwerveAbsoluteEncoder getAbsoluteEncoder()
+ {
+ return absoluteEncoder;
+ }
+
/**
* Fetch the {@link SwerveModuleConfiguration} for the {@link SwerveModule} with the parsed configurations.
*
diff --git a/swervelib/telemetry/Alert.java b/swervelib/telemetry/Alert.java
index 1718c82..c92fc76 100644
--- a/swervelib/telemetry/Alert.java
+++ b/swervelib/telemetry/Alert.java
@@ -46,11 +46,25 @@ import java.util.function.Predicate;
public class Alert
{
+ /**
+ * Group of the alert.
+ */
private static Map groups = new HashMap();
-
+ /**
+ * Type of the Alert to raise.
+ */
private final AlertType type;
+ /**
+ * Activation state of alert.
+ */
private boolean active = false;
+ /**
+ * When the alert was raised.
+ */
private double activeStartTime = 0.0;
+ /**
+ * Text of the alert.
+ */
private String text;
/**
@@ -89,6 +103,8 @@ public class Alert
/**
* Sets whether the alert should currently be displayed. When activated, the alert text will also be sent to the
* console.
+ *
+ * @param active Set the alert as active and report it to the driver station.
*/
public void set(boolean active)
{
@@ -119,6 +135,8 @@ public class Alert
/**
* Updates current alert text.
+ *
+ * @param text The text for the alert.
*/
public void setText(String text)
{
@@ -182,11 +200,22 @@ public class Alert
INFO
}
+ /**
+ * Sendable alert for advantage scope.
+ */
private static class SendableAlerts implements Sendable
{
+ /**
+ * Alert list for sendable.
+ */
public final List alerts = new ArrayList<>();
+ /**
+ * Get alerts based off of type.
+ * @param type Type of alert to fetch.
+ * @return Active alert strings.
+ */
public String[] getStrings(AlertType type)
{
Predicate activeFilter = (Alert x) -> x.type == type && x.active;