diff --git a/docs/allclasses-index.html b/docs/allclasses-index.html index 4ae75ce..faef0d7 100644 --- a/docs/allclasses-index.html +++ b/docs/allclasses-index.html @@ -1,11 +1,11 @@
- +final SwerveKinematics2booleanfinal 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 edu.wpi.first.math.estimator.SwerveDrivePoseEstimatorfinal edu.wpi.first.math.estimator.SwerveDrivePoseEstimatorprivate 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> edu.wpi.first.math.kinematics.SwerveModulePosition[]edu.wpi.first.math.geometry.Rotation2dgetPitch()invertOdometry is true.SwerveDrivePoseEstimator and update the SwerveIMU gyro reading with
- the given timestamp of the vision measurement. THIS WILL BREAK IF UPDATED TOO OFTEN.robotPose - Robot Pose2d as measured by vision.voidconfigureIntegratedEncoder(double positionConversionFactor) configureCANStatusFrames(int CANStatus1,
+ int CANStatus2,
+ int CANStatus3,
+ int CANStatus4,
+ int CANStatus8,
+ int CANStatus10,
+ int CANStatus12,
+ int CANStatus13,
+ int CANStatus14,
+ int CANStatus21,
+ int CANStatusCurrent) voidconfigurePIDF(PIDFConfig config) configureIntegratedEncoder(double positionConversionFactor) voidconfigurePIDF(PIDFConfig config) voidconfigurePIDWrapping(double minInput,
+void
+configurePIDWrapping(double minInput,
double maxInput)
-
+
Configure the PID wrapping for the position closed loop controller.
-double
-convertToNativeSensorUnits(double setpoint)
-
+double
+convertToNativeSensorUnits(double setpoint)
+
Convert the setpoint into native sensor units.
-void
-
-
+void
+
+
Configure the factory defaults.
-
-getMotor()
-
+
+getMotor()
+
Get the motor object from the module.
-double
-
-
+double
+
+
Get the position of the integrated encoder.
-double
-
-
+double
+
+
Get the velocity of the integrated encoder.
-boolean
-
-
+boolean
+
+
Queries whether the absolute encoder is directly attached to the motor controller.
-private double
-placeInAppropriate0To360Scope(double scopeReference,
+private double
+placeInAppropriate0To360Scope(double scopeReference,
double newAngle)
-
+
Put an angle within the the 360 deg scope of a reference.
-void
-set(double percentOutput)
-
+void
+set(double percentOutput)
+
Set the percentage output.
-
-setAbsoluteEncoder(SwerveAbsoluteEncoder encoder)
-
+
+setAbsoluteEncoder(SwerveAbsoluteEncoder encoder)
+
Set the absolute encoder to be a compatible absolute encoder.
-void
-setCurrentLimit(int currentLimit)
-
+void
+setCurrentLimit(int currentLimit)
+
Set the current limit for the swerve drive motor, remember this may cause jumping if used in conjunction with
voltage compensation.
-void
-setInverted(boolean inverted)
-
+void
+setInverted(boolean inverted)
+
Set the motor to be inverted.
-void
-setLoopRampRate(double rampRate)
-
+void
+setLoopRampRate(double rampRate)
+
Set the maximum rate the open/closed loop output can change by.
-void
-setMotorBrake(boolean isBrakeMode)
-
+void
+setMotorBrake(boolean isBrakeMode)
+
Set the idle mode.
-void
-setPosition(double position)
-
+void
+setPosition(double position)
+
Set the integrated encoder position.
-void
-setReference(double setpoint,
+void
+setReference(double setpoint,
double feedforward)
-
+
Set the closed loop PID controller reference point.
-void
-setVoltageCompensation(double nominalVoltage)
-
+void
+setVoltageCompensation(double nominalVoltage)
+
Set the voltage compensation for the swerve module motor.
@@ -497,6 +512,38 @@ loadScripts(document, 'script');
+
+configureCANStatusFrames
+public void configureCANStatusFrames(int CANStatus1,
+ int CANStatus2,
+ int CANStatus3,
+ int CANStatus4,
+ int CANStatus8,
+ int CANStatus10,
+ int CANStatus12,
+ int CANStatus13,
+ int CANStatus14,
+ int CANStatus21,
+ int CANStatusCurrent)
+Set the CAN status frames.
+
+- Parameters:
+CANStatus1 - Applied Motor Output, Fault Information, Limit Switch Information
+CANStatus2 - Selected Sensor Position (PID 0), Selected Sensor Velocity (PID 0), Brushed Supply Current
+ Measurement, Sticky Fault Information
+CANStatus3 - Quadrature Information
+CANStatus4 - Analog Input, Supply Battery Voltage, Controller Temperature
+CANStatus8 - Pulse Width Information
+CANStatus10 - Motion Profiling/Motion Magic Information
+CANStatus12 - Selected Sensor Position (Aux PID 1), Selected Sensor Velocity (Aux PID 1)
+CANStatus13 - PID0 (Primary PID) Information
+CANStatus14 - PID1 (Auxiliary PID) Information
+CANStatus21 - Integrated Sensor Position (Talon FX), Integrated Sensor Velocity (Talon FX)
+CANStatusCurrent - Brushless Supply Current Measurement, Brushless Stator Current Measurement
+
+
+
+
configurePIDF
diff --git a/docs/swervelib/motors/TalonSRXSwerve.html b/docs/swervelib/motors/TalonSRXSwerve.html
index 509038e..f16d991 100644
--- a/docs/swervelib/motors/TalonSRXSwerve.html
+++ b/docs/swervelib/motors/TalonSRXSwerve.html
@@ -1,11 +1,11 @@
-
+
TalonSRXSwerve
-
+
@@ -182,102 +182,117 @@ loadScripts(document, 'script');
Set the CAN status frames.
void
-configureIntegratedEncoder(double positionConversionFactor)
+configureCANStatusFrames(int CANStatus1,
+ int CANStatus2,
+ int CANStatus3,
+ int CANStatus4,
+ int CANStatus8,
+ int CANStatus10,
+ int CANStatus12,
+ int CANStatus13,
+ int CANStatus14,
+ int CANStatus21,
+ int CANStatusCurrent)
-Configure the integrated encoder for the swerve module.
+Set the CAN status frames.
void
-configurePIDF(PIDFConfig config)
+configureIntegratedEncoder(double positionConversionFactor)
+Configure the integrated encoder for the swerve module.
+
+void
+configurePIDF(PIDFConfig config)
+
Configure the PIDF values for the closed loop controller.
-void
-configurePIDWrapping(double minInput,
+void
+configurePIDWrapping(double minInput,
double maxInput)
-
+
Configure the PID wrapping for the position closed loop controller.
-double
-convertToNativeSensorUnits(double setpoint)
-
+double
+convertToNativeSensorUnits(double setpoint)
+
Convert the setpoint into native sensor units.
-void
-
-
+void
+
+
Configure the factory defaults.
-
-getMotor()
-
+
+getMotor()
+
Get the motor object from the module.
-double
-
-
+double
+
+
Get the position of the integrated encoder.
-double
-
-
+double
+
+
Get the velocity of the integrated encoder.
-boolean
-
-
+boolean
+
+
Queries whether the absolute encoder is directly attached to the motor controller.
-private double
-placeInAppropriate0To360Scope(double scopeReference,
+private double
+placeInAppropriate0To360Scope(double scopeReference,
double newAngle)
-
+
Put an angle within the the 360 deg scope of a reference.
-void
-set(double percentOutput)
-
+void
+set(double percentOutput)
+
Set the percentage output.
-
-setAbsoluteEncoder(SwerveAbsoluteEncoder encoder)
-
+
+setAbsoluteEncoder(SwerveAbsoluteEncoder encoder)
+
Set the absolute encoder to be a compatible absolute encoder.
-void
-setCurrentLimit(int currentLimit)
-
+void
+setCurrentLimit(int currentLimit)
+
Set the current limit for the swerve drive motor, remember this may cause jumping if used in conjunction with
voltage compensation.
-void
-setInverted(boolean inverted)
-
+void
+setInverted(boolean inverted)
+
Set the motor to be inverted.
-void
-setLoopRampRate(double rampRate)
-
+void
+setLoopRampRate(double rampRate)
+
Set the maximum rate the open/closed loop output can change by.
-void
-setMotorBrake(boolean isBrakeMode)
-
+void
+setMotorBrake(boolean isBrakeMode)
+
Set the idle mode.
-void
-setPosition(double position)
-
+void
+setPosition(double position)
+
Set the integrated encoder position.
-void
-setReference(double setpoint,
+void
+setReference(double setpoint,
double feedforward)
-
+
Set the closed loop PID controller reference point.
-void
-setVoltageCompensation(double nominalVoltage)
-
+void
+setVoltageCompensation(double nominalVoltage)
+
Set the voltage compensation for the swerve module motor.
@@ -476,6 +491,38 @@ loadScripts(document, 'script');
+
+configureCANStatusFrames
+public void configureCANStatusFrames(int CANStatus1,
+ int CANStatus2,
+ int CANStatus3,
+ int CANStatus4,
+ int CANStatus8,
+ int CANStatus10,
+ int CANStatus12,
+ int CANStatus13,
+ int CANStatus14,
+ int CANStatus21,
+ int CANStatusCurrent)
+Set the CAN status frames.
+
+- Parameters:
+CANStatus1 - Applied Motor Output, Fault Information, Limit Switch Information
+CANStatus2 - Selected Sensor Position (PID 0), Selected Sensor Velocity (PID 0), Brushed Supply Current
+ Measurement, Sticky Fault Information
+CANStatus3 - Quadrature Information
+CANStatus4 - Analog Input, Supply Battery Voltage, Controller Temperature
+CANStatus8 - Pulse Width Information
+CANStatus10 - Motion Profiling/Motion Magic Information
+CANStatus12 - Selected Sensor Position (Aux PID 1), Selected Sensor Velocity (Aux PID 1)
+CANStatus13 - PID0 (Primary PID) Information
+CANStatus14 - PID1 (Auxiliary PID) Information
+CANStatus21 - Integrated Sensor Position (Talon FX), Integrated Sensor Velocity (Talon FX)
+CANStatusCurrent - Brushless Supply Current Measurement, Brushless Stator Current Measurement
+
+
+
+
configurePIDF
diff --git a/docs/swervelib/motors/package-summary.html b/docs/swervelib/motors/package-summary.html
index 2c0f410..f1a924d 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 83c7083..fc27502 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 3176bcf..973f64f 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 bd8bce6..e6ab312 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 b0b5c62..9fb8387 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 2eb6f47..48be576 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 34c44db..1e67168 100644
--- a/docs/swervelib/parser/SwerveDriveConfiguration.html
+++ b/docs/swervelib/parser/SwerveDriveConfiguration.html
@@ -1,11 +1,11 @@
-
+
SwerveDriveConfiguration
-
+
diff --git a/docs/swervelib/parser/SwerveModuleConfiguration.html b/docs/swervelib/parser/SwerveModuleConfiguration.html
index e9504de..0711306 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 f9f00ad..36bbbff 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 92aa675..f49ae9c 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 0bf8ba6..14f6763 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 23ee9e2..2eb08fa 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 f0a8839..997078e 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 00acea8..d008de9 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 d33efc9..7929e5b 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 8a6b99b..3f5e88e 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 0f11fe5..88632ed 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 ef0676f..8eb0a0b 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 7302d5e..abf8747 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 f452c32..35bcfd5 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 8f588b7..58a4688 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 00080e3..9079178 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 9bb2be9..c5fecd8 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 eb68109..dcca564 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 96c93cb..fed5886 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 dcc42db..3f3f76c 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 0eec26d..ab18284 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 8acdafe..b0c7de0 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 7fc749b..a030596 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 28f7d08..9951345 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 df18c20..ac7a81c 100644
--- a/docs/swervelib/simulation/SwerveModuleSimulation.html
+++ b/docs/swervelib/simulation/SwerveModuleSimulation.html
@@ -1,11 +1,11 @@
-
+
SwerveModuleSimulation
-
+
diff --git a/docs/swervelib/simulation/ctre/PhysicsSim.SimProfile.html b/docs/swervelib/simulation/ctre/PhysicsSim.SimProfile.html
index d22df89..dbb9e72 100644
--- a/docs/swervelib/simulation/ctre/PhysicsSim.SimProfile.html
+++ b/docs/swervelib/simulation/ctre/PhysicsSim.SimProfile.html
@@ -1,11 +1,11 @@
-
+
PhysicsSim.SimProfile
-
+
diff --git a/docs/swervelib/simulation/ctre/PhysicsSim.html b/docs/swervelib/simulation/ctre/PhysicsSim.html
index 8301446..301bc28 100644
--- a/docs/swervelib/simulation/ctre/PhysicsSim.html
+++ b/docs/swervelib/simulation/ctre/PhysicsSim.html
@@ -1,11 +1,11 @@
-
+
PhysicsSim
-
+
diff --git a/docs/swervelib/simulation/ctre/TalonFXSimProfile.html b/docs/swervelib/simulation/ctre/TalonFXSimProfile.html
index 1bdeb41..4358734 100644
--- a/docs/swervelib/simulation/ctre/TalonFXSimProfile.html
+++ b/docs/swervelib/simulation/ctre/TalonFXSimProfile.html
@@ -1,11 +1,11 @@
-
+
TalonFXSimProfile
-
+
diff --git a/docs/swervelib/simulation/ctre/TalonSRXSimProfile.html b/docs/swervelib/simulation/ctre/TalonSRXSimProfile.html
index 753629a..cbc5994 100644
--- a/docs/swervelib/simulation/ctre/TalonSRXSimProfile.html
+++ b/docs/swervelib/simulation/ctre/TalonSRXSimProfile.html
@@ -1,11 +1,11 @@
-
+
TalonSRXSimProfile
-
+
diff --git a/docs/swervelib/simulation/ctre/VictorSPXSimProfile.html b/docs/swervelib/simulation/ctre/VictorSPXSimProfile.html
index bf6d493..a372035 100644
--- a/docs/swervelib/simulation/ctre/VictorSPXSimProfile.html
+++ b/docs/swervelib/simulation/ctre/VictorSPXSimProfile.html
@@ -1,11 +1,11 @@
-
+
VictorSPXSimProfile
-
+
diff --git a/docs/swervelib/simulation/ctre/package-summary.html b/docs/swervelib/simulation/ctre/package-summary.html
index 607e096..bf8de92 100644
--- a/docs/swervelib/simulation/ctre/package-summary.html
+++ b/docs/swervelib/simulation/ctre/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib.simulation.ctre
-
+
diff --git a/docs/swervelib/simulation/ctre/package-tree.html b/docs/swervelib/simulation/ctre/package-tree.html
index 917f879..2dc0dbd 100644
--- a/docs/swervelib/simulation/ctre/package-tree.html
+++ b/docs/swervelib/simulation/ctre/package-tree.html
@@ -1,11 +1,11 @@
-
+
swervelib.simulation.ctre Class Hierarchy
-
+
diff --git a/docs/swervelib/simulation/package-summary.html b/docs/swervelib/simulation/package-summary.html
index 868460d..0b68a7f 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 9382ef5..77bad7d 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/SwerveDriveTelemetry.TelemetryVerbosity.html b/docs/swervelib/telemetry/SwerveDriveTelemetry.TelemetryVerbosity.html
index d7976e3..2ae32d7 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 5c7872f..2d3579e 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 ea37a39..d7cfb6a 100644
--- a/docs/swervelib/telemetry/package-summary.html
+++ b/docs/swervelib/telemetry/package-summary.html
@@ -1,11 +1,11 @@
-
+
swervelib.telemetry
-
+
diff --git a/docs/swervelib/telemetry/package-tree.html b/docs/swervelib/telemetry/package-tree.html
index e1de47d..52886c6 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 3fdcf94..f6fe1e1 100644
--- a/swervelib/SwerveDrive.java
+++ b/swervelib/SwerveDrive.java
@@ -69,23 +69,27 @@ public class SwerveDrive
* Trustworthiness of the vision system Measured in expected standard deviation (meters of position and degrees of
* rotation)
*/
- public Matrix visionMeasurementStdDevs = VecBuilder.fill(0.9, 0.9, 0.9);
+ public Matrix visionMeasurementStdDevs = VecBuilder.fill(0.9, 0.9, 0.9);
+ /**
+ * Invert odometry readings of drive motor positions, used as a patch for debugging currently.
+ */
+ public boolean invertOdometry = false;
/**
* 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
@@ -261,9 +265,10 @@ public class SwerveDrive
if (SwerveDriveTelemetry.verbosity.ordinal() >= TelemetryVerbosity.HIGH.ordinal())
{
- SwerveModuleState2 moduleState = module.getState();
- SwerveDriveTelemetry.desiredStates[module.moduleNumber * 2] = moduleState.angle.getDegrees();
- SwerveDriveTelemetry.desiredStates[(module.moduleNumber * 2) + 1] = moduleState.speedMetersPerSecond;
+ SwerveDriveTelemetry.desiredStates[module.moduleNumber *
+ 2] = desiredStates[module.moduleNumber].angle.getDegrees();
+ SwerveDriveTelemetry.desiredStates[(module.moduleNumber * 2) +
+ 1] = desiredStates[module.moduleNumber].speedMetersPerSecond;
}
if (SwerveDriveTelemetry.verbosity == TelemetryVerbosity.HIGH)
{
@@ -367,7 +372,8 @@ public class SwerveDrive
}
/**
- * Gets the current module positions (azimuth and wheel position (meters))
+ * Gets the current module positions (azimuth and wheel position (meters)). Inverts the distance from each module if
+ * {@link #invertOdometry} is true.
*
* @return A list of SwerveModulePositions containg the current module positions
*/
@@ -378,6 +384,10 @@ public class SwerveDrive
for (SwerveModule module : swerveModules)
{
positions[module.moduleNumber] = module.getPosition();
+ if (invertOdometry)
+ {
+ positions[module.moduleNumber].distanceMeters *= -1;
+ }
}
return positions;
}
@@ -629,7 +639,7 @@ public class SwerveDrive
/**
* Add a vision measurement to the {@link SwerveDrivePoseEstimator} and update the {@link SwerveIMU} gyro reading with
- * the given timestamp of the vision measurement. THIS WILL BREAK IF UPDATED TOO OFTEN.
+ * the given timestamp of the vision measurement.
*
* @param robotPose Robot {@link Pose2d} as measured by vision.
* @param timestamp Timestamp the measurement was taken as time since startup, should be taken from
diff --git a/swervelib/motors/TalonFXSwerve.java b/swervelib/motors/TalonFXSwerve.java
index 19e1123..967fdfa 100644
--- a/swervelib/motors/TalonFXSwerve.java
+++ b/swervelib/motors/TalonFXSwerve.java
@@ -155,6 +155,40 @@ public class TalonFXSwerve extends SwerveMotor
public void configureCANStatusFrames(int CANStatus1)
{
motor.setStatusFramePeriod(StatusFrameEnhanced.Status_1_General, CANStatus1);
+ }
+
+ /**
+ * Set the CAN status frames.
+ *
+ * @param CANStatus1 Applied Motor Output, Fault Information, Limit Switch Information
+ * @param CANStatus2 Selected Sensor Position (PID 0), Selected Sensor Velocity (PID 0), Brushed Supply Current
+ * Measurement, Sticky Fault Information
+ * @param CANStatus3 Quadrature Information
+ * @param CANStatus4 Analog Input, Supply Battery Voltage, Controller Temperature
+ * @param CANStatus8 Pulse Width Information
+ * @param CANStatus10 Motion Profiling/Motion Magic Information
+ * @param CANStatus12 Selected Sensor Position (Aux PID 1), Selected Sensor Velocity (Aux PID 1)
+ * @param CANStatus13 PID0 (Primary PID) Information
+ * @param CANStatus14 PID1 (Auxiliary PID) Information
+ * @param CANStatus21 Integrated Sensor Position (Talon FX), Integrated Sensor Velocity (Talon FX)
+ * @param CANStatusCurrent Brushless Supply Current Measurement, Brushless Stator Current Measurement
+ */
+ public void configureCANStatusFrames(int CANStatus1, int CANStatus2, int CANStatus3, int CANStatus4, int CANStatus8,
+ int CANStatus10, int CANStatus12, int CANStatus13, int CANStatus14,
+ int CANStatus21, int CANStatusCurrent)
+ {
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_1_General, CANStatus1);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_2_Feedback0, CANStatus2);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_3_Quadrature, CANStatus3);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_4_AinTempVbat, CANStatus4);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_8_PulseWidth, CANStatus8);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_10_Targets, CANStatus10);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_12_Feedback1, CANStatus12);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_13_Base_PIDF0, CANStatus13);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_14_Turn_PIDF1, CANStatus14);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_21_FeedbackIntegrated, CANStatus21);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_Brushless_Current, CANStatusCurrent);
+
// TODO: Configure Status Frame 2 thru 21 if necessary
// https://v5.docs.ctr-electronics.com/en/stable/ch18_CommonAPI.html#setting-status-frame-periods
}
@@ -346,6 +380,7 @@ public class TalonFXSwerve extends SwerveMotor
{
if (!absoluteEncoder && !SwerveDriveTelemetry.isSimulation)
{
+ position = position < 0 ? (position % 360) + 360 : position; // Fixes initial 360 movement.
motor.setSelectedSensorPosition(position / positionConversionFactor, 0, 250);
}
}
diff --git a/swervelib/motors/TalonSRXSwerve.java b/swervelib/motors/TalonSRXSwerve.java
index 6a7a650..47dad38 100644
--- a/swervelib/motors/TalonSRXSwerve.java
+++ b/swervelib/motors/TalonSRXSwerve.java
@@ -145,6 +145,40 @@ public class TalonSRXSwerve extends SwerveMotor
public void configureCANStatusFrames(int CANStatus1)
{
motor.setStatusFramePeriod(StatusFrameEnhanced.Status_1_General, CANStatus1);
+ }
+
+ /**
+ * Set the CAN status frames.
+ *
+ * @param CANStatus1 Applied Motor Output, Fault Information, Limit Switch Information
+ * @param CANStatus2 Selected Sensor Position (PID 0), Selected Sensor Velocity (PID 0), Brushed Supply Current
+ * Measurement, Sticky Fault Information
+ * @param CANStatus3 Quadrature Information
+ * @param CANStatus4 Analog Input, Supply Battery Voltage, Controller Temperature
+ * @param CANStatus8 Pulse Width Information
+ * @param CANStatus10 Motion Profiling/Motion Magic Information
+ * @param CANStatus12 Selected Sensor Position (Aux PID 1), Selected Sensor Velocity (Aux PID 1)
+ * @param CANStatus13 PID0 (Primary PID) Information
+ * @param CANStatus14 PID1 (Auxiliary PID) Information
+ * @param CANStatus21 Integrated Sensor Position (Talon FX), Integrated Sensor Velocity (Talon FX)
+ * @param CANStatusCurrent Brushless Supply Current Measurement, Brushless Stator Current Measurement
+ */
+ public void configureCANStatusFrames(int CANStatus1, int CANStatus2, int CANStatus3, int CANStatus4, int CANStatus8,
+ int CANStatus10, int CANStatus12, int CANStatus13, int CANStatus14,
+ int CANStatus21, int CANStatusCurrent)
+ {
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_1_General, CANStatus1);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_2_Feedback0, CANStatus2);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_3_Quadrature, CANStatus3);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_4_AinTempVbat, CANStatus4);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_8_PulseWidth, CANStatus8);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_10_Targets, CANStatus10);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_12_Feedback1, CANStatus12);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_13_Base_PIDF0, CANStatus13);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_14_Turn_PIDF1, CANStatus14);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_21_FeedbackIntegrated, CANStatus21);
+ motor.setStatusFramePeriod(StatusFrameEnhanced.Status_Brushless_Current, CANStatusCurrent);
+
// TODO: Configure Status Frame 2 thru 21 if necessary
// https://v5.docs.ctr-electronics.com/en/stable/ch18_CommonAPI.html#setting-status-frame-periods
}
@@ -336,6 +370,7 @@ public class TalonSRXSwerve extends SwerveMotor
{
if (!absoluteEncoder && !SwerveDriveTelemetry.isSimulation)
{
+ position = position < 0 ? (position % 360) + 360 : position; // Fixes initial 360 movement.
motor.setSelectedSensorPosition(position / positionConversionFactor, 0, 250);
}
}