diff --git a/docs/allclasses-index.html b/docs/allclasses-index.html index f8825eda..124f19ad 100644 --- a/docs/allclasses-index.html +++ b/docs/allclasses-index.html @@ -1,11 +1,11 @@
- +Canandcoder
from ReduxRobotics absolute encoder, attached through the CAN bus.Canandmag
from ReduxRobotics absolute encoder, attached through the CAN bus.Canandcoder
from ReduxRobotics absolute encoder, attached through the CAN bus.Canandmag
from ReduxRobotics absolute encoder, attached through the CAN bus.Canandcoder
Canandmag
Canandcoder
representing the CANandCoder on the CAN bus.Canandmag
representing the CANandCoder on the CAN bus.ADXRS450_Gyro
device to read the current headings from.void
setVisionMeasurementStdDevs(edu.wpi.first.math.Matrix<edu.wpi.first.math.numbers.N3,edu.wpi.first.math.numbers.N1> visionMeasurementStdDevs)
void
void
updateCacheValidityPeriods(long imu,
- long driveMotor,
- long absoluteEncoder)
void
updateCacheValidityPeriods(long imu,
+ long driveMotor,
+ long absoluteEncoder)
void
zeroGyro()
void
zeroGyro()
visionMeasurementStdDevs
- Standard deviations of the vision measurements. Increase these numbers to trust
+ global measurements from vision less. This matrix is in the form [x, y, theta],
+ with units in meters and radians.Canandcoder
from ReduxRobotics absolute encoder, attached through the CAN bus.Canandmag
from ReduxRobotics absolute encoder, attached through the CAN bus.com.reduxrobotics.sensors.canandcoder.Canandcoder
com.reduxrobotics.sensors.canandmag.Canandmag
Canandcoder
representing the CANandCoder on the CAN bus.Canandmag
representing the CANandCoder on the CAN bus.CanAndCoderSwerve(int canid)
Canandcoder
Canandmag
Canandcoder
representing the CANandCoder on the CAN bus.Canandmag
representing the CANandCoder on the CAN bus.Canandcoder
Canandmag
canid
- The CAN ID whenever the CANandCoder is operating on the CANBus.Canandcoder
from ReduxRobotics absolute encoder, attached through the CAN bus.Canandmag
from ReduxRobotics absolute encoder, attached through the CAN bus.edu.wpi.first.math.geometry.Rotation3d
double
getRate()
Rotation3d
from the IMU without any zeroing.edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.Rotation3d
from the IMU without any zeroing.void
setInverted(boolean invertIMU)
edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
setInverted(boolean invertIMU)
void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
edu.wpi.first.math.geometry.Rotation3d
double
getRate()
Rotation3d
from the IMU without any zeroing.edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.Rotation3d
from the IMU without any zeroing.void
setInverted(boolean invertIMU)
edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
setInverted(boolean invertIMU)
void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
edu.wpi.first.math.geometry.Rotation3d
double
getRate()
Rotation3d
from the IMU without any zeroing.edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.Rotation3d
from the IMU without any zeroing.void
setInverted(boolean invertIMU)
edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
setInverted(boolean invertIMU)
void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
private final edu.wpi.first.wpilibj.AnalogGyro
edu.wpi.first.math.geometry.Rotation3d
double
getRate()
Rotation3d
from the IMU without any zeroing.edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.Rotation3d
from the IMU without any zeroing.void
setInverted(boolean invertIMU)
edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
setInverted(boolean invertIMU)
void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
private com.kauailabs.navx.frc.AHRS
edu.wpi.first.math.geometry.Rotation3d
double
getRate()
Rotation3d
from the IMU without any zeroing.edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.Rotation3d
from the IMU without any zeroing.void
setInverted(boolean invertIMU)
edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
setInverted(boolean invertIMU)
void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
edu.wpi.first.math.geometry.Rotation3d
double
getRate()
Rotation3d
from the IMU without any zeroing.edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.Rotation3d
from the IMU without any zeroing.void
setInverted(boolean invertIMU)
edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
setInverted(boolean invertIMU)
void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
edu.wpi.first.math.geometry.Rotation3d
double
getRate()
Rotation3d
from the IMU without any zeroing.edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.Rotation3d
from the IMU without any zeroing.void
setInverted(boolean invertIMU)
edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
setInverted(boolean invertIMU)
void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
abstract edu.wpi.first.math.geometry.Rotation3d
abstract double
getRate()
Rotation3d
from the IMU without any zeroing.abstract edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.Rotation3d
from the IMU without any zeroing.abstract void
setInverted(boolean invertIMU)
abstract edu.wpi.first.math.geometry.Rotation3d
Rotation3d
from the IMU.abstract void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
setInverted(boolean invertIMU)
abstract void
setOffset(edu.wpi.first.math.geometry.Rotation3d offset)
A more formal definition: returns the closest angle n
to scopeReference
such that n
is
congruent to newAngle
.
* A more formal definition: returns the closest angle {@code n} to {@code scopeReference} such that {@code n} is * congruent to {@code newAngle}. * diff --git a/swervelib/motors/SparkFlexSwerve.java b/swervelib/motors/SparkFlexSwerve.java index 0c96826a..40a27702 100644 --- a/swervelib/motors/SparkFlexSwerve.java +++ b/swervelib/motors/SparkFlexSwerve.java @@ -200,7 +200,11 @@ public void clearStickyFaults() @Override public SwerveMotor setAbsoluteEncoder(SwerveAbsoluteEncoder encoder) { - if (encoder.getAbsoluteEncoder() instanceof MotorFeedbackSensor) + if (encoder == null) + { + absoluteEncoder = null; + configureSparkFlex(() -> pid.setFeedbackDevice(this.encoder)); + } else if (encoder.getAbsoluteEncoder() instanceof MotorFeedbackSensor) { absoluteEncoderOffsetWarning.set(true); absoluteEncoder = encoder; diff --git a/swervelib/motors/SparkMaxBrushedMotorSwerve.java b/swervelib/motors/SparkMaxBrushedMotorSwerve.java index bb33fc4c..d8fb2a8a 100644 --- a/swervelib/motors/SparkMaxBrushedMotorSwerve.java +++ b/swervelib/motors/SparkMaxBrushedMotorSwerve.java @@ -237,7 +237,11 @@ public void clearStickyFaults() @Override public SwerveMotor setAbsoluteEncoder(SwerveAbsoluteEncoder encoder) { - if (encoder.getAbsoluteEncoder() instanceof AbsoluteEncoder) + if (encoder == null) + { + absoluteEncoder = null; + configureSparkMax(() -> pid.setFeedbackDevice(this.encoder)); + } else if (encoder.getAbsoluteEncoder() instanceof AbsoluteEncoder) { absoluteEncoder = (AbsoluteEncoder) encoder.getAbsoluteEncoder(); configureSparkMax(() -> pid.setFeedbackDevice(absoluteEncoder)); diff --git a/swervelib/motors/SparkMaxSwerve.java b/swervelib/motors/SparkMaxSwerve.java index aa19a0cf..a2c421e1 100644 --- a/swervelib/motors/SparkMaxSwerve.java +++ b/swervelib/motors/SparkMaxSwerve.java @@ -192,10 +192,16 @@ public void clearStickyFaults() @Override public SwerveMotor setAbsoluteEncoder(SwerveAbsoluteEncoder encoder) { - if (encoder.getAbsoluteEncoder() instanceof MotorFeedbackSensor) + if (encoder == null) + { + absoluteEncoder = null; + configureSparkMax(() -> pid.setFeedbackDevice(this.encoder)); + velocity = this.encoder::getVelocity; + position = this.encoder::getPosition; + } else if (encoder.getAbsoluteEncoder() instanceof MotorFeedbackSensor) { DriverStation.reportWarning( - "IF possible configure the duty cycle encoder offset in the REV Hardware Client instead of using the" + + "IF possible configure the encoder offset in the REV Hardware Client instead of using the" + " absoluteEncoderOffset in the Swerve Module JSON!", false); absoluteEncoder = encoder; diff --git a/swervelib/parser/SwerveDriveConfiguration.java b/swervelib/parser/SwerveDriveConfiguration.java index d3bcf0c1..347b187d 100644 --- a/swervelib/parser/SwerveDriveConfiguration.java +++ b/swervelib/parser/SwerveDriveConfiguration.java @@ -11,6 +11,10 @@ public class SwerveDriveConfiguration { + /** + * Number of modules on the robot. + */ + public final int moduleCount; /** * Swerve Module locations. */ @@ -19,10 +23,6 @@ public class SwerveDriveConfiguration * Swerve IMU */ public SwerveIMU imu; - /** - * Number of modules on the robot. - */ - public final int moduleCount; /** * Swerve Modules. */ diff --git a/swervelib/parser/json/ModuleJson.java b/swervelib/parser/json/ModuleJson.java index 5eb34713..4e89652b 100644 --- a/swervelib/parser/json/ModuleJson.java +++ b/swervelib/parser/json/ModuleJson.java @@ -81,15 +81,6 @@ public SwerveModuleConfiguration createModuleConfiguration( SwerveMotor angleMotor = angle.createMotor(false); SwerveAbsoluteEncoder absEncoder = encoder.createEncoder(angleMotor); - // If the absolute encoder is attached. - if (absEncoder != null && angleMotor.getMotor() instanceof CANSparkMax) - { - if (absEncoder.getAbsoluteEncoder() instanceof MotorFeedbackSensor) - { - angleMotor.setAbsoluteEncoder(absEncoder); - } - } - // Setup deprecation notice. // if (this.conversionFactor.drive != 0 && this.conversionFactor.angle != 0) // { diff --git a/swervelib/parser/json/PhysicalPropertiesJson.java b/swervelib/parser/json/PhysicalPropertiesJson.java index 7715d9d9..60be9d25 100644 --- a/swervelib/parser/json/PhysicalPropertiesJson.java +++ b/swervelib/parser/json/PhysicalPropertiesJson.java @@ -2,8 +2,6 @@ import swervelib.parser.SwerveModulePhysicalCharacteristics; import swervelib.parser.json.modules.ConversionFactorsJson; -import swervelib.telemetry.Alert; -import swervelib.telemetry.Alert.AlertType; /** * {@link swervelib.parser.SwerveModulePhysicalCharacteristics} parsed data. Used to configure the SwerveModule.