diff --git a/docs/allclasses-index.html b/docs/allclasses-index.html index a1383b4..c9f126a 100644 --- a/docs/allclasses-index.html +++ b/docs/allclasses-index.html @@ -1,7 +1,7 @@
- +SwerveDrive.drive(Translation2d, double, boolean, boolean) using 254's
+ correction.edu.wpi.first.wpilibj.smartdashboard.Field2dbooleandrive(Translation2d, double, boolean, boolean) using 254's
+ correction.edu.wpi.first.wpilibj.smartdashboard.Field2dprivate SwerveIMUprivate SwerveIMUbooleanbooleanfinal SwerveKinematics2final SwerveKinematics2private doubleprivate doubleprivate intprivate intprivate SwerveIMUSimulationprivate SwerveIMUSimulationedu.wpi.first.math.Matrix<edu.wpi.first.math.numbers.N3,edu.wpi.first.math.numbers.N1> edu.wpi.first.math.Matrix<edu.wpi.first.math.numbers.N3,edu.wpi.first.math.numbers.N1> final SwerveDriveConfigurationfinal SwerveDriveConfigurationfinal SwervePoseEstimator2final SwervePoseEstimator2private final SwerveModule[]private final SwerveModule[]edu.wpi.first.math.Matrix<edu.wpi.first.math.numbers.N3,edu.wpi.first.math.numbers.N1> edu.wpi.first.math.Matrix<edu.wpi.first.math.numbers.N3,edu.wpi.first.math.numbers.N1> voiddrive(edu.wpi.first.math.geometry.Translation2d translation,
+
+
+Disable second order kinematics.
+
+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,
boolean headingCorrection)
-
+
The primary method for controlling the drivebase.
-Optional<edu.wpi.first.math.geometry.Translation3d>
-getAccel()
+void
+
+
+Enable second order kinematics for tracking purposes but completely untuned.
+
+void
+enableSecondOrderKinematics(double moduleFeedforward)
+Enable second order kinematics for simulation and modifying the feedforward.
+
+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[]
-
-
+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.
-
-
-
+
+
+
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
-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
-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 and second order kinematics.
-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
-setMaximumSpeed(double maximumSpeed)
-
-Set the maximum speed of the drive motors, modified SwerveControllerConfiguration.maxSpeed and
- SwerveDriveConfiguration.maxSpeed which is used for the
- setRawModuleStates(SwerveModuleState2[], boolean) function and
- SwerveController.getTargetSpeeds(double, double, double, double, double) functions.
-
void
-setMaximumSpeed(double maximumSpeed,
- boolean updateModuleFeedforward)
+setMaximumSpeed(double maximumSpeed)
Set the maximum speed of the drive motors, modified SwerveControllerConfiguration.maxSpeed and
SwerveDriveConfiguration.maxSpeed which is used for the
@@ -344,42 +356,51 @@ loadScripts(document, 'script');
SwerveController.getTargetSpeeds(double, double, double, double, double) functions.
void
-setMaximumSpeeds(double attainableMaxModuleSpeedMetersPerSecond,
+setMaximumSpeed(double maximumSpeed,
+ boolean updateModuleFeedforward)
+
+Set the maximum speed of the drive motors, modified SwerveControllerConfiguration.maxSpeed and
+ SwerveDriveConfiguration.maxSpeed which is used for the
+ setRawModuleStates(SwerveModuleState2[], boolean) function and
+ SwerveController.getTargetSpeeds(double, double, double, double, double) functions.
+
+void
+setMaximumSpeeds(double attainableMaxModuleSpeedMetersPerSecond,
double attainableMaxTranslationalSpeedMetersPerSecond,
double attainableMaxRotationalVelocityRadiansPerSecond)
-
+
Set the maximum speeds for desaturation.
-void
-setModuleStates(SwerveModuleState2[] desiredStates,
+void
+setModuleStates(SwerveModuleState2[] 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.
-private void
-setRawModuleStates(SwerveModuleState2[] desiredStates,
+private void
+setRawModuleStates(SwerveModuleState2[] desiredStates,
boolean isOpenLoop)
-
+
Set the module states (azimuth and velocity) directly.
-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.
@@ -465,6 +486,14 @@ loadScripts(document, 'script');
-
+
+chassisVelocityCorrection
+public boolean chassisVelocityCorrection
+Correct chassis velocity in drive(Translation2d, double, boolean, boolean) using 254's
+ correction.
+
+
+-
imu
@@ -961,6 +990,32 @@ loadScripts(document, 'script');
autonomous.
+-
+
+enableSecondOrderKinematics
+public void enableSecondOrderKinematics(double moduleFeedforward)
+Enable second order kinematics for simulation and modifying the feedforward. Second order kinematics could increase
+ accuracy in odometry.
+
+- Parameters:
+moduleFeedforward - Module feedforward to apply should be between [-1, 1] excluding 0.
+
+
+
+-
+
+enableSecondOrderKinematics
+public void enableSecondOrderKinematics()
+Enable second order kinematics for tracking purposes but completely untuned.
+
+
+-
+
+disableSecondOrderKinematics
+public void disableSecondOrderKinematics()
+Disable second order kinematics.
+
+
diff --git a/docs/swervelib/SwerveModule.html b/docs/swervelib/SwerveModule.html
index 5201f64..fbe27ca 100644
--- a/docs/swervelib/SwerveModule.html
+++ b/docs/swervelib/SwerveModule.html
@@ -1,7 +1,7 @@
-
+
SwerveModule
diff --git a/docs/swervelib/encoders/AnalogAbsoluteEncoderSwerve.html b/docs/swervelib/encoders/AnalogAbsoluteEncoderSwerve.html
index 1bc95b5..bc4c205 100644
--- a/docs/swervelib/encoders/AnalogAbsoluteEncoderSwerve.html
+++ b/docs/swervelib/encoders/AnalogAbsoluteEncoderSwerve.html
@@ -1,7 +1,7 @@
-
+
AnalogAbsoluteEncoderSwerve
diff --git a/docs/swervelib/encoders/CANCoderSwerve.html b/docs/swervelib/encoders/CANCoderSwerve.html
index c5ea199..989f169 100644
--- a/docs/swervelib/encoders/CANCoderSwerve.html
+++ b/docs/swervelib/encoders/CANCoderSwerve.html
@@ -1,7 +1,7 @@
-
+
CANCoderSwerve
diff --git a/docs/swervelib/encoders/SparkMaxEncoderSwerve.html b/docs/swervelib/encoders/SparkMaxEncoderSwerve.html
index 016ab82..49f75a5 100644
--- a/docs/swervelib/encoders/SparkMaxEncoderSwerve.html
+++ b/docs/swervelib/encoders/SparkMaxEncoderSwerve.html
@@ -1,7 +1,7 @@
-
+
SparkMaxEncoderSwerve
diff --git a/docs/swervelib/encoders/SwerveAbsoluteEncoder.html b/docs/swervelib/encoders/SwerveAbsoluteEncoder.html
index 19d353a..e9c4db4 100644
--- a/docs/swervelib/encoders/SwerveAbsoluteEncoder.html
+++ b/docs/swervelib/encoders/SwerveAbsoluteEncoder.html
@@ -1,7 +1,7 @@
-
+
SwerveAbsoluteEncoder
diff --git a/docs/swervelib/encoders/package-summary.html b/docs/swervelib/encoders/package-summary.html
index d39835b..272cb7e 100644
--- a/docs/swervelib/encoders/package-summary.html
+++ b/docs/swervelib/encoders/package-summary.html
@@ -1,7 +1,7 @@
-
+
swervelib.encoders
diff --git a/docs/swervelib/encoders/package-tree.html b/docs/swervelib/encoders/package-tree.html
index 7ee5078..378e043 100644
--- a/docs/swervelib/encoders/package-tree.html
+++ b/docs/swervelib/encoders/package-tree.html
@@ -1,7 +1,7 @@
-
+
swervelib.encoders Class Hierarchy
diff --git a/docs/swervelib/imu/ADIS16448Swerve.html b/docs/swervelib/imu/ADIS16448Swerve.html
index 8f91144..6c470b6 100644
--- a/docs/swervelib/imu/ADIS16448Swerve.html
+++ b/docs/swervelib/imu/ADIS16448Swerve.html
@@ -1,7 +1,7 @@
-
+
ADIS16448Swerve
diff --git a/docs/swervelib/imu/ADIS16470Swerve.html b/docs/swervelib/imu/ADIS16470Swerve.html
index c4867ee..2d34357 100644
--- a/docs/swervelib/imu/ADIS16470Swerve.html
+++ b/docs/swervelib/imu/ADIS16470Swerve.html
@@ -1,7 +1,7 @@
-
+
ADIS16470Swerve
diff --git a/docs/swervelib/imu/ADXRS450Swerve.html b/docs/swervelib/imu/ADXRS450Swerve.html
index 79169e9..5f1d814 100644
--- a/docs/swervelib/imu/ADXRS450Swerve.html
+++ b/docs/swervelib/imu/ADXRS450Swerve.html
@@ -1,7 +1,7 @@
-
+
ADXRS450Swerve
diff --git a/docs/swervelib/imu/AnalogGyroSwerve.html b/docs/swervelib/imu/AnalogGyroSwerve.html
index 855b72f..b3f408f 100644
--- a/docs/swervelib/imu/AnalogGyroSwerve.html
+++ b/docs/swervelib/imu/AnalogGyroSwerve.html
@@ -1,7 +1,7 @@
-
+
AnalogGyroSwerve
diff --git a/docs/swervelib/imu/NavXSwerve.html b/docs/swervelib/imu/NavXSwerve.html
index 8c9701f..07ff6a2 100644
--- a/docs/swervelib/imu/NavXSwerve.html
+++ b/docs/swervelib/imu/NavXSwerve.html
@@ -1,7 +1,7 @@
-
+
NavXSwerve
diff --git a/docs/swervelib/imu/Pigeon2Swerve.html b/docs/swervelib/imu/Pigeon2Swerve.html
index 92618fc..a455a05 100644
--- a/docs/swervelib/imu/Pigeon2Swerve.html
+++ b/docs/swervelib/imu/Pigeon2Swerve.html
@@ -1,7 +1,7 @@
-
+
Pigeon2Swerve
diff --git a/docs/swervelib/imu/PigeonSwerve.html b/docs/swervelib/imu/PigeonSwerve.html
index bcc73b7..98652f1 100644
--- a/docs/swervelib/imu/PigeonSwerve.html
+++ b/docs/swervelib/imu/PigeonSwerve.html
@@ -1,7 +1,7 @@
-
+
PigeonSwerve
diff --git a/docs/swervelib/imu/SwerveIMU.html b/docs/swervelib/imu/SwerveIMU.html
index 6245e84..221677b 100644
--- a/docs/swervelib/imu/SwerveIMU.html
+++ b/docs/swervelib/imu/SwerveIMU.html
@@ -1,7 +1,7 @@
-
+
SwerveIMU
diff --git a/docs/swervelib/imu/package-summary.html b/docs/swervelib/imu/package-summary.html
index 423d948..3bf5d53 100644
--- a/docs/swervelib/imu/package-summary.html
+++ b/docs/swervelib/imu/package-summary.html
@@ -1,7 +1,7 @@
-
+
swervelib.imu
diff --git a/docs/swervelib/imu/package-tree.html b/docs/swervelib/imu/package-tree.html
index b870bce..e240e6a 100644
--- a/docs/swervelib/imu/package-tree.html
+++ b/docs/swervelib/imu/package-tree.html
@@ -1,7 +1,7 @@
-
+
swervelib.imu Class Hierarchy
diff --git a/docs/swervelib/math/Matter.html b/docs/swervelib/math/Matter.html
index 8a3e5f5..86ab6cc 100644
--- a/docs/swervelib/math/Matter.html
+++ b/docs/swervelib/math/Matter.html
@@ -1,7 +1,7 @@
-
+
Matter
diff --git a/docs/swervelib/math/SwerveDriveOdometry2.html b/docs/swervelib/math/SwerveDriveOdometry2.html
index 1921ad6..f45bd10 100644
--- a/docs/swervelib/math/SwerveDriveOdometry2.html
+++ b/docs/swervelib/math/SwerveDriveOdometry2.html
@@ -1,7 +1,7 @@
-
+
SwerveDriveOdometry2
diff --git a/docs/swervelib/math/SwerveKinematics2.html b/docs/swervelib/math/SwerveKinematics2.html
index 5cd257d..f13b123 100644
--- a/docs/swervelib/math/SwerveKinematics2.html
+++ b/docs/swervelib/math/SwerveKinematics2.html
@@ -1,7 +1,7 @@
-
+
SwerveKinematics2
diff --git a/docs/swervelib/math/SwerveMath.html b/docs/swervelib/math/SwerveMath.html
index 5d8c6b5..a5b498a 100644
--- a/docs/swervelib/math/SwerveMath.html
+++ b/docs/swervelib/math/SwerveMath.html
@@ -1,7 +1,7 @@
-
+
SwerveMath
diff --git a/docs/swervelib/math/SwerveModuleState2.html b/docs/swervelib/math/SwerveModuleState2.html
index c0e6c73..7608815 100644
--- a/docs/swervelib/math/SwerveModuleState2.html
+++ b/docs/swervelib/math/SwerveModuleState2.html
@@ -1,7 +1,7 @@
-
+
SwerveModuleState2
diff --git a/docs/swervelib/math/SwervePoseEstimator2.InterpolationRecord.html b/docs/swervelib/math/SwervePoseEstimator2.InterpolationRecord.html
index a3187c7..05d6355 100644
--- a/docs/swervelib/math/SwervePoseEstimator2.InterpolationRecord.html
+++ b/docs/swervelib/math/SwervePoseEstimator2.InterpolationRecord.html
@@ -1,7 +1,7 @@
-
+
SwervePoseEstimator2.InterpolationRecord
diff --git a/docs/swervelib/math/SwervePoseEstimator2.html b/docs/swervelib/math/SwervePoseEstimator2.html
index f750411..745d2ba 100644
--- a/docs/swervelib/math/SwervePoseEstimator2.html
+++ b/docs/swervelib/math/SwervePoseEstimator2.html
@@ -1,7 +1,7 @@
-
+
SwervePoseEstimator2
diff --git a/docs/swervelib/math/package-summary.html b/docs/swervelib/math/package-summary.html
index 8b0c221..3e8d306 100644
--- a/docs/swervelib/math/package-summary.html
+++ b/docs/swervelib/math/package-summary.html
@@ -1,7 +1,7 @@
-
+
swervelib.math
diff --git a/docs/swervelib/math/package-tree.html b/docs/swervelib/math/package-tree.html
index 9e87c78..1d307a4 100644
--- a/docs/swervelib/math/package-tree.html
+++ b/docs/swervelib/math/package-tree.html
@@ -1,7 +1,7 @@
-
+
swervelib.math Class Hierarchy
diff --git a/docs/swervelib/motors/SparkMaxBrushedMotorSwerve.html b/docs/swervelib/motors/SparkMaxBrushedMotorSwerve.html
index aeed7c9..ff258fa 100644
--- a/docs/swervelib/motors/SparkMaxBrushedMotorSwerve.html
+++ b/docs/swervelib/motors/SparkMaxBrushedMotorSwerve.html
@@ -1,7 +1,7 @@
-
+
SparkMaxBrushedMotorSwerve
diff --git a/docs/swervelib/motors/SparkMaxSwerve.SparkMAX_slotIdx.html b/docs/swervelib/motors/SparkMaxSwerve.SparkMAX_slotIdx.html
index 31d7c33..8015539 100644
--- a/docs/swervelib/motors/SparkMaxSwerve.SparkMAX_slotIdx.html
+++ b/docs/swervelib/motors/SparkMaxSwerve.SparkMAX_slotIdx.html
@@ -1,7 +1,7 @@
-
+
SparkMaxSwerve.SparkMAX_slotIdx
diff --git a/docs/swervelib/motors/SparkMaxSwerve.html b/docs/swervelib/motors/SparkMaxSwerve.html
index 93bd318..5fefb06 100644
--- a/docs/swervelib/motors/SparkMaxSwerve.html
+++ b/docs/swervelib/motors/SparkMaxSwerve.html
@@ -1,7 +1,7 @@
-
+
SparkMaxSwerve
diff --git a/docs/swervelib/motors/SwerveMotor.html b/docs/swervelib/motors/SwerveMotor.html
index fd87ef8..844c55d 100644
--- a/docs/swervelib/motors/SwerveMotor.html
+++ b/docs/swervelib/motors/SwerveMotor.html
@@ -1,7 +1,7 @@
-
+
SwerveMotor
diff --git a/docs/swervelib/motors/TalonFXSwerve.html b/docs/swervelib/motors/TalonFXSwerve.html
index 6cc0c55..6e2a800 100644
--- a/docs/swervelib/motors/TalonFXSwerve.html
+++ b/docs/swervelib/motors/TalonFXSwerve.html
@@ -1,7 +1,7 @@
-
+
TalonFXSwerve
diff --git a/docs/swervelib/motors/TalonSRXSwerve.html b/docs/swervelib/motors/TalonSRXSwerve.html
index 2422d4c..13f46b0 100644
--- a/docs/swervelib/motors/TalonSRXSwerve.html
+++ b/docs/swervelib/motors/TalonSRXSwerve.html
@@ -1,7 +1,7 @@
-
+
TalonSRXSwerve
diff --git a/docs/swervelib/motors/package-summary.html b/docs/swervelib/motors/package-summary.html
index 5f9c073..dfbd27e 100644
--- a/docs/swervelib/motors/package-summary.html
+++ b/docs/swervelib/motors/package-summary.html
@@ -1,7 +1,7 @@
-
+
swervelib.motors
diff --git a/docs/swervelib/motors/package-tree.html b/docs/swervelib/motors/package-tree.html
index 4840c3a..dac1592 100644
--- a/docs/swervelib/motors/package-tree.html
+++ b/docs/swervelib/motors/package-tree.html
@@ -1,7 +1,7 @@
-
+
swervelib.motors Class Hierarchy
diff --git a/docs/swervelib/package-summary.html b/docs/swervelib/package-summary.html
index 25cd61d..e51ae98 100644
--- a/docs/swervelib/package-summary.html
+++ b/docs/swervelib/package-summary.html
@@ -1,7 +1,7 @@
-
+
swervelib
diff --git a/docs/swervelib/package-tree.html b/docs/swervelib/package-tree.html
index d13324c..9c900e2 100644
--- a/docs/swervelib/package-tree.html
+++ b/docs/swervelib/package-tree.html
@@ -1,7 +1,7 @@
-
+
swervelib Class Hierarchy
diff --git a/docs/swervelib/parser/PIDFConfig.html b/docs/swervelib/parser/PIDFConfig.html
index f84e7aa..6bff2ac 100644
--- a/docs/swervelib/parser/PIDFConfig.html
+++ b/docs/swervelib/parser/PIDFConfig.html
@@ -1,7 +1,7 @@
-
+
PIDFConfig
diff --git a/docs/swervelib/parser/SwerveControllerConfiguration.html b/docs/swervelib/parser/SwerveControllerConfiguration.html
index dfd754d..4d2325d 100644
--- a/docs/swervelib/parser/SwerveControllerConfiguration.html
+++ b/docs/swervelib/parser/SwerveControllerConfiguration.html
@@ -1,7 +1,7 @@
-
+
SwerveControllerConfiguration
diff --git a/docs/swervelib/parser/SwerveDriveConfiguration.html b/docs/swervelib/parser/SwerveDriveConfiguration.html
index af6aee1..9d5116a 100644
--- a/docs/swervelib/parser/SwerveDriveConfiguration.html
+++ b/docs/swervelib/parser/SwerveDriveConfiguration.html
@@ -1,7 +1,7 @@
-
+
SwerveDriveConfiguration
diff --git a/docs/swervelib/parser/SwerveModuleConfiguration.html b/docs/swervelib/parser/SwerveModuleConfiguration.html
index e58520d..cdca40d 100644
--- a/docs/swervelib/parser/SwerveModuleConfiguration.html
+++ b/docs/swervelib/parser/SwerveModuleConfiguration.html
@@ -1,7 +1,7 @@
-
+
SwerveModuleConfiguration
diff --git a/docs/swervelib/parser/SwerveModulePhysicalCharacteristics.html b/docs/swervelib/parser/SwerveModulePhysicalCharacteristics.html
index 2211d64..9e73f4f 100644
--- a/docs/swervelib/parser/SwerveModulePhysicalCharacteristics.html
+++ b/docs/swervelib/parser/SwerveModulePhysicalCharacteristics.html
@@ -1,7 +1,7 @@
-
+
SwerveModulePhysicalCharacteristics
diff --git a/docs/swervelib/parser/SwerveParser.html b/docs/swervelib/parser/SwerveParser.html
index 44ce32a..2a05717 100644
--- a/docs/swervelib/parser/SwerveParser.html
+++ b/docs/swervelib/parser/SwerveParser.html
@@ -1,7 +1,7 @@
-
+
SwerveParser
diff --git a/docs/swervelib/parser/deserializer/PIDFRange.html b/docs/swervelib/parser/deserializer/PIDFRange.html
index 9b9f84a..3785faa 100644
--- a/docs/swervelib/parser/deserializer/PIDFRange.html
+++ b/docs/swervelib/parser/deserializer/PIDFRange.html
@@ -1,7 +1,7 @@
-
+
PIDFRange
diff --git a/docs/swervelib/parser/deserializer/package-summary.html b/docs/swervelib/parser/deserializer/package-summary.html
index 572e014..dfd812e 100644
--- a/docs/swervelib/parser/deserializer/package-summary.html
+++ b/docs/swervelib/parser/deserializer/package-summary.html
@@ -1,7 +1,7 @@
-
+
swervelib.parser.deserializer
diff --git a/docs/swervelib/parser/deserializer/package-tree.html b/docs/swervelib/parser/deserializer/package-tree.html
index 2ebdd56..3c8bd8a 100644
--- a/docs/swervelib/parser/deserializer/package-tree.html
+++ b/docs/swervelib/parser/deserializer/package-tree.html
@@ -1,7 +1,7 @@
-
+
swervelib.parser.deserializer Class Hierarchy
diff --git a/docs/swervelib/parser/json/ControllerPropertiesJson.html b/docs/swervelib/parser/json/ControllerPropertiesJson.html
index 3b7dff8..ee62765 100644
--- a/docs/swervelib/parser/json/ControllerPropertiesJson.html
+++ b/docs/swervelib/parser/json/ControllerPropertiesJson.html
@@ -1,7 +1,7 @@
-
+
ControllerPropertiesJson
diff --git a/docs/swervelib/parser/json/DeviceJson.html b/docs/swervelib/parser/json/DeviceJson.html
index a82d44f..48c1ef5 100644
--- a/docs/swervelib/parser/json/DeviceJson.html
+++ b/docs/swervelib/parser/json/DeviceJson.html
@@ -1,7 +1,7 @@
-
+
DeviceJson
diff --git a/docs/swervelib/parser/json/ModuleJson.html b/docs/swervelib/parser/json/ModuleJson.html
index af29591..f0c9de5 100644
--- a/docs/swervelib/parser/json/ModuleJson.html
+++ b/docs/swervelib/parser/json/ModuleJson.html
@@ -1,7 +1,7 @@
-
+
ModuleJson
diff --git a/docs/swervelib/parser/json/MotorConfigDouble.html b/docs/swervelib/parser/json/MotorConfigDouble.html
index 343f609..518f52b 100644
--- a/docs/swervelib/parser/json/MotorConfigDouble.html
+++ b/docs/swervelib/parser/json/MotorConfigDouble.html
@@ -1,7 +1,7 @@
-
+
MotorConfigDouble
diff --git a/docs/swervelib/parser/json/MotorConfigInt.html b/docs/swervelib/parser/json/MotorConfigInt.html
index 23d29cb..472e785 100644
--- a/docs/swervelib/parser/json/MotorConfigInt.html
+++ b/docs/swervelib/parser/json/MotorConfigInt.html
@@ -1,7 +1,7 @@
-
+
MotorConfigInt
diff --git a/docs/swervelib/parser/json/PIDFPropertiesJson.html b/docs/swervelib/parser/json/PIDFPropertiesJson.html
index 3d1b4a0..2d1fa2b 100644
--- a/docs/swervelib/parser/json/PIDFPropertiesJson.html
+++ b/docs/swervelib/parser/json/PIDFPropertiesJson.html
@@ -1,7 +1,7 @@
-
+
PIDFPropertiesJson
diff --git a/docs/swervelib/parser/json/PhysicalPropertiesJson.html b/docs/swervelib/parser/json/PhysicalPropertiesJson.html
index 4a1e503..26e0273 100644
--- a/docs/swervelib/parser/json/PhysicalPropertiesJson.html
+++ b/docs/swervelib/parser/json/PhysicalPropertiesJson.html
@@ -1,7 +1,7 @@
-
+
PhysicalPropertiesJson
diff --git a/docs/swervelib/parser/json/SwerveDriveJson.html b/docs/swervelib/parser/json/SwerveDriveJson.html
index d8b2be0..0fd36bd 100644
--- a/docs/swervelib/parser/json/SwerveDriveJson.html
+++ b/docs/swervelib/parser/json/SwerveDriveJson.html
@@ -1,7 +1,7 @@
-
+
SwerveDriveJson
diff --git a/docs/swervelib/parser/json/modules/BoolMotorJson.html b/docs/swervelib/parser/json/modules/BoolMotorJson.html
index 983749c..3c7ff05 100644
--- a/docs/swervelib/parser/json/modules/BoolMotorJson.html
+++ b/docs/swervelib/parser/json/modules/BoolMotorJson.html
@@ -1,7 +1,7 @@
-
+
BoolMotorJson
diff --git a/docs/swervelib/parser/json/modules/LocationJson.html b/docs/swervelib/parser/json/modules/LocationJson.html
index 96c4830..cad82f4 100644
--- a/docs/swervelib/parser/json/modules/LocationJson.html
+++ b/docs/swervelib/parser/json/modules/LocationJson.html
@@ -1,7 +1,7 @@
-
+
LocationJson
diff --git a/docs/swervelib/parser/json/modules/package-summary.html b/docs/swervelib/parser/json/modules/package-summary.html
index bd80b31..cfc0eea 100644
--- a/docs/swervelib/parser/json/modules/package-summary.html
+++ b/docs/swervelib/parser/json/modules/package-summary.html
@@ -1,7 +1,7 @@
-
+
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 781d8bf..d88b959 100644
--- a/docs/swervelib/parser/json/modules/package-tree.html
+++ b/docs/swervelib/parser/json/modules/package-tree.html
@@ -1,7 +1,7 @@
-
+
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 d142da6..5772d31 100644
--- a/docs/swervelib/parser/json/package-summary.html
+++ b/docs/swervelib/parser/json/package-summary.html
@@ -1,7 +1,7 @@
-
+
swervelib.parser.json
diff --git a/docs/swervelib/parser/json/package-tree.html b/docs/swervelib/parser/json/package-tree.html
index 87e5c0b..6da2226 100644
--- a/docs/swervelib/parser/json/package-tree.html
+++ b/docs/swervelib/parser/json/package-tree.html
@@ -1,7 +1,7 @@
-
+
swervelib.parser.json Class Hierarchy
diff --git a/docs/swervelib/parser/package-summary.html b/docs/swervelib/parser/package-summary.html
index 2d8c845..2b87cc1 100644
--- a/docs/swervelib/parser/package-summary.html
+++ b/docs/swervelib/parser/package-summary.html
@@ -1,7 +1,7 @@
-
+
swervelib.parser
diff --git a/docs/swervelib/parser/package-tree.html b/docs/swervelib/parser/package-tree.html
index 9a424b5..eb9e0a2 100644
--- a/docs/swervelib/parser/package-tree.html
+++ b/docs/swervelib/parser/package-tree.html
@@ -1,7 +1,7 @@
-
+
swervelib.parser Class Hierarchy
diff --git a/docs/swervelib/simulation/SwerveIMUSimulation.html b/docs/swervelib/simulation/SwerveIMUSimulation.html
index 20f01f9..dbd7645 100644
--- a/docs/swervelib/simulation/SwerveIMUSimulation.html
+++ b/docs/swervelib/simulation/SwerveIMUSimulation.html
@@ -1,7 +1,7 @@
-
+
SwerveIMUSimulation
diff --git a/docs/swervelib/simulation/SwerveModuleSimulation.html b/docs/swervelib/simulation/SwerveModuleSimulation.html
index 50915d0..d05fe1e 100644
--- a/docs/swervelib/simulation/SwerveModuleSimulation.html
+++ b/docs/swervelib/simulation/SwerveModuleSimulation.html
@@ -1,7 +1,7 @@
-
+
SwerveModuleSimulation
diff --git a/docs/swervelib/simulation/ctre/PhysicsSim.SimProfile.html b/docs/swervelib/simulation/ctre/PhysicsSim.SimProfile.html
index b5baa95..010f9f9 100644
--- a/docs/swervelib/simulation/ctre/PhysicsSim.SimProfile.html
+++ b/docs/swervelib/simulation/ctre/PhysicsSim.SimProfile.html
@@ -1,7 +1,7 @@
-
+
PhysicsSim.SimProfile
diff --git a/docs/swervelib/simulation/ctre/PhysicsSim.html b/docs/swervelib/simulation/ctre/PhysicsSim.html
index eafb3e4..aa12b9c 100644
--- a/docs/swervelib/simulation/ctre/PhysicsSim.html
+++ b/docs/swervelib/simulation/ctre/PhysicsSim.html
@@ -1,7 +1,7 @@
-
+
PhysicsSim
diff --git a/docs/swervelib/simulation/ctre/TalonFXSimProfile.html b/docs/swervelib/simulation/ctre/TalonFXSimProfile.html
index 6053d1e..5e25f52 100644
--- a/docs/swervelib/simulation/ctre/TalonFXSimProfile.html
+++ b/docs/swervelib/simulation/ctre/TalonFXSimProfile.html
@@ -1,7 +1,7 @@
-
+
TalonFXSimProfile
diff --git a/docs/swervelib/simulation/ctre/TalonSRXSimProfile.html b/docs/swervelib/simulation/ctre/TalonSRXSimProfile.html
index ecec8a0..74dcf17 100644
--- a/docs/swervelib/simulation/ctre/TalonSRXSimProfile.html
+++ b/docs/swervelib/simulation/ctre/TalonSRXSimProfile.html
@@ -1,7 +1,7 @@
-
+
TalonSRXSimProfile
diff --git a/docs/swervelib/simulation/ctre/VictorSPXSimProfile.html b/docs/swervelib/simulation/ctre/VictorSPXSimProfile.html
index 3b982fc..8bd67d2 100644
--- a/docs/swervelib/simulation/ctre/VictorSPXSimProfile.html
+++ b/docs/swervelib/simulation/ctre/VictorSPXSimProfile.html
@@ -1,7 +1,7 @@
-
+
VictorSPXSimProfile
diff --git a/docs/swervelib/simulation/ctre/package-summary.html b/docs/swervelib/simulation/ctre/package-summary.html
index 78f6430..2f1e676 100644
--- a/docs/swervelib/simulation/ctre/package-summary.html
+++ b/docs/swervelib/simulation/ctre/package-summary.html
@@ -1,7 +1,7 @@
-
+
swervelib.simulation.ctre
diff --git a/docs/swervelib/simulation/ctre/package-tree.html b/docs/swervelib/simulation/ctre/package-tree.html
index ab5f08e..131b5be 100644
--- a/docs/swervelib/simulation/ctre/package-tree.html
+++ b/docs/swervelib/simulation/ctre/package-tree.html
@@ -1,7 +1,7 @@
-
+
swervelib.simulation.ctre Class Hierarchy
diff --git a/docs/swervelib/simulation/package-summary.html b/docs/swervelib/simulation/package-summary.html
index 1ce0161..688a905 100644
--- a/docs/swervelib/simulation/package-summary.html
+++ b/docs/swervelib/simulation/package-summary.html
@@ -1,7 +1,7 @@
-
+
swervelib.simulation
diff --git a/docs/swervelib/simulation/package-tree.html b/docs/swervelib/simulation/package-tree.html
index 04b3705..408daa9 100644
--- a/docs/swervelib/simulation/package-tree.html
+++ b/docs/swervelib/simulation/package-tree.html
@@ -1,7 +1,7 @@
-
+
swervelib.simulation Class Hierarchy
diff --git a/docs/swervelib/telemetry/SwerveDriveTelemetry.TelemetryVerbosity.html b/docs/swervelib/telemetry/SwerveDriveTelemetry.TelemetryVerbosity.html
index bc9a0c3..b70ea94 100644
--- a/docs/swervelib/telemetry/SwerveDriveTelemetry.TelemetryVerbosity.html
+++ b/docs/swervelib/telemetry/SwerveDriveTelemetry.TelemetryVerbosity.html
@@ -1,7 +1,7 @@
-
+
SwerveDriveTelemetry.TelemetryVerbosity
diff --git a/docs/swervelib/telemetry/SwerveDriveTelemetry.html b/docs/swervelib/telemetry/SwerveDriveTelemetry.html
index ec96133..7b17f15 100644
--- a/docs/swervelib/telemetry/SwerveDriveTelemetry.html
+++ b/docs/swervelib/telemetry/SwerveDriveTelemetry.html
@@ -1,7 +1,7 @@
-
+
SwerveDriveTelemetry
diff --git a/docs/swervelib/telemetry/package-summary.html b/docs/swervelib/telemetry/package-summary.html
index 96f31fd..2320b82 100644
--- a/docs/swervelib/telemetry/package-summary.html
+++ b/docs/swervelib/telemetry/package-summary.html
@@ -1,7 +1,7 @@
-
+
swervelib.telemetry
diff --git a/docs/swervelib/telemetry/package-tree.html b/docs/swervelib/telemetry/package-tree.html
index b799c24..37c04e2 100644
--- a/docs/swervelib/telemetry/package-tree.html
+++ b/docs/swervelib/telemetry/package-tree.html
@@ -1,7 +1,7 @@
-
+
swervelib.telemetry Class Hierarchy
diff --git a/swervelib/SwerveDrive.java b/swervelib/SwerveDrive.java
index 0857150..f858eea 100644
--- a/swervelib/SwerveDrive.java
+++ b/swervelib/SwerveDrive.java
@@ -78,23 +78,28 @@ public class SwerveDrive
/**
* Invert odometry readings of drive motor positions, used as a patch for debugging currently.
*/
- public boolean invertOdometry = false;
+ public boolean invertOdometry = false;
+ /**
+ * Correct chassis velocity in {@link SwerveDrive#drive(Translation2d, double, boolean, boolean)} using 254's
+ * correction.
+ */
+ public boolean chassisVelocityCorrection = true;
/**
* Swerve IMU device for sensing the heading of the robot.
*/
- private SwerveIMU imu;
+ private SwerveIMU imu;
/**
* Simulation of the swerve drive.
*/
- private SwerveIMUSimulation simIMU;
+ private SwerveIMUSimulation simIMU;
/**
* Counter to synchronize the modules relative encoder with absolute encoder when not moving.
*/
- private int moduleSynchronizationCounter = 0;
+ private int moduleSynchronizationCounter = 0;
/**
* The last heading set in radians.
*/
- private double lastHeadingRadians = 0;
+ private double lastHeadingRadians = 0;
/**
* Creates a new swerve drivebase subsystem. Robot is controlled via the {@link SwerveDrive#drive} method, or via the
@@ -225,14 +230,17 @@ public class SwerveDrive
// Thank you to Jared Russell FRC254 for Open Loop Compensation Code
// https://www.chiefdelphi.com/t/whitepaper-swerve-drive-skew-and-second-order-kinematics/416964/5
- double dtConstant = 0.009;
- Pose2d robotPoseVel = new Pose2d(velocity.vxMetersPerSecond * dtConstant,
- velocity.vyMetersPerSecond * dtConstant,
- Rotation2d.fromRadians(velocity.omegaRadiansPerSecond * dtConstant));
- Twist2d twistVel = SwerveMath.PoseLog(robotPoseVel);
+ if (chassisVelocityCorrection)
+ {
+ double dtConstant = 0.009;
+ Pose2d robotPoseVel = new Pose2d(velocity.vxMetersPerSecond * dtConstant,
+ velocity.vyMetersPerSecond * dtConstant,
+ Rotation2d.fromRadians(velocity.omegaRadiansPerSecond * dtConstant));
+ Twist2d twistVel = SwerveMath.PoseLog(robotPoseVel);
- velocity = new ChassisSpeeds(twistVel.dx / dtConstant, twistVel.dy / dtConstant,
- twistVel.dtheta / dtConstant);
+ velocity = new ChassisSpeeds(twistVel.dx / dtConstant, twistVel.dy / dtConstant,
+ twistVel.dtheta / dtConstant);
+ }
// Heading Angular Velocity Deadband, might make a configuration option later.
// Originally made by Team 1466 Webb Robotics.
@@ -857,4 +865,34 @@ public class SwerveDrive
}
}
+ /**
+ * Enable second order kinematics for simulation and modifying the feedforward. Second order kinematics could increase
+ * accuracy in odometry.
+ *
+ * @param moduleFeedforward Module feedforward to apply should be between [-1, 1] excluding 0.
+ */
+ public void enableSecondOrderKinematics(double moduleFeedforward)
+ {
+ for (SwerveModule module : swerveModules)
+ {
+ module.configuration.moduleSteerFFCL = moduleFeedforward;
+ }
+ }
+
+ /**
+ * Enable second order kinematics for tracking purposes but completely untuned.
+ */
+ public void enableSecondOrderKinematics()
+ {
+ enableSecondOrderKinematics(-0.00000000000000001);
+ }
+
+ /**
+ * Disable second order kinematics.
+ */
+ public void disableSecondOrderKinematics()
+ {
+ enableSecondOrderKinematics(0);
+ }
+
}
diff --git a/swervelib/SwerveModule.java b/swervelib/SwerveModule.java
index e77a8e0..4013b94 100644
--- a/swervelib/SwerveModule.java
+++ b/swervelib/SwerveModule.java
@@ -209,7 +209,7 @@ public class SwerveModule
*/
public void setAngle(double angle)
{
- angleMotor.setReference(angle, configuration.moduleSteerFFCL);
+ angleMotor.setReference(angle, 0);
lastState.angle = Rotation2d.fromDegrees(angle);
}