diff --git a/deploy/example.txt b/deploy/example.txt new file mode 100644 index 0000000..bb82515 --- /dev/null +++ b/deploy/example.txt @@ -0,0 +1,3 @@ +Files placed in this directory will be deployed to the RoboRIO into the +'deploy' directory in the home folder. Use the 'Filesystem.getDeployDirectory' wpilib function +to get a proper path relative to the deploy directory. \ No newline at end of file diff --git a/deploy/modules/back/left.json b/deploy/modules/back/left.json deleted file mode 100644 index 578a533..0000000 --- a/deploy/modules/back/left.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "IntegratedAbsoluteEncoder": false, - "AbsoluteEncoder": { - "Type": "CANCoder", - "ID": 12, - "Offset": 72.070 - }, - "Motor": { - "Drive": { - "Type": "Neo", - "ID": 7 - }, - "Steer": { - "Type": "Neo", - "ID": 8, - "FreeSpeedRPM": 5676 - } - } -} \ No newline at end of file diff --git a/deploy/modules/back/right.json b/deploy/modules/back/right.json deleted file mode 100644 index d51e3e8..0000000 --- a/deploy/modules/back/right.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "IntegratedAbsoluteEncoder": false, - "AbsoluteEncoder": { - "Type": "CANCoder", - "ID": 11, - "Offset": 39.551 - }, - "Motor": { - "Drive": { - "Type": "Neo", - "ID": 5 - }, - "Steer": { - "Type": "Neo", - "ID": 6, - "FreeSpeedRPM": 5676 - } - } -} \ No newline at end of file diff --git a/deploy/modules/front/left.json b/deploy/modules/front/left.json deleted file mode 100644 index 498bd86..0000000 --- a/deploy/modules/front/left.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "IntegratedAbsoluteEncoder": false, - "AbsoluteEncoder": { - "Type": "CANCoder", - "ID": 9, - "Offset": -115.576 - }, - "Motor": { - "Drive": { - "Type": "Neo", - "ID": 4 - }, - "Steer": { - "Type": "Neo", - "ID": 3, - "FreeSpeedRPM": 5676 - } - } -} \ No newline at end of file diff --git a/deploy/modules/front/right.json b/deploy/modules/front/right.json deleted file mode 100644 index 72de8dd..0000000 --- a/deploy/modules/front/right.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "IntegratedAbsoluteEncoder": false, - "AbsoluteEncoder": { - "Type": "CANCoder", - "ID": 10, - "Offset": -173.320 - }, - "Motor": { - "Drive": { - "Type": "Neo", - "ID": 2 - }, - "Steer": { - "Type": "Neo", - "ID": 1, - "FreeSpeedRPM": 5676 - } - } -} \ No newline at end of file diff --git a/deploy/swerve.json b/deploy/swerve.json deleted file mode 100644 index d85c935..0000000 --- a/deploy/swerve.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "WheelBase": 23.75, - "TrackWidth": 23.75, - "WheelDiameter": 4, - "Speed": { - "MetersPerSecond": 1.25, - "PhysicalMetersPerSecond": 5, - "RadianPerSecond": 1 - }, - "Acceleration": { - "MetersPerSecond": 1, - "RadianPerSecond": 1 - }, - "Drive": { - "Inverted": true, - "GearRatio": 6.75, - "MaxPower": 0.6, - "CurrentLimit": 40 - }, - "Steer": { - "Inverted": false, - "GearRatio": 12.8, - "MaxPower": 0.4, - "CurrentLimit": 20 - }, - "Gyro": { - "Inverted": false, - "Type": "Pigeon2", - "ID": 13, - "CANBus": "canivore" - }, - "Initial Pose": { - "X": 0, - "Y": 0, - "Rotation": 0 - } -} \ No newline at end of file diff --git a/deploy/swerve/controllerproperties.json b/deploy/swerve/controllerproperties.json new file mode 100644 index 0000000..669097e --- /dev/null +++ b/deploy/swerve/controllerproperties.json @@ -0,0 +1,8 @@ +{ + "angleJoystickRadiusDeadband": 0.5, + "heading": { + "p": 0.4, + "i": 0, + "d": 0.01 + } +} \ No newline at end of file diff --git a/deploy/swerve/modules/backleft.json b/deploy/swerve/modules/backleft.json new file mode 100644 index 0000000..872d9be --- /dev/null +++ b/deploy/swerve/modules/backleft.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "sparkmax", + "id": 7, + "canbus": null + }, + "angle": { + "type": "sparkmax", + "id": 8, + "canbus": null + }, + "encoder": { + "type": "cancoder", + "id": 12, + "canbus": null + }, + "inverted": { + "drive": false, + "angle": false + }, + "absoluteEncoderOffset": 6.504, + "location": { + "x": -12, + "y": 12 + } +} \ No newline at end of file diff --git a/deploy/swerve/modules/backright.json b/deploy/swerve/modules/backright.json new file mode 100644 index 0000000..1fe4f3f --- /dev/null +++ b/deploy/swerve/modules/backright.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "sparkmax", + "id": 5, + "canbus": null + }, + "angle": { + "type": "sparkmax", + "id": 6, + "canbus": null + }, + "encoder": { + "type": "cancoder", + "id": 11, + "canbus": null + }, + "inverted": { + "drive": false, + "angle": false + }, + "absoluteEncoderOffset": -18.281, + "location": { + "x": -12, + "y": -12 + } +} \ No newline at end of file diff --git a/deploy/swerve/modules/frontleft.json b/deploy/swerve/modules/frontleft.json new file mode 100644 index 0000000..734eb96 --- /dev/null +++ b/deploy/swerve/modules/frontleft.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "sparkmax", + "id": 4, + "canbus": null + }, + "angle": { + "type": "sparkmax", + "id": 3, + "canbus": null + }, + "encoder": { + "type": "cancoder", + "id": 9, + "canbus": null + }, + "inverted": { + "drive": false, + "angle": false + }, + "absoluteEncoderOffset": -114.609, + "location": { + "x": 12, + "y": 12 + } +} \ No newline at end of file diff --git a/deploy/swerve/modules/frontright.json b/deploy/swerve/modules/frontright.json new file mode 100644 index 0000000..bdf9983 --- /dev/null +++ b/deploy/swerve/modules/frontright.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "sparkmax", + "id": 2, + "canbus": null + }, + "angle": { + "type": "sparkmax", + "id": 1, + "canbus": null + }, + "encoder": { + "type": "cancoder", + "id": 10, + "canbus": null + }, + "inverted": { + "drive": false, + "angle": false + }, + "absoluteEncoderOffset": -50.977, + "location": { + "x": 12, + "y": -12 + } +} \ No newline at end of file diff --git a/deploy/swerve/modules/physicalproperties.json b/deploy/swerve/modules/physicalproperties.json new file mode 100644 index 0000000..fb985af --- /dev/null +++ b/deploy/swerve/modules/physicalproperties.json @@ -0,0 +1,17 @@ +{ + "wheelDiameter": 4, + "gearRatio": { + "drive": 6.75, + "angle": 12.8 + }, + "currentLimit": { + "drive": 40, + "angle": 20 + }, + "rampRate": { + "drive": 0.25, + "angle": 0.25 + }, + "wheelGripCoefficientOfFriction": 1.19, + "angleMotorFreeSpeedRPM": 5676 +} \ No newline at end of file diff --git a/deploy/swerve/modules/pidfproperties.json b/deploy/swerve/modules/pidfproperties.json new file mode 100644 index 0000000..99664bb --- /dev/null +++ b/deploy/swerve/modules/pidfproperties.json @@ -0,0 +1,16 @@ +{ + "drive": { + "p": 0.0020645, + "i": 0, + "d": 0, + "f": 0, + "iz": 0 + }, + "angle": { + "p": 0.01, + "i": 0, + "d": 0, + "f": 0, + "iz": 0 + } +} \ No newline at end of file diff --git a/deploy/swerve/swervedrive.json b/deploy/swerve/swervedrive.json new file mode 100644 index 0000000..6b2bfc3 --- /dev/null +++ b/deploy/swerve/swervedrive.json @@ -0,0 +1,16 @@ +{ + "maxSpeed": 14.5, + "optimalVoltage": 12, + "imu": { + "type": "pigeon2", + "id": 13, + "canbus": "canivore" + }, + "invertedIMU": true, + "modules": [ + "frontleft.json", + "frontright.json", + "backleft.json", + "backright.json" + ] +} \ No newline at end of file diff --git a/docs/allclasses-index.html b/docs/allclasses-index.html index 9731fd0..0c3cccf 100644 --- a/docs/allclasses-index.html +++ b/docs/allclasses-index.html @@ -2,20 +2,21 @@ - + All Classes - + - + + - - + +
  • Overview
  • Package
  • Class
  • -
  • Use
  • Tree
  • Deprecated
  • Index
  • @@ -112,112 +112,205 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height")); Description -CTRECANCoder -  +BoolMotorJson + +
    Inverted motor JSON parsed class.
    + -CTRESwerveMotor -  +CANCoderSwerve + +
    Swerve Absolute Encoder for CTRE CANCoders.
    + -CTRESwerveMotor.CTRE_pidIdx +ControllerPropertiesJson -
    The TalonSRX PID to use onboard.
    +
    SwerveController parsed class.
    -CTRESwerveMotor.CTRE_remoteSensor -  +DeviceJson + +
    Device JSON parsed class.
    + -CTRESwerveMotor.CTRE_slotIdx +LocationJson -
    The Talon SRX Slot profile used to configure the motor to use for the PID.
    +
    Location JSON parsed class.
    -PWMAnalogEncoder -  +ModuleJson + +
    SwerveModule JSON parsed class.
    + -PWMDutyCycleEncoder -  +MotorConfigDouble + +
    Used to store doubles for motor configuration.
    + -REVAbsoluteEncoder -  +MotorConfigInt + +
    Used to store ints for motor configuration.
    + -REVSwerveMotor -  +NavXSwerve + +
    Communicates with the NavX as the IMU.
    + -REVSwerveMotor.REV_slotIdx +PhysicalPropertiesJson + +
    SwerveModulePhysicalCharacteristics parsed data.
    + + + +PIDFConfig + +
    Hold the PIDF and Integral Zone values for a PID.
    + + + +PIDFPropertiesJson + +
    SwerveModule PID with Feedforward for the drive motor and angle + motor.
    + + + +PIDFRange + +
    Class to hold the minimum and maximum input or output of the PIDF.
    + + + +Pigeon2Swerve + +
    SwerveIMU interface for the Pigeon2
    + + + +PigeonSwerve + +
    SwerveIMU interface for the Pigeon.
    + + + +SparkMaxEncoderSwerve + +
    SparkMax absolute encoder, attached through the data port.
    + + + +SparkMaxSwerve + +
    An implementation of CANSparkMax as a SwerveMotor.
    + + + +SparkMaxSwerve.SparkMAX_slotIdx
    REV Slots for PID configuration.
    - -SwerveDrive + +SwerveAbsoluteEncoder -
    SwerveDrive base which is meant to be platform agnostic.
    +
    Swerve abstraction class to define a standard interface with absolute encoders for swerve modules..
    - -SwerveDrive.SwerveModuleConfig<DriveMotorType extends edu.wpi.first.wpilibj.motorcontrol.MotorController,​SteeringMotorType extends edu.wpi.first.wpilibj.motorcontrol.MotorController,​AbsoluteEncoder extends com.ctre.phoenix.sensors.CANCoder> + +SwerveController -
    Helper class for easier swerve module creation
    +
    Controller class used to convert raw inputs into robot speeds.
    - -SwerveDriveKinematics2 + +SwerveControllerConfiguration + +
    Swerve Controller configuration class which is used to configure + SwerveController.
    + + + +SwerveDrive + +
    Swerve Drive class representing and controlling the swerve drive.
    + + + +SwerveDriveConfiguration + +
    Swerve drive configurations used during SwerveDrive construction.
    + + + +SwerveDriveJson + +
    SwerveDrive JSON parsed class.
    + + + +SwerveIMU + +
    Swerve IMU abstraction to define a standard interface with a swerve drive.
    + + + +SwerveKinematics2
    Clone of WPI SwerveKinematics, which implements second order kinematics when calculating modules states from chassis speed.
    - -SwerveEncoder<AbsoluteEncoderType> + +SwerveMath -
    Swerve Encoder class definition for common interfaces.
    +
    Mathematical functions which pertain to swerve drive.
    - -SwerveModule<DriveMotorType extends edu.wpi.first.wpilibj.motorcontrol.MotorController,​AngleMotorType extends edu.wpi.first.wpilibj.motorcontrol.MotorController,​AbsoluteEncoderType> + +SwerveModule -
    Swerve module for representing a single swerve module of the robot.
    +
    The Swerve Module class which represents and controls Swerve Modules for the swerve drive.
    - -SwerveModule.SwerveModuleLocation + +SwerveModuleConfiguration -
    Swerve Module location on the robot.
    +
    Swerve Module configuration class which is used to configure + SwerveModule.
    - -SwerveModule.Verbosity + +SwerveModulePhysicalCharacteristics -
    Verbosity levels for data publishing,
    +
    Configuration class which stores physical characteristics shared between every swerve module.
    - -SwerveModuleState2 -  - - -SwerveMotor -  - - -SwerveMotor.ModuleMotorType + +SwerveModuleState2 -
    Motor type for the swerve drive module
    +
    Second order kinematics swerve module state.
    - -SwerveParser + +SwerveMotor -
    Swerve Drive JSON parser.
    +
    Swerve motor abstraction which defines a standard interface for motors within a swerve module.
    + + + +SwerveParser + +
    Helper class used to parse the JSON directory with specified configuration options.
    @@ -239,7 +332,6 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
  • Overview
  • Package
  • Class
  • -
  • Use
  • Tree
  • Deprecated
  • Index
  • diff --git a/docs/allclasses.html b/docs/allclasses.html index e390e63..96c3b46 100644 --- a/docs/allclasses.html +++ b/docs/allclasses.html @@ -2,46 +2,59 @@ - + All Classes - + - + + - - + +

    All Classes

    diff --git a/docs/allpackages-index.html b/docs/allpackages-index.html index 4a744d3..525ce77 100644 --- a/docs/allpackages-index.html +++ b/docs/allpackages-index.html @@ -2,20 +2,21 @@ - + All Packages - + - + + - - + +
  • Overview
  • Package
  • Class
  • -
  • Use
  • Tree
  • Deprecated
  • Index
  • @@ -107,19 +107,39 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height")); -frc.robot.subsystems.swervedrive.swerve +frc.robot.subsystems.swervedrive2.swervelib   -frc.robot.subsystems.swervedrive.swerve.encoders +frc.robot.subsystems.swervedrive2.swervelib.encoders   -frc.robot.subsystems.swervedrive.swerve.kinematics +frc.robot.subsystems.swervedrive2.swervelib.imu   -frc.robot.subsystems.swervedrive.swerve.motors +frc.robot.subsystems.swervedrive2.swervelib.math +  + + +frc.robot.subsystems.swervedrive2.swervelib.motors +  + + +frc.robot.subsystems.swervedrive2.swervelib.parser +  + + +frc.robot.subsystems.swervedrive2.swervelib.parser.deserializer +  + + +frc.robot.subsystems.swervedrive2.swervelib.parser.json +  + + +frc.robot.subsystems.swervedrive2.swervelib.parser.json.modules   @@ -142,7 +162,6 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
  • Overview
  • Package
  • Class
  • -
  • Use
  • Tree
  • Deprecated
  • Index
  • diff --git a/docs/constant-values.html b/docs/constant-values.html index 3bf60f2..d94c69e 100644 --- a/docs/constant-values.html +++ b/docs/constant-values.html @@ -2,20 +2,21 @@ - + Constant Field Values - + - + + - - + +
  • Overview
  • Package
  • Class
  • -
  • Use
  • Tree
  • Deprecated
  • Index
  • @@ -95,7 +95,7 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));

    Constant Field Values

    -
    +

    Contents

    @@ -114,7 +114,6 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
  • Overview
  • Package
  • Class
  • -
  • Use
  • Tree
  • Deprecated
  • Index
  • diff --git a/docs/deprecated-list.html b/docs/deprecated-list.html index 4dadc34..1714fd9 100644 --- a/docs/deprecated-list.html +++ b/docs/deprecated-list.html @@ -2,20 +2,21 @@ - + Deprecated List - + - + + - - + +
  • Overview
  • Package
  • Class
  • -
  • Use
  • Tree
  • Index
  • @@ -112,7 +112,6 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
  • Overview
  • Package
  • Class
  • -
  • Use
  • Tree
  • Index
  • diff --git a/docs/element-list b/docs/element-list index 2857417..2e44ab0 100644 --- a/docs/element-list +++ b/docs/element-list @@ -1,4 +1,9 @@ -frc.robot.subsystems.swervedrive.swerve -frc.robot.subsystems.swervedrive.swerve.encoders -frc.robot.subsystems.swervedrive.swerve.kinematics -frc.robot.subsystems.swervedrive.swerve.motors +frc.robot.subsystems.swervedrive2.swervelib +frc.robot.subsystems.swervedrive2.swervelib.encoders +frc.robot.subsystems.swervedrive2.swervelib.imu +frc.robot.subsystems.swervedrive2.swervelib.math +frc.robot.subsystems.swervedrive2.swervelib.motors +frc.robot.subsystems.swervedrive2.swervelib.parser +frc.robot.subsystems.swervedrive2.swervelib.parser.deserializer +frc.robot.subsystems.swervedrive2.swervelib.parser.json +frc.robot.subsystems.swervedrive2.swervelib.parser.json.modules diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/SwerveController.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/SwerveController.html new file mode 100644 index 0000000..87b626f --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/SwerveController.html @@ -0,0 +1,493 @@ + + + + + +SwerveController + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class SwerveController

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.SwerveController
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class SwerveController
      +extends Object
      +
      Controller class used to convert raw inputs into robot speeds.
      +
    • +
    +
    +
    +
      +
    • + +
      + +
      + +
      +
        +
      • + + +

        Constructor Summary

        + + + + + + + + + + +
        Constructors 
        ConstructorDescription
        SwerveController​(SwerveControllerConfiguration cfg) +
        Construct the SwerveController object which is used for determining the speeds of the robot based on controller + input.
        +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Summary

        + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        All Methods Static Methods Instance Methods Concrete Methods 
        Modifier and TypeMethodDescription
        edu.wpi.first.math.kinematics.ChassisSpeedsgetTargetSpeeds​(double xInput, + double yInput, + double angle, + double currentHeadingAngleRadians) +
        Get the chassis speeds based on controller input of 1 joystick and a angle.
        +
        edu.wpi.first.math.kinematics.ChassisSpeedsgetTargetSpeeds​(double xInput, + double yInput, + double headingX, + double headingY, + double currentHeadingAngleRadians) +
        Get the chassis speeds based on controller input of 2 joysticks.
        +
        static edu.wpi.first.math.geometry.Translation2dgetTranslation2d​(edu.wpi.first.math.kinematics.ChassisSpeeds speeds) +
        Helper function to get the Translation2d of the chassis speeds given the ChassisSpeeds.
        +
        booleanwithinHypotDeadband​(double x, + double y) +
        Calculate the hypot deadband and check if the joystick is within it.
        +
        + +
      • +
      +
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + + + + + +
          +
        • +

          thetaController

          +
          private final edu.wpi.first.math.controller.PIDController thetaController
          +
          PID Controller for the robot heading.
          +
        • +
        + + + +
          +
        • +

          lastAngle

          +
          public double lastAngle
          +
          Last angle to robot was set to.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveController

          +
          public SwerveController​(SwerveControllerConfiguration cfg)
          +
          Construct the SwerveController object which is used for determining the speeds of the robot based on controller + input.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          getTranslation2d

          +
          public static edu.wpi.first.math.geometry.Translation2d getTranslation2d​(edu.wpi.first.math.kinematics.ChassisSpeeds speeds)
          +
          Helper function to get the Translation2d of the chassis speeds given the ChassisSpeeds.
          +
          +
          Parameters:
          +
          speeds - Chassis speeds.
          +
          Returns:
          +
          Translation2d of the speed the robot is going in.
          +
          +
        • +
        + + + +
          +
        • +

          withinHypotDeadband

          +
          public boolean withinHypotDeadband​(double x,
          +                                   double y)
          +
          Calculate the hypot deadband and check if the joystick is within it.
          +
          +
          Parameters:
          +
          x - The x value for the joystick in which the deadband should be applied.
          +
          y - The y value for the joystick in which the deadband should be applied.
          +
          +
        • +
        + + + +
          +
        • +

          getTargetSpeeds

          +
          public edu.wpi.first.math.kinematics.ChassisSpeeds getTargetSpeeds​(double xInput,
          +                                                                   double yInput,
          +                                                                   double angle,
          +                                                                   double currentHeadingAngleRadians)
          +
          Get the chassis speeds based on controller input of 1 joystick and a angle.
          +
          +
          Parameters:
          +
          xInput - X joystick input for the robot to move in the X direction.
          +
          yInput - Y joystick input for the robot to move in the Y direction.
          +
          angle - The desired angle of the robot in radians.
          +
          currentHeadingAngleRadians - The current robot heading in radians.
          +
          Returns:
          +
          ChassisSpeeds which can be sent to th Swerve Drive.
          +
          +
        • +
        + + + +
          +
        • +

          getTargetSpeeds

          +
          public edu.wpi.first.math.kinematics.ChassisSpeeds getTargetSpeeds​(double xInput,
          +                                                                   double yInput,
          +                                                                   double headingX,
          +                                                                   double headingY,
          +                                                                   double currentHeadingAngleRadians)
          +
          Get the chassis speeds based on controller input of 2 joysticks. One for speeds in which direction. The other for + the angle of the robot.
          +
          +
          Parameters:
          +
          xInput - X joystick input for the robot to move in the X direction.
          +
          yInput - Y joystick input for the robot to move in the Y direction.
          +
          headingX - X joystick which controls the angle of the robot.
          +
          headingY - Y joystick which controls the angle of the robot.
          +
          currentHeadingAngleRadians - The current robot heading in radians.
          +
          Returns:
          +
          ChassisSpeeds which can be sent to th Swerve Drive.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/SwerveDrive.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/SwerveDrive.html new file mode 100644 index 0000000..c5f9ac6 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/SwerveDrive.html @@ -0,0 +1,866 @@ + + + + + +SwerveDrive + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class SwerveDrive

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.SwerveDrive
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class SwerveDrive
      +extends Object
      +
      Swerve Drive class representing and controlling the swerve drive.
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Summary

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Fields 
        Modifier and TypeFieldDescription
        private doubleangle +
        The current angle of the robot and last time odometry during simulations.
        +
        edu.wpi.first.wpilibj.smartdashboard.Field2dfield +
        Field object.
        +
        private SwerveIMUimu +
        Swerve IMU device for sensing the heading of the robot.
        +
        SwerveKinematics2kinematics +
        Swerve Kinematics object utilizing second order kinematics.
        +
        private doublelastTime +
        The current angle of the robot and last time odometry during simulations.
        +
        SwerveControllerswerveController +
        Swerve controller for controlling heading of the robot.
        +
        SwerveDriveConfigurationswerveDriveConfiguration +
        Swerve drive configuration.
        +
        edu.wpi.first.math.estimator.SwerveDrivePoseEstimatorswerveDrivePoseEstimator +
        Swerve odometry.
        +
        private SwerveModule[]swerveModules +
        Swerve modules.
        +
        private edu.wpi.first.wpilibj.Timertimer +
        Time during simulations.
        +
        +
      • +
      +
      + +
      + +
      + +
      +
        +
      • + + +

        Method Summary

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        All Methods Instance Methods Concrete Methods 
        Modifier and TypeMethodDescription
        voiddrive​(edu.wpi.first.math.geometry.Translation2d translation, + double rotation, + boolean fieldRelative, + boolean isOpenLoop) +
        The primary method for controlling the drivebase.
        +
        edu.wpi.first.math.kinematics.ChassisSpeedsgetFieldVelocity() +
        Gets the current field-relative velocity (x, y and omega) of the robot
        +
        edu.wpi.first.math.kinematics.SwerveModulePosition[]getModulePositions() +
        Gets the current module positions (azimuth and wheel position (meters))
        +
        edu.wpi.first.math.geometry.Rotation2dgetPitch() +
        Gets the current yaw angle of the robot, as reported by the imu.
        +
        edu.wpi.first.math.geometry.Pose2dgetPose() +
        Gets the current pose (position and rotation) of the robot, as reported by odometry.
        +
        edu.wpi.first.math.kinematics.ChassisSpeedsgetRobotVelocity() +
        Gets the current robot-relative velocity (x, y and omega) of the robot
        +
        SwerveModuleState2[]getStates() +
        Gets the current module states (azimuth and velocity)
        +
        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.Rotation2dgetYaw() +
        Gets the current yaw angle of the robot, as reported by the imu.
        +
        voidreplaceSwerveModuleFeedforward​(edu.wpi.first.math.controller.SimpleMotorFeedforward feedforward) +
        Setup the swerve module feedforward.
        +
        voidresetOdometry​(edu.wpi.first.math.geometry.Pose2d pose) +
        Resets odometry to the given pose.
        +
        voidsetChassisSpeeds​(edu.wpi.first.math.kinematics.ChassisSpeeds chassisSpeeds) +
        Set field-relative chassis speeds with closed-loop velocity control.
        +
        voidsetDriveBrake() +
        Point all modules toward the robot center, thus making the robot very difficult to move.
        +
        voidsetModuleStates​(SwerveModuleState2[] desiredStates, + boolean isOpenLoop) +
        Set the module states (azimuth and velocity) directly.
        +
        voidsetMotorBrake​(boolean brake) +
        Sets the drive motors to brake/coast mode.
        +
        voidupdateOdometry() +
        Update odometry should be run every loop.
        +
        voidzeroGyro() +
        Resets the gyro angle to zero and resets odometry to the same position, but facing toward 0.
        +
        + +
      • +
      +
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          kinematics

          +
          public final SwerveKinematics2 kinematics
          +
          Swerve Kinematics object utilizing second order kinematics.
          +
        • +
        + + + +
          +
        • +

          swerveDriveConfiguration

          +
          public final SwerveDriveConfiguration swerveDriveConfiguration
          +
          Swerve drive configuration.
          +
        • +
        + + + +
          +
        • +

          swerveDrivePoseEstimator

          +
          public final edu.wpi.first.math.estimator.SwerveDrivePoseEstimator swerveDrivePoseEstimator
          +
          Swerve odometry.
          +
        • +
        + + + +
          +
        • +

          swerveModules

          +
          private final SwerveModule[] swerveModules
          +
          Swerve modules.
          +
        • +
        + + + +
          +
        • +

          field

          +
          public edu.wpi.first.wpilibj.smartdashboard.Field2d field
          +
          Field object.
          +
        • +
        + + + +
          +
        • +

          swerveController

          +
          public SwerveController swerveController
          +
          Swerve controller for controlling heading of the robot.
          +
        • +
        + + + +
          +
        • +

          imu

          +
          private SwerveIMU imu
          +
          Swerve IMU device for sensing the heading of the robot.
          +
        • +
        + + + +
          +
        • +

          angle

          +
          private double angle
          +
          The current angle of the robot and last time odometry during simulations.
          +
        • +
        + + + +
          +
        • +

          lastTime

          +
          private double lastTime
          +
          The current angle of the robot and last time odometry during simulations.
          +
        • +
        + + + +
          +
        • +

          timer

          +
          private edu.wpi.first.wpilibj.Timer timer
          +
          Time during simulations.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveDrive

          +
          public SwerveDrive​(SwerveDriveConfiguration config,
          +                   SwerveControllerConfiguration controllerConfig)
          +
          Creates a new swerve drivebase subsystem. Robot is controlled via the drive() method, or via the setModuleStates() + method. The drive() method incorporates kinematics— it takes a translation and rotation, as well as parameters for + field-centric and closed-loop velocity control. setModuleStates() takes a list of SwerveModuleStates and directly + passes them to the modules. This subsystem also handles odometry.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          drive

          +
          public void drive​(edu.wpi.first.math.geometry.Translation2d translation,
          +                  double rotation,
          +                  boolean fieldRelative,
          +                  boolean isOpenLoop)
          +
          The primary method for controlling the drivebase. Takes a Translation2d and a rotation rate, and calculates and + commands module states accordingly. Can use either open-loop or closed-loop velocity control for the wheel + velocities. Also has field- and robot-relative modes, which affect how the translation vector is used.
          +
          +
          Parameters:
          +
          translation - Translation2d that is the commanded linear velocity of the robot, in meters per + second. In robot-relative mode, positive x is torwards the bow (front) and positive y is + torwards port (left). In field-relative mode, positive x is away from the alliance wall + (field North) and positive y is torwards the left wall when looking through the driver station + glass (field West).
          +
          rotation - Robot angular rate, in radians per second. CCW positive. Unaffected by field/robot + relativity.
          +
          fieldRelative - Drive mode. True for field-relative, false for robot-relative.
          +
          isOpenLoop - Whether to use closed-loop velocity control. Set to true to disable closed-loop.
          +
          +
        • +
        + + + +
          +
        • +

          setModuleStates

          +
          public void setModuleStates​(SwerveModuleState2[] desiredStates,
          +                            boolean isOpenLoop)
          +
          Set the module states (azimuth and velocity) directly. Used primarily for auto pathing.
          +
          +
          Parameters:
          +
          desiredStates - A list of SwerveModuleStates to send to the modules.
          +
          isOpenLoop - Whether to use closed-loop velocity control. Set to true to disable closed-loop.
          +
          +
        • +
        + + + +
          +
        • +

          setChassisSpeeds

          +
          public void setChassisSpeeds​(edu.wpi.first.math.kinematics.ChassisSpeeds chassisSpeeds)
          +
          Set field-relative chassis speeds with closed-loop velocity control.
          +
          +
          Parameters:
          +
          chassisSpeeds - Field-relative.
          +
          +
        • +
        + + + +
          +
        • +

          getPose

          +
          public edu.wpi.first.math.geometry.Pose2d getPose()
          +
          Gets the current pose (position and rotation) of the robot, as reported by odometry.
          +
          +
          Returns:
          +
          The robot's pose
          +
          +
        • +
        + + + +
          +
        • +

          getFieldVelocity

          +
          public edu.wpi.first.math.kinematics.ChassisSpeeds getFieldVelocity()
          +
          Gets the current field-relative velocity (x, y and omega) of the robot
          +
          +
          Returns:
          +
          A ChassisSpeeds object of the current field-relative velocity
          +
          +
        • +
        + + + +
          +
        • +

          getRobotVelocity

          +
          public edu.wpi.first.math.kinematics.ChassisSpeeds getRobotVelocity()
          +
          Gets the current robot-relative velocity (x, y and omega) of the robot
          +
          +
          Returns:
          +
          A ChassisSpeeds object of the current robot-relative velocity
          +
          +
        • +
        + + + +
          +
        • +

          resetOdometry

          +
          public void resetOdometry​(edu.wpi.first.math.geometry.Pose2d pose)
          +
          Resets odometry to the given pose. Gyro angle and module positions do not need to be reset when calling this + method. However, if either gyro angle or module position is reset, this must be called in order for odometry to + keep working.
          +
          +
          Parameters:
          +
          pose - The pose to set the odometry to
          +
          +
        • +
        + + + +
          +
        • +

          getStates

          +
          public SwerveModuleState2[] getStates()
          +
          Gets the current module states (azimuth and velocity)
          +
          +
          Returns:
          +
          A list of SwerveModuleStates containing the current module states
          +
          +
        • +
        + + + +
          +
        • +

          getModulePositions

          +
          public edu.wpi.first.math.kinematics.SwerveModulePosition[] getModulePositions()
          +
          Gets the current module positions (azimuth and wheel position (meters))
          +
          +
          Returns:
          +
          A list of SwerveModulePositions containg the current module positions
          +
          +
        • +
        + + + +
          +
        • +

          zeroGyro

          +
          public void zeroGyro()
          +
          Resets the gyro angle to zero and resets odometry to the same position, but facing toward 0.
          +
        • +
        + + + +
          +
        • +

          getYaw

          +
          public edu.wpi.first.math.geometry.Rotation2d getYaw()
          +
          Gets the current yaw angle of the robot, as reported by the imu. CCW positive, not wrapped.
          +
          +
          Returns:
          +
          The yaw as a Rotation2d angle
          +
          +
        • +
        + + + +
          +
        • +

          getPitch

          +
          public edu.wpi.first.math.geometry.Rotation2d getPitch()
          +
          Gets the current yaw angle of the robot, as reported by the imu. CCW positive, not wrapped.
          +
          +
          Returns:
          +
          The heading as a Rotation2d angle
          +
          +
        • +
        + + + +
          +
        • +

          setMotorBrake

          +
          public void setMotorBrake​(boolean brake)
          +
          Sets the drive motors to brake/coast mode.
          +
          +
          Parameters:
          +
          brake - True to set motors to brake mode, false for coast.
          +
          +
        • +
        + + + +
          +
        • +

          setDriveBrake

          +
          public void setDriveBrake()
          +
          Point all modules toward the robot center, thus making the robot very difficult to move.
          +
        • +
        + + + +
          +
        • +

          getSwerveModulePoses

          +
          public 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.
          +
          +
          Parameters:
          +
          robotPose - Robot pose.
          +
          Returns:
          +
          Swerve module poses.
          +
          +
        • +
        + + + +
          +
        • +

          replaceSwerveModuleFeedforward

          +
          public void replaceSwerveModuleFeedforward​(edu.wpi.first.math.controller.SimpleMotorFeedforward feedforward)
          +
          Setup the swerve module feedforward.
          +
          +
          Parameters:
          +
          feedforward - Feedforward for the drive motor on swerve modules.
          +
          +
        • +
        + + + +
          +
        • +

          updateOdometry

          +
          public void updateOdometry()
          +
          Update odometry should be run every loop.
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/SwerveModule.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/SwerveModule.html new file mode 100644 index 0000000..ad88f44 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/SwerveModule.html @@ -0,0 +1,745 @@ + + + + + +SwerveModule + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class SwerveModule

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.SwerveModule
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class SwerveModule
      +extends Object
      +
      The Swerve Module class which represents and controls Swerve Modules for the swerve drive.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + + + + + +
          +
        • +

          angleOffset

          +
          private final double angleOffset
          +
          Angle offset from the absolute encoder.
          +
        • +
        + + + +
          +
        • +

          angleMotor

          +
          private final SwerveMotor angleMotor
          +
          Swerve Motors.
          +
        • +
        + + + +
          +
        • +

          driveMotor

          +
          private final SwerveMotor driveMotor
          +
          Swerve Motors.
          +
        • +
        + + + +
          +
        • +

          absoluteEncoder

          +
          private final SwerveAbsoluteEncoder absoluteEncoder
          +
          Absolute encoder for swerve drive.
          +
        • +
        + + + +
          +
        • +

          moduleNumber

          +
          public int moduleNumber
          +
          Module number for kinematics, usually 0 to 3. front left -> front right -> back left -> back right.
          +
        • +
        + + + +
          +
        • +

          feedforward

          +
          public edu.wpi.first.math.controller.SimpleMotorFeedforward feedforward
          +
          Feedforward for drive motor during closed loop control.
          +
        • +
        + + + +
          +
        • +

          lastAngle

          +
          public double lastAngle
          +
          Last angle set for the swerve module.
          +
        • +
        + + + +
          +
        • +

          angle

          +
          public double angle
          +
          Current state.
          +
        • +
        + + + +
          +
        • +

          omega

          +
          public double omega
          +
          Current state.
          +
        • +
        + + + +
          +
        • +

          speed

          +
          public double speed
          +
          Current state.
          +
        • +
        + + + +
          +
        • +

          fakePos

          +
          public double fakePos
          +
          Current state.
          +
        • +
        + + + +
          +
        • +

          lastTime

          +
          public double lastTime
          +
          Current state.
          +
        • +
        + + + +
          +
        • +

          dt

          +
          public double dt
          +
          Current state.
          +
        • +
        + + + +
          +
        • +

          time

          +
          private edu.wpi.first.wpilibj.Timer time
          +
          Timer for simulation.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveModule

          +
          public SwerveModule​(int moduleNumber,
          +                    SwerveModuleConfiguration moduleConfiguration)
          +
          Construct the swerve module and initialize the swerve module motors and absolute encoder.
          +
          +
          Parameters:
          +
          moduleNumber - Module number for kinematics.
          +
          moduleConfiguration - Module constants containing CAN ID's and offsets.
          +
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          synchronizeEncoders

          +
          public void synchronizeEncoders()
          +
          Synchronize the integrated angle encoder with the absolute encoder.
          +
        • +
        + + + +
          +
        • +

          setDesiredState

          +
          public void setDesiredState​(SwerveModuleState2 desiredState,
          +                            boolean isOpenLoop)
          +
          Set the desired state of the swerve module.
          +
          +
          Parameters:
          +
          desiredState - Desired swerve module state.
          +
          isOpenLoop - Whether to use open loop (direct percent) or direct velocity control.
          +
          +
        • +
        + + + +
          +
        • +

          setAngle

          +
          public void setAngle​(double angle)
          +
          Set the angle for the module.
          +
          +
          Parameters:
          +
          angle - Angle in degrees.
          +
          +
        • +
        + + + +
          +
        • +

          getState

          +
          public SwerveModuleState2 getState()
          +
          Get the Swerve Module state.
          +
          +
          Returns:
          +
          Current SwerveModule state.
          +
          +
        • +
        + + + +
          +
        • +

          getPosition

          +
          public edu.wpi.first.math.kinematics.SwerveModulePosition getPosition()
          +
        • +
        + + + +
          +
        • +

          getCANCoder

          +
          public double getCANCoder()
          +
          Get the CANCoder absolute position.
          +
          +
          Returns:
          +
          Absolute encoder angle in degrees.
          +
          +
        • +
        + + + +
          +
        • +

          getRelativeEncoder

          +
          public double getRelativeEncoder()
          +
          Get the relative encoder angle in degrees.
          +
          +
          Returns:
          +
          Angle in degrees.
          +
          +
        • +
        + + + +
          +
        • +

          setMotorBrake

          +
          public void setMotorBrake​(boolean brake)
          +
          Set the brake mode.
          +
          +
          Parameters:
          +
          brake - Set the brake mode.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/CANCoderSwerve.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/CANCoderSwerve.html new file mode 100644 index 0000000..a4d537f --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/CANCoderSwerve.html @@ -0,0 +1,483 @@ + + + + + +CANCoderSwerve + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class CANCoderSwerve

    +
    +
    + +
    +
      +
    • +
      +
      public class CANCoderSwerve
      +extends SwerveAbsoluteEncoder
      +
      Swerve Absolute Encoder for CTRE CANCoders.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          encoder

          +
          public com.ctre.phoenix.sensors.WPI_CANCoder encoder
          +
          CANCoder with WPILib sendable and support.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          CANCoderSwerve

          +
          public CANCoderSwerve​(int id)
          +
          Initialize the CANCoder on the standard CANBus.
          +
          +
          Parameters:
          +
          id - CAN ID.
          +
          +
        • +
        + + + +
          +
        • +

          CANCoderSwerve

          +
          public CANCoderSwerve​(int id,
          +                      String canbus)
          +
          Initialize the CANCoder on the CANivore.
          +
          +
          Parameters:
          +
          id - CAN ID.
          +
          canbus - CAN bus to initialize it on.
          +
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + + + + + + + + + +
          +
        • +

          configure

          +
          public void configure​(boolean inverted)
          +
          Configure the absolute encoder to read from [0, 360) per second.
          +
          +
          Specified by:
          +
          configure in class SwerveAbsoluteEncoder
          +
          Parameters:
          +
          inverted - Whether the encoder is inverted.
          +
          +
        • +
        + + + +
          +
        • +

          getAbsolutePosition

          +
          public double getAbsolutePosition()
          +
          Get the absolute position of the encoder.
          +
          +
          Specified by:
          +
          getAbsolutePosition in class SwerveAbsoluteEncoder
          +
          Returns:
          +
          Absolute position in degrees from [0, 360).
          +
          +
        • +
        + + + + +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/SparkMaxEncoderSwerve.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/SparkMaxEncoderSwerve.html new file mode 100644 index 0000000..c3d6fd2 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/SparkMaxEncoderSwerve.html @@ -0,0 +1,460 @@ + + + + + +SparkMaxEncoderSwerve + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class SparkMaxEncoderSwerve

    +
    +
    + +
    +
      +
    • +
      +
      public class SparkMaxEncoderSwerve
      +extends SwerveAbsoluteEncoder
      +
      SparkMax absolute encoder, attached through the data port.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          encoder

          +
          public com.revrobotics.AbsoluteEncoder encoder
          +
          The AbsoluteEncoder representing the duty cycle encoder attached to the SparkMax.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SparkMaxEncoderSwerve

          +
          public SparkMaxEncoderSwerve​(SwerveMotor motor)
          +
          Create the AbsoluteEncoder object as a duty cycle. from the CANSparkMax motor.
          +
          +
          Parameters:
          +
          motor - Motor to create the encoder from.
          +
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + + + + + + + + + +
          +
        • +

          configure

          +
          public void configure​(boolean inverted)
          +
          Configure the absolute encoder to read from [0, 360) per second.
          +
          +
          Specified by:
          +
          configure in class SwerveAbsoluteEncoder
          +
          Parameters:
          +
          inverted - Whether the encoder is inverted.
          +
          +
        • +
        + + + +
          +
        • +

          getAbsolutePosition

          +
          public double getAbsolutePosition()
          +
          Get the absolute position of the encoder.
          +
          +
          Specified by:
          +
          getAbsolutePosition in class SwerveAbsoluteEncoder
          +
          Returns:
          +
          Absolute position in degrees from [0, 360).
          +
          +
        • +
        + + + + +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/SwerveAbsoluteEncoder.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/SwerveAbsoluteEncoder.html new file mode 100644 index 0000000..0cfb9a3 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/SwerveAbsoluteEncoder.html @@ -0,0 +1,393 @@ + + + + + +SwerveAbsoluteEncoder + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class SwerveAbsoluteEncoder

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.encoders.SwerveAbsoluteEncoder
      • +
      +
    • +
    +
    +
      +
    • +
      +
      Direct Known Subclasses:
      +
      CANCoderSwerve, SparkMaxEncoderSwerve
      +
      +
      +
      public abstract class SwerveAbsoluteEncoder
      +extends Object
      +
      Swerve abstraction class to define a standard interface with absolute encoders for swerve modules..
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveAbsoluteEncoder

          +
          public SwerveAbsoluteEncoder()
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          factoryDefault

          +
          public abstract void factoryDefault()
          +
          Reset the encoder to factory defaults.
          +
        • +
        + + + +
          +
        • +

          clearStickyFaults

          +
          public abstract void clearStickyFaults()
          +
          Clear sticky faults on the encoder.
          +
        • +
        + + + +
          +
        • +

          configure

          +
          public abstract void configure​(boolean inverted)
          +
          Configure the absolute encoder to read from [0, 360) per second.
          +
          +
          Parameters:
          +
          inverted - Whether the encoder is inverted.
          +
          +
        • +
        + + + +
          +
        • +

          getAbsolutePosition

          +
          public abstract double getAbsolutePosition()
          +
          Get the absolute position of the encoder.
          +
          +
          Returns:
          +
          Absolute position in degrees from [0, 360).
          +
          +
        • +
        + + + +
          +
        • +

          getAbsoluteEncoder

          +
          public abstract Object getAbsoluteEncoder()
          +
          Get the instantiated absolute encoder Object.
          +
          +
          Returns:
          +
          Absolute encoder object.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/package-summary.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/package-summary.html new file mode 100644 index 0000000..21dd146 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/package-summary.html @@ -0,0 +1,179 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.encoders + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Package frc.robot.subsystems.swervedrive2.swervelib.encoders

    +
    +
    +
      +
    • + + + + + + + + + + + + + + + + + + + + +
      Class Summary 
      ClassDescription
      CANCoderSwerve +
      Swerve Absolute Encoder for CTRE CANCoders.
      +
      SparkMaxEncoderSwerve +
      SparkMax absolute encoder, attached through the data port.
      +
      SwerveAbsoluteEncoder +
      Swerve abstraction class to define a standard interface with absolute encoders for swerve modules..
      +
      +
    • +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/package-tree.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/package-tree.html new file mode 100644 index 0000000..d29d469 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/encoders/package-tree.html @@ -0,0 +1,167 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.encoders Class Hierarchy + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Hierarchy For Package frc.robot.subsystems.swervedrive2.swervelib.encoders

    +Package Hierarchies: + +
    +
    +
    +

    Class Hierarchy

    + +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/NavXSwerve.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/NavXSwerve.html new file mode 100644 index 0000000..e649dcf --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/NavXSwerve.html @@ -0,0 +1,473 @@ + + + + + +NavXSwerve + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    +
      +
    • +
      +
      public class NavXSwerve
      +extends SwerveIMU
      +
      Communicates with the NavX as the IMU.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          gyro

          +
          private com.kauailabs.navx.frc.AHRS gyro
          +
          NavX IMU.
          +
        • +
        + + + +
          +
        • +

          yawOffset

          +
          private double yawOffset
          +
          Offset for the NavX yaw reading.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          NavXSwerve

          +
          public NavXSwerve()
          +
          Constructor for the NavX swerve.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          factoryDefault

          +
          public void factoryDefault()
          +
          Reset IMU to factory default.
          +
          +
          Specified by:
          +
          factoryDefault in class SwerveIMU
          +
          +
        • +
        + + + +
          +
        • +

          clearStickyFaults

          +
          public void clearStickyFaults()
          +
          Clear sticky faults on IMU.
          +
          +
          Specified by:
          +
          clearStickyFaults in class SwerveIMU
          +
          +
        • +
        + + + +
          +
        • +

          setYaw

          +
          public void setYaw​(double yaw)
          +
          Set the yaw in degrees.
          +
          +
          Specified by:
          +
          setYaw in class SwerveIMU
          +
          Parameters:
          +
          yaw - Yaw angle in degrees.
          +
          +
        • +
        + + + +
          +
        • +

          getYawPitchRoll

          +
          public void getYawPitchRoll​(double[] yprArray)
          +
          Fetch the yaw/pitch/roll from the IMU.
          +
          +
          Specified by:
          +
          getYawPitchRoll in class SwerveIMU
          +
          Parameters:
          +
          yprArray - Array which will be filled with {yaw, pitch, roll} in degrees.
          +
          +
        • +
        + + + +
          +
        • +

          getIMU

          +
          public Object getIMU()
          +
          Get the instantiated IMU object.
          +
          +
          Specified by:
          +
          getIMU in class SwerveIMU
          +
          Returns:
          +
          IMU object.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/Pigeon2Swerve.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/Pigeon2Swerve.html new file mode 100644 index 0000000..1ea559a --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/Pigeon2Swerve.html @@ -0,0 +1,483 @@ + + + + + +Pigeon2Swerve + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class Pigeon2Swerve

    +
    +
    + +
    +
      +
    • +
      +
      public class Pigeon2Swerve
      +extends SwerveIMU
      +
      SwerveIMU interface for the Pigeon2
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          imu

          +
          com.ctre.phoenix.sensors.WPI_Pigeon2 imu
          +
          Pigeon2 IMU device.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          Pigeon2Swerve

          +
          public Pigeon2Swerve​(int canid,
          +                     String canbus)
          +
          Generate the SwerveIMU for pigeon.
          +
          +
          Parameters:
          +
          canid - CAN ID for the pigeon
          +
          canbus - CAN Bus name the pigeon resides on.
          +
          +
        • +
        + + + +
          +
        • +

          Pigeon2Swerve

          +
          public Pigeon2Swerve​(int canid)
          +
          Generate the SwerveIMU for pigeon.
          +
          +
          Parameters:
          +
          canid - CAN ID for the pigeon
          +
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          factoryDefault

          +
          public void factoryDefault()
          +
          Reset IMU to factory default.
          +
          +
          Specified by:
          +
          factoryDefault in class SwerveIMU
          +
          +
        • +
        + + + +
          +
        • +

          clearStickyFaults

          +
          public void clearStickyFaults()
          +
          Clear sticky faults on IMU.
          +
          +
          Specified by:
          +
          clearStickyFaults in class SwerveIMU
          +
          +
        • +
        + + + +
          +
        • +

          setYaw

          +
          public void setYaw​(double yaw)
          +
          Set the yaw in degrees.
          +
          +
          Specified by:
          +
          setYaw in class SwerveIMU
          +
          Parameters:
          +
          yaw - Angle in degrees.
          +
          +
        • +
        + + + +
          +
        • +

          getYawPitchRoll

          +
          public void getYawPitchRoll​(double[] yprArray)
          +
          Fetch the yaw/pitch/roll from the IMU, inverts them all if SwerveIMU is inverted.
          +
          +
          Specified by:
          +
          getYawPitchRoll in class SwerveIMU
          +
          Parameters:
          +
          yprArray - Array which will be filled with {yaw, pitch, roll} in degrees.
          +
          +
        • +
        + + + +
          +
        • +

          getIMU

          +
          public Object getIMU()
          +
          Get the instantiated IMU object.
          +
          +
          Specified by:
          +
          getIMU in class SwerveIMU
          +
          Returns:
          +
          IMU object.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/PigeonSwerve.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/PigeonSwerve.html new file mode 100644 index 0000000..d67eaaa --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/PigeonSwerve.html @@ -0,0 +1,457 @@ + + + + + +PigeonSwerve + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class PigeonSwerve

    +
    +
    + +
    +
      +
    • +
      +
      public class PigeonSwerve
      +extends SwerveIMU
      +
      SwerveIMU interface for the Pigeon.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          imu

          +
          com.ctre.phoenix.sensors.WPI_PigeonIMU imu
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          PigeonSwerve

          +
          public PigeonSwerve​(int canid)
          +
          Generate the SwerveIMU for pigeon.
          +
          +
          Parameters:
          +
          canid - CAN ID for the pigeon, does not support CANBus.
          +
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          factoryDefault

          +
          public void factoryDefault()
          +
          Reset IMU to factory default.
          +
          +
          Specified by:
          +
          factoryDefault in class SwerveIMU
          +
          +
        • +
        + + + +
          +
        • +

          clearStickyFaults

          +
          public void clearStickyFaults()
          +
          Clear sticky faults on IMU.
          +
          +
          Specified by:
          +
          clearStickyFaults in class SwerveIMU
          +
          +
        • +
        + + + +
          +
        • +

          setYaw

          +
          public void setYaw​(double yaw)
          +
          Set the yaw in degrees.
          +
          +
          Specified by:
          +
          setYaw in class SwerveIMU
          +
          Parameters:
          +
          yaw - Angle in degrees.
          +
          +
        • +
        + + + +
          +
        • +

          getYawPitchRoll

          +
          public void getYawPitchRoll​(double[] yprArray)
          +
          Fetch the yaw/pitch/roll from the IMU, inverts them all if SwerveIMU is inverted.
          +
          +
          Specified by:
          +
          getYawPitchRoll in class SwerveIMU
          +
          Parameters:
          +
          yprArray - Array which will be filled with {yaw, pitch, roll} in degrees.
          +
          +
        • +
        + + + +
          +
        • +

          getIMU

          +
          public Object getIMU()
          +
          Get the instantiated IMU object.
          +
          +
          Specified by:
          +
          getIMU in class SwerveIMU
          +
          Returns:
          +
          IMU object.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/SwerveIMU.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/SwerveIMU.html new file mode 100644 index 0000000..c434b03 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/SwerveIMU.html @@ -0,0 +1,393 @@ + + + + + +SwerveIMU + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.imu.SwerveIMU
      • +
      +
    • +
    +
    + +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveIMU

          +
          public SwerveIMU()
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          factoryDefault

          +
          public abstract void factoryDefault()
          +
          Reset IMU to factory default.
          +
        • +
        + + + +
          +
        • +

          clearStickyFaults

          +
          public abstract void clearStickyFaults()
          +
          Clear sticky faults on IMU.
          +
        • +
        + + + +
          +
        • +

          setYaw

          +
          public abstract void setYaw​(double yaw)
          +
          Set the yaw in degrees.
          +
          +
          Parameters:
          +
          yaw - Yaw angle in degrees.
          +
          +
        • +
        + + + +
          +
        • +

          getYawPitchRoll

          +
          public abstract void getYawPitchRoll​(double[] yprArray)
          +
          Fetch the yaw/pitch/roll from the IMU.
          +
          +
          Parameters:
          +
          yprArray - Array which will be filled with {yaw, pitch, roll} in degrees.
          +
          +
        • +
        + + + +
          +
        • +

          getIMU

          +
          public abstract Object getIMU()
          +
          Get the instantiated IMU object.
          +
          +
          Returns:
          +
          IMU object.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/package-summary.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/package-summary.html new file mode 100644 index 0000000..18ae1d4 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/package-summary.html @@ -0,0 +1,185 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.imu + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Package frc.robot.subsystems.swervedrive2.swervelib.imu

    +
    +
    +
      +
    • + + + + + + + + + + + + + + + + + + + + + + + + +
      Class Summary 
      ClassDescription
      NavXSwerve +
      Communicates with the NavX as the IMU.
      +
      Pigeon2Swerve +
      SwerveIMU interface for the Pigeon2
      +
      PigeonSwerve +
      SwerveIMU interface for the Pigeon.
      +
      SwerveIMU +
      Swerve IMU abstraction to define a standard interface with a swerve drive.
      +
      +
    • +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/package-tree.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/package-tree.html new file mode 100644 index 0000000..d9105a3 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/imu/package-tree.html @@ -0,0 +1,168 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.imu Class Hierarchy + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Hierarchy For Package frc.robot.subsystems.swervedrive2.swervelib.imu

    +Package Hierarchies: + +
    +
    +
    +

    Class Hierarchy

    +
      +
    • java.lang.Object +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.imu.SwerveIMU +
          +
        • frc.robot.subsystems.swervedrive2.swervelib.imu.NavXSwerve
        • +
        • frc.robot.subsystems.swervedrive2.swervelib.imu.Pigeon2Swerve
        • +
        • frc.robot.subsystems.swervedrive2.swervelib.imu.PigeonSwerve
        • +
        +
      • +
      +
    • +
    +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/math/SwerveKinematics2.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/math/SwerveKinematics2.html new file mode 100644 index 0000000..2c7db56 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/math/SwerveKinematics2.html @@ -0,0 +1,639 @@ + + + + + +SwerveKinematics2 + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class SwerveKinematics2

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • edu.wpi.first.math.kinematics.SwerveDriveKinematics
      • +
      • +
          +
        • frc.robot.subsystems.swervedrive2.swervelib.math.SwerveKinematics2
        • +
        +
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class SwerveKinematics2
      +extends edu.wpi.first.math.kinematics.SwerveDriveKinematics
      +
      Clone of WPI SwerveKinematics, which implements second order kinematics when calculating modules states from chassis + speed. +

      +

      + Makes use of SwerveModuleState2 to add the angular velocity that is required of the module as an output.

      +
    • +
    +
    +
    +
      +
    • + +
      + +
      + +
      +
        +
      • + + +

        Constructor Summary

        + + + + + + + + + + +
        Constructors 
        ConstructorDescription
        SwerveKinematics2​(edu.wpi.first.math.geometry.Translation2d... wheelsMeters) +
        Constructs a swerve drive kinematics object.
        +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Summary

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        All Methods Static Methods Instance Methods Concrete Methods 
        Modifier and TypeMethodDescription
        static voiddesaturateWheelSpeeds​(SwerveModuleState2[] moduleStates, + double attainableMaxSpeedMetersPerSecond) +
        Renormalizes the wheel speeds if any individual speed is above the specified maximum.
        +
        static voiddesaturateWheelSpeeds​(SwerveModuleState2[] moduleStates, + edu.wpi.first.math.kinematics.ChassisSpeeds currentChassisSpeed, + double attainableMaxModuleSpeedMetersPerSecond, + double attainableMaxTranslationalSpeedMetersPerSecond, + double attainableMaxRotationalVelocityRadiansPerSecond) +
        Renormalizes the wheel speeds if any individual speed is above the specified maximum, as well as getting rid of + joystick saturation at edges of joystick.
        +
        edu.wpi.first.math.kinematics.ChassisSpeedstoChassisSpeeds​(SwerveModuleState2... wheelStates) +
        Performs forward kinematics to return the resulting chassis state from the given module states.
        +
        SwerveModuleState2[]toSwerveModuleStates​(edu.wpi.first.math.kinematics.ChassisSpeeds chassisSpeeds) +
        Performs inverse kinematics.
        +
        SwerveModuleState2[]toSwerveModuleStates​(edu.wpi.first.math.kinematics.ChassisSpeeds chassisSpeeds, + edu.wpi.first.math.geometry.Translation2d centerOfRotationMeters) +
        Performs inverse kinematics to return the module states from a desired chassis velocity.
        +
        edu.wpi.first.math.geometry.Twist2dtoTwist2d​(edu.wpi.first.math.kinematics.SwerveModulePosition... wheelDeltas) +
        Performs forward kinematics to return the resulting chassis state from the given module states.
        +
        +
          +
        • + + +

          Methods inherited from class edu.wpi.first.math.kinematics.SwerveDriveKinematics

          +desaturateWheelSpeeds, desaturateWheelSpeeds, toChassisSpeeds
        • +
        + +
      • +
      +
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          m_inverseKinematics

          +
          private final org.ejml.simple.SimpleMatrix m_inverseKinematics
          +
        • +
        + + + +
          +
        • +

          m_forwardKinematics

          +
          private final org.ejml.simple.SimpleMatrix m_forwardKinematics
          +
        • +
        + + + +
          +
        • +

          bigInverseKinematics

          +
          private final org.ejml.simple.SimpleMatrix bigInverseKinematics
          +
        • +
        + + + +
          +
        • +

          m_numModules

          +
          private final int m_numModules
          +
        • +
        + + + +
          +
        • +

          m_modules

          +
          private final edu.wpi.first.math.geometry.Translation2d[] m_modules
          +
        • +
        + + + + + + + +
          +
        • +

          m_prevCoR

          +
          private edu.wpi.first.math.geometry.Translation2d m_prevCoR
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveKinematics2

          +
          public SwerveKinematics2​(edu.wpi.first.math.geometry.Translation2d... wheelsMeters)
          +
          Constructs a swerve drive kinematics object. This takes in a variable number of wheel locations as Translation2ds. + The order in which you pass in the wheel locations is the same order that you will receive the module states when + performing inverse kinematics. It is also expected that you pass in the module states in the same order when + calling the forward kinematics methods.
          +
          +
          Parameters:
          +
          wheelsMeters - The locations of the wheels relative to the physical center of the robot.
          +
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          desaturateWheelSpeeds

          +
          public static void desaturateWheelSpeeds​(SwerveModuleState2[] moduleStates,
          +                                         double attainableMaxSpeedMetersPerSecond)
          +
          Renormalizes the wheel speeds if any individual speed is above the specified maximum. + +

          Sometimes, after inverse kinematics, the requested speed from one or more modules may be + above the max attainable speed for the driving motor on that module. To fix this issue, one can reduce all the + wheel speeds to make sure that all requested module speeds are at-or-below the absolute threshold, while + maintaining the ratio of speeds between modules.

          +
          +
          Parameters:
          +
          moduleStates - Reference to array of module states. The array will be mutated with the + normalized speeds!
          +
          attainableMaxSpeedMetersPerSecond - The absolute max speed that a module can reach.
          +
          +
        • +
        + + + +
          +
        • +

          desaturateWheelSpeeds

          +
          public static void desaturateWheelSpeeds​(SwerveModuleState2[] moduleStates,
          +                                         edu.wpi.first.math.kinematics.ChassisSpeeds currentChassisSpeed,
          +                                         double attainableMaxModuleSpeedMetersPerSecond,
          +                                         double attainableMaxTranslationalSpeedMetersPerSecond,
          +                                         double attainableMaxRotationalVelocityRadiansPerSecond)
          +
          Renormalizes the wheel speeds if any individual speed is above the specified maximum, as well as getting rid of + joystick saturation at edges of joystick. + +

          Sometimes, after inverse kinematics, the requested speed from one or more modules may be + above the max attainable speed for the driving motor on that module. To fix this issue, one can reduce all the + wheel speeds to make sure that all requested module speeds are at-or-below the absolute threshold, while + maintaining the ratio of speeds between modules.

          +
          +
          Parameters:
          +
          moduleStates - Reference to array of module states. The array will be + mutated with the normalized speeds!
          +
          currentChassisSpeed - The current speed of the robot
          +
          attainableMaxModuleSpeedMetersPerSecond - The absolute max speed that a module can reach
          +
          attainableMaxTranslationalSpeedMetersPerSecond - The absolute max speed that your robot can reach while + translating
          +
          attainableMaxRotationalVelocityRadiansPerSecond - The absolute max speed the robot can reach while rotating
          +
          +
        • +
        + + + +
          +
        • +

          toSwerveModuleStates

          +
          public SwerveModuleState2[] toSwerveModuleStates​(edu.wpi.first.math.kinematics.ChassisSpeeds chassisSpeeds,
          +                                                 edu.wpi.first.math.geometry.Translation2d centerOfRotationMeters)
          +
          Performs inverse kinematics to return the module states from a desired chassis velocity. This method is often used + to convert joystick values into module speeds and angles. + +

          This function also supports variable centers of rotation. During normal operations, the + center of rotation is usually the same as the physical center of the robot; therefore, the argument is defaulted to + that use case. However, if you wish to change the center of rotation for evasive maneuvers, vision alignment, or + for any other use case, you can do so. + +

          In the case that the desired chassis speeds are zero (i.e. the robot will be stationary), + the previously calculated module angle will be maintained.

          +
          +
          Overrides:
          +
          toSwerveModuleStates in class edu.wpi.first.math.kinematics.SwerveDriveKinematics
          +
          Parameters:
          +
          chassisSpeeds - The desired chassis speed.
          +
          centerOfRotationMeters - The center of rotation. For example, if you set the center of rotation at one corner + of the robot and provide a chassis speed that only has a dtheta component, the robot + will rotate around that corner.
          +
          Returns:
          +
          An array containing the module states. Use caution because these module states are not normalized. + Sometimes, a user input may cause one of the module speeds to go above the attainable max velocity. Use the + DesaturateWheelSpeeds function to rectify this issue.
          +
          +
        • +
        + + + +
          +
        • +

          toSwerveModuleStates

          +
          public SwerveModuleState2[] toSwerveModuleStates​(edu.wpi.first.math.kinematics.ChassisSpeeds chassisSpeeds)
          +
          Performs inverse kinematics. See toSwerveModuleStates(ChassisSpeeds, Translation2d) toSwerveModuleStates + for more information.
          +
          +
          Overrides:
          +
          toSwerveModuleStates in class edu.wpi.first.math.kinematics.SwerveDriveKinematics
          +
          Parameters:
          +
          chassisSpeeds - The desired chassis speed.
          +
          Returns:
          +
          An array containing the module states.
          +
          +
        • +
        + + + +
          +
        • +

          toChassisSpeeds

          +
          public edu.wpi.first.math.kinematics.ChassisSpeeds toChassisSpeeds​(SwerveModuleState2... wheelStates)
          +
          Performs forward kinematics to return the resulting chassis state from the given module states. This method is + often used for odometry -- determining the robot's position on the field using data from the real-world speed and + angle of each module on the robot.
          +
          +
          Parameters:
          +
          wheelStates - The state of the modules (as a SwerveModuleState type) as measured from respective encoders and + gyros. The order of the swerve module states should be same as passed into the constructor of + this class.
          +
          Returns:
          +
          The resulting chassis speed.
          +
          +
        • +
        + + + +
          +
        • +

          toTwist2d

          +
          public edu.wpi.first.math.geometry.Twist2d toTwist2d​(edu.wpi.first.math.kinematics.SwerveModulePosition... wheelDeltas)
          +
          Performs forward kinematics to return the resulting chassis state from the given module states. This method is + often used for odometry -- determining the robot's position on the field using data from the real-world speed and + angle of each module on the robot.
          +
          +
          Overrides:
          +
          toTwist2d in class edu.wpi.first.math.kinematics.SwerveDriveKinematics
          +
          Parameters:
          +
          wheelDeltas - The latest change in position of the modules (as a SwerveModulePosition type) as measured from + respective encoders and gyros. The order of the swerve module states should be same as passed + into the constructor of this class.
          +
          Returns:
          +
          The resulting Twist2d.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/math/SwerveMath.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/math/SwerveMath.html new file mode 100644 index 0000000..44136b2 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/math/SwerveMath.html @@ -0,0 +1,581 @@ + + + + + +SwerveMath + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.math.SwerveMath
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class SwerveMath
      +extends Object
      +
      Mathematical functions which pertain to swerve drive.
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Constructor Summary

        + + + + + + + + + + +
        Constructors 
        ConstructorDescription
        SwerveMath() 
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Summary

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        All Methods Static Methods Concrete Methods 
        Modifier and TypeMethodDescription
        static doubleapplyDeadband​(double value, + boolean scaled, + double deadband) +
        Algebraically apply a deadband using a piece wise function.
        +
        private static doublecalcMaxAccel​(edu.wpi.first.math.geometry.Rotation2d angle, + double chassisMass, + double robotMass, + edu.wpi.first.math.geometry.Translation3d chassisCenterOfGravity, + SwerveDriveConfiguration config) +
        Calculates the maximum acceleration allowed in a direction without tipping the robot.
        +
        static doublecalculateAngleKV​(double optimalVoltage, + double motorFreeSpeedRPM, + double angleGearRatio) +
        Calculate the angle kV which will be multiplied by the radians per second for the feedforward.
        +
        static doublecalculateDegreesPerSteeringRotation​(double angleGearRatio, + double pulsePerRotation) +
        Calculate the degrees per steering rotation for the integrated encoder.
        +
        static doublecalculateMaxAcceleration​(double cof) +
        Calculate the practical maximum acceleration of the robot using the wheel coefficient of friction.
        +
        static doublecalculateMaxAcceleration​(double stallTorqueNm, + double gearRatio, + double moduleCount, + double wheelDiameter, + double robotMass) +
        Calculate the maximum theoretical acceleration without friction.
        +
        static doublecalculateMaxAngularVelocity​(double maxSpeed, + double furthestModuleX, + double furthestModuleY) +
        Calculate the maximum angular velocity.
        +
        static doublecalculateMetersPerRotation​(double wheelDiameter, + double driveGearRatio, + double pulsePerRotation) +
        Calculate the meters per rotation for the integrated encoder.
        +
        static edu.wpi.first.math.geometry.Translation2dlimitVelocity​(edu.wpi.first.math.geometry.Translation2d commandedVelocity, + edu.wpi.first.math.kinematics.ChassisSpeeds fieldVelocity, + edu.wpi.first.math.geometry.Pose2d robotPose, + double loopTime, + double chassisMass, + double robotMass, + edu.wpi.first.math.geometry.Translation3d chassisCenterOfGravity, + SwerveDriveConfiguration config) +
        Limits a commanded velocity to prevent exceeding the maximum acceleration given by + calcMaxAccel(Rotation2d, double, double, Translation3d, SwerveDriveConfiguration).
        +
        + +
      • +
      +
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveMath

          +
          public SwerveMath()
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          calculateAngleKV

          +
          public static double calculateAngleKV​(double optimalVoltage,
          +                                      double motorFreeSpeedRPM,
          +                                      double angleGearRatio)
          +
          Calculate the angle kV which will be multiplied by the radians per second for the feedforward. Volt * seconds / + degree <=> (maxVolts) / (maxSpeed)
          +
          +
          Parameters:
          +
          optimalVoltage - Optimal voltage to use when calculating the angle kV.
          +
          motorFreeSpeedRPM - Motor free speed in Rotations per Minute.
          +
          angleGearRatio - Angle gear ratio, the amount of times the motor as to turn for the wheel rotation.
          +
          Returns:
          +
          angle kV for feedforward.
          +
          +
        • +
        + + + +
          +
        • +

          calculateMetersPerRotation

          +
          public static double calculateMetersPerRotation​(double wheelDiameter,
          +                                                double driveGearRatio,
          +                                                double pulsePerRotation)
          +
          Calculate the meters per rotation for the integrated encoder. Calculation: 4in diameter wheels * pi [circumfrence] + / gear ratio.
          +
          +
          Parameters:
          +
          wheelDiameter - Wheel diameter in meters.
          +
          driveGearRatio - The gear ratio of the drive motor.
          +
          pulsePerRotation - The number of encoder pulses per rotation. 1 if using an integrated encoder.
          +
          Returns:
          +
          Meters per rotation for the drive motor.
          +
          +
        • +
        + + + +
          +
        • +

          applyDeadband

          +
          public static double applyDeadband​(double value,
          +                                   boolean scaled,
          +                                   double deadband)
          +
          Algebraically apply a deadband using a piece wise function.
          +
          +
          Parameters:
          +
          value - value to apply deadband to.
          +
          scaled - Use algebra to determine deadband by starting the value at 0 past deadband.
          +
          deadband - The deadbnad to apply.
          +
          Returns:
          +
          Value with deadband applied.
          +
          +
        • +
        + + + +
          +
        • +

          calculateDegreesPerSteeringRotation

          +
          public static double calculateDegreesPerSteeringRotation​(double angleGearRatio,
          +                                                         double pulsePerRotation)
          +
          Calculate the degrees per steering rotation for the integrated encoder. Encoder conversion values. Drive converts + motor rotations to linear wheel distance and steering converts motor rotations to module azimuth.
          +
          +
          Parameters:
          +
          angleGearRatio - The gear ratio of the steering motor.
          +
          pulsePerRotation - The number of pulses in a complete rotation for the encoder, 1 if integrated.
          +
          Returns:
          +
          Degrees per steering rotation for the angle motor.
          +
          +
        • +
        + + + +
          +
        • +

          calculateMaxAngularVelocity

          +
          public static double calculateMaxAngularVelocity​(double maxSpeed,
          +                                                 double furthestModuleX,
          +                                                 double furthestModuleY)
          +
          Calculate the maximum angular velocity.
          +
          +
          Parameters:
          +
          maxSpeed - Max speed of the robot in meters per second.
          +
          furthestModuleX - X of the furthest module in meters.
          +
          furthestModuleY - Y of the furthest module in meters.
          +
          Returns:
          +
          Maximum angular velocity in rad/s.
          +
          +
        • +
        + + + +
          +
        • +

          calculateMaxAcceleration

          +
          public static double calculateMaxAcceleration​(double cof)
          +
          Calculate the practical maximum acceleration of the robot using the wheel coefficient of friction.
          +
          +
          Parameters:
          +
          cof - Coefficient of Friction of the wheel grip tape.
          +
          Returns:
          +
          Practical maximum acceleration in m/s/s.
          +
          +
        • +
        + + + +
          +
        • +

          calculateMaxAcceleration

          +
          public static double calculateMaxAcceleration​(double stallTorqueNm,
          +                                              double gearRatio,
          +                                              double moduleCount,
          +                                              double wheelDiameter,
          +                                              double robotMass)
          +
          Calculate the maximum theoretical acceleration without friction.
          +
          +
          Parameters:
          +
          stallTorqueNm - Stall torque of driving motor in nM.
          +
          gearRatio - Gear ratio for driving motor number of motor rotations until one wheel rotation.
          +
          moduleCount - Number of swerve modules.
          +
          wheelDiameter - Wheel diameter in meters.
          +
          robotMass - Mass of the robot in kg.
          +
          Returns:
          +
          Theoretical maximum acceleration in m/s/s.
          +
          +
        • +
        + + + +
          +
        • +

          calcMaxAccel

          +
          private static double calcMaxAccel​(edu.wpi.first.math.geometry.Rotation2d angle,
          +                                   double chassisMass,
          +                                   double robotMass,
          +                                   edu.wpi.first.math.geometry.Translation3d chassisCenterOfGravity,
          +                                   SwerveDriveConfiguration config)
          +
          Calculates the maximum acceleration allowed in a direction without tipping the robot. Reads arm position from + NetworkTables and is passed the direction in question.
          +
          +
          Parameters:
          +
          angle - The direction in which to calculate max acceleration, as a Rotation2d. Note that this + is robot-relative.
          +
          chassisMass - Chassis mass in kg. (The weight of just the chassis not anything else)
          +
          robotMass - The weight of the robot in kg. (Including manipulators, etc).
          +
          chassisCenterOfGravity - Chassis center of gravity.
          +
          config - The swerve drive configuration.
          +
          Returns:
          +
          Maximum acceleration allowed in the robot direction.
          +
          +
        • +
        + + + +
          +
        • +

          limitVelocity

          +
          public static edu.wpi.first.math.geometry.Translation2d limitVelocity​(edu.wpi.first.math.geometry.Translation2d commandedVelocity,
          +                                                                      edu.wpi.first.math.kinematics.ChassisSpeeds fieldVelocity,
          +                                                                      edu.wpi.first.math.geometry.Pose2d robotPose,
          +                                                                      double loopTime,
          +                                                                      double chassisMass,
          +                                                                      double robotMass,
          +                                                                      edu.wpi.first.math.geometry.Translation3d chassisCenterOfGravity,
          +                                                                      SwerveDriveConfiguration config)
          +
          Limits a commanded velocity to prevent exceeding the maximum acceleration given by + calcMaxAccel(Rotation2d, double, double, Translation3d, SwerveDriveConfiguration). Note that + this takes and returns field-relative velocities.
          +
          +
          Parameters:
          +
          commandedVelocity - The desired velocity
          +
          fieldVelocity - The velocity of the robot within a field relative state.
          +
          robotPose - The current pose of the robot.
          +
          loopTime - The time it takes to update the velocity in seconds. Note: this should include the + 100ms that it takes for a SparkMax velocity to update.
          +
          chassisMass - Chassis mass in kg. (The weight of just the chassis not anything else)
          +
          robotMass - The weight of the robot in kg. (Including manipulators, etc).
          +
          chassisCenterOfGravity - Chassis center of gravity.
          +
          config - The swerve drive configuration.
          +
          Returns:
          +
          The limited velocity. This is either the commanded velocity, if attainable, or the closest attainable + velocity.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/math/SwerveModuleState2.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/math/SwerveModuleState2.html new file mode 100644 index 0000000..cf45c1d --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/math/SwerveModuleState2.html @@ -0,0 +1,386 @@ + + + + + +SwerveModuleState2 + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class SwerveModuleState2

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • edu.wpi.first.math.kinematics.SwerveModuleState
      • +
      • +
          +
        • frc.robot.subsystems.swervedrive2.swervelib.math.SwerveModuleState2
        • +
        +
      • +
      +
    • +
    +
    +
      +
    • +
      +
      All Implemented Interfaces:
      +
      Comparable<edu.wpi.first.math.kinematics.SwerveModuleState>
      +
      +
      +
      public class SwerveModuleState2
      +extends edu.wpi.first.math.kinematics.SwerveModuleState
      +
      Second order kinematics swerve module state.
      +
    • +
    +
    +
    +
      +
    • + +
      + +
      + +
      +
        +
      • + + +

        Constructor Summary

        + + + + + + + + + + + + + + +
        Constructors 
        ConstructorDescription
        SwerveModuleState2() +
        Constructs a SwerveModuleState with zeros for speed and angle.
        +
        SwerveModuleState2​(double speedMetersPerSecond, + edu.wpi.first.math.geometry.Rotation2d angle, + double omegaRadPerSecond) +
        Constructs a SwerveModuleState.
        +
        +
      • +
      +
      + +
      + +
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          speedMetersPerSecond

          +
          public double speedMetersPerSecond
          +
        • +
        + + + +
          +
        • +

          omegaRadPerSecond

          +
          public double omegaRadPerSecond
          +
          Rad per sec
          +
        • +
        + + + +
          +
        • +

          angle

          +
          public edu.wpi.first.math.geometry.Rotation2d angle
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveModuleState2

          +
          public SwerveModuleState2()
          +
          Constructs a SwerveModuleState with zeros for speed and angle.
          +
        • +
        + + + +
          +
        • +

          SwerveModuleState2

          +
          public SwerveModuleState2​(double speedMetersPerSecond,
          +                          edu.wpi.first.math.geometry.Rotation2d angle,
          +                          double omegaRadPerSecond)
          +
          Constructs a SwerveModuleState.
          +
          +
          Parameters:
          +
          speedMetersPerSecond - The speed of the wheel of the module.
          +
          angle - The angle of the module.
          +
          omegaRadPerSecond - The angular velocity of the module.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/math/package-summary.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/math/package-summary.html new file mode 100644 index 0000000..7bbeac4 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/math/package-summary.html @@ -0,0 +1,180 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.math + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Package frc.robot.subsystems.swervedrive2.swervelib.math

    +
    +
    +
      +
    • + + + + + + + + + + + + + + + + + + + + +
      Class Summary 
      ClassDescription
      SwerveKinematics2 +
      Clone of WPI SwerveKinematics, which implements second order kinematics when calculating modules states from chassis + speed.
      +
      SwerveMath +
      Mathematical functions which pertain to swerve drive.
      +
      SwerveModuleState2 +
      Second order kinematics swerve module state.
      +
      +
    • +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/math/package-tree.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/math/package-tree.html new file mode 100644 index 0000000..16b28a2 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/math/package-tree.html @@ -0,0 +1,172 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.math Class Hierarchy + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Hierarchy For Package frc.robot.subsystems.swervedrive2.swervelib.math

    +Package Hierarchies: + +
    +
    +
    +

    Class Hierarchy

    +
      +
    • java.lang.Object +
        +
      • edu.wpi.first.math.kinematics.SwerveDriveKinematics + +
      • +
      • frc.robot.subsystems.swervedrive2.swervelib.math.SwerveMath
      • +
      • edu.wpi.first.math.kinematics.SwerveModuleState (implements java.lang.Comparable<T>) + +
      • +
      +
    • +
    +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/SparkMaxSwerve.SparkMAX_slotIdx.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/SparkMaxSwerve.SparkMAX_slotIdx.html new file mode 100644 index 0000000..aa6116c --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/SparkMaxSwerve.SparkMAX_slotIdx.html @@ -0,0 +1,437 @@ + + + + + +SparkMaxSwerve.SparkMAX_slotIdx + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Enum SparkMaxSwerve.SparkMAX_slotIdx

    +
    +
    + +
    + +
    +
    + +
    +
    +
      +
    • + +
      + +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SparkMAX_slotIdx

          +
          private SparkMAX_slotIdx()
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          values

          +
          public static SparkMaxSwerve.SparkMAX_slotIdx[] values()
          +
          Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
          +for (SparkMaxSwerve.SparkMAX_slotIdx c : SparkMaxSwerve.SparkMAX_slotIdx.values())
          +    System.out.println(c);
          +
          +
          +
          Returns:
          +
          an array containing the constants of this enum type, in the order they are declared
          +
          +
        • +
        + + + +
          +
        • +

          valueOf

          +
          public static SparkMaxSwerve.SparkMAX_slotIdx valueOf​(String name)
          +
          Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
          +
          +
          Parameters:
          +
          name - the name of the enum constant to be returned.
          +
          Returns:
          +
          the enum constant with the specified name
          +
          Throws:
          +
          IllegalArgumentException - if this enum type has no constant with the specified name
          +
          NullPointerException - if the argument is null
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/SparkMaxSwerve.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/SparkMaxSwerve.html new file mode 100644 index 0000000..f7e1614 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/SparkMaxSwerve.html @@ -0,0 +1,949 @@ + + + + + +SparkMaxSwerve + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class SparkMaxSwerve

    +
    +
    + +
    +
      +
    • +
      +
      public class SparkMaxSwerve
      +extends SwerveMotor
      +
      An implementation of CANSparkMax as a SwerveMotor.
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Nested Class Summary

        + + + + + + + + + + + + +
        Nested Classes 
        Modifier and TypeClassDescription
        (package private) static class SparkMaxSwerve.SparkMAX_slotIdx +
        REV Slots for PID configuration.
        +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Field Summary

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Fields 
        Modifier and TypeFieldDescription
        com.revrobotics.AbsoluteEncoderabsoluteEncoder +
        Absolute encoder attached to the SparkMax (if exists)
        +
        com.revrobotics.RelativeEncoderencoder +
        Integrated encoder.
        +
        private booleanfactoryDefaultOccurred +
        Factory default already occurred.
        +
        com.revrobotics.CANSparkMaxmotor +
        SparkMAX Instance.
        +
        com.revrobotics.SparkMaxPIDControllerpid +
        Closed-loop PID controller.
        +
        + +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Summary

        + + + + + + + + + + + + + + +
        Constructors 
        ConstructorDescription
        SparkMaxSwerve​(int id, + boolean isDriveMotor) +
        Initialize the SwerveMotor as a CANSparkMax connected to a Brushless Motor.
        +
        SparkMaxSwerve​(com.revrobotics.CANSparkMax motor, + boolean isDriveMotor) +
        Initialize the swerve motor.
        +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Summary

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        All Methods Instance Methods Concrete Methods 
        Modifier and TypeMethodDescription
        voidburnFlash() +
        Save the configurations from flash to EEPROM.
        +
        voidclearStickyFaults() +
        Clear the sticky faults on the motor controller.
        +
        voidconfigureCANStatusFrames​(int CANStatus0, + int CANStatus1, + int CANStatus2, + int CANStatus3, + int CANStatus4) +
        Set the CAN status frames.
        +
        voidconfigureIntegratedEncoder​(double positionConversionFactor) +
        Configure the integrated encoder for the swerve module.
        +
        voidconfigurePIDF​(PIDFConfig config) +
        Configure the PIDF values for the closed loop controller.
        +
        voidconfigurePIDWrapping​(double minInput, + double maxInput) +
        Configure the PID wrapping for the position closed loop controller.
        +
        voidfactoryDefaults() +
        Configure the factory defaults.
        +
        ObjectgetMotor() +
        Get the motor object from the module.
        +
        doublegetPosition() +
        Get the position of the integrated encoder.
        +
        doublegetVelocity() +
        Get the velocity of the integrated encoder.
        +
        booleanisAttachedAbsoluteEncoder() +
        Queries whether the absolute encoder is directly attached to the motor controller.
        +
        voidset​(double percentOutput) +
        Set the percentage output.
        +
        SwerveMotorsetAbsoluteEncoder​(SwerveAbsoluteEncoder encoder) +
        Set the absolute encoder to be a compatible absolute encoder.
        +
        voidsetCurrentLimit​(int currentLimit) +
        Set the current limit for the swerve drive motor, remember this may cause jumping if used in conjunction with + voltage compensation.
        +
        voidsetInverted​(boolean inverted) +
        Set the motor to be inverted.
        +
        voidsetLoopRampRate​(double rampRate) +
        Set the maximum rate the open/closed loop output can change by.
        +
        voidsetMotorBrake​(boolean isBrakeMode) +
        Set the idle mode.
        +
        voidsetPosition​(double position) +
        Set the integrated encoder position.
        +
        voidsetReference​(double setpoint, + double feedforward) +
        Set the closed loop PID controller reference point.
        +
        voidsetVoltageCompensation​(double nominalVoltage) +
        Set the voltage compensation for the swerve module motor.
        +
        + +
      • +
      +
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          motor

          +
          public com.revrobotics.CANSparkMax motor
          +
          SparkMAX Instance.
          +
        • +
        + + + +
          +
        • +

          encoder

          +
          public com.revrobotics.RelativeEncoder encoder
          +
          Integrated encoder.
          +
        • +
        + + + +
          +
        • +

          absoluteEncoder

          +
          public com.revrobotics.AbsoluteEncoder absoluteEncoder
          +
          Absolute encoder attached to the SparkMax (if exists)
          +
        • +
        + + + +
          +
        • +

          pid

          +
          public com.revrobotics.SparkMaxPIDController pid
          +
          Closed-loop PID controller.
          +
        • +
        + + + +
          +
        • +

          factoryDefaultOccurred

          +
          private boolean factoryDefaultOccurred
          +
          Factory default already occurred.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SparkMaxSwerve

          +
          public SparkMaxSwerve​(com.revrobotics.CANSparkMax motor,
          +                      boolean isDriveMotor)
          +
          Initialize the swerve motor.
          +
          +
          Parameters:
          +
          motor - The SwerveMotor as a SparkMax object.
          +
          isDriveMotor - Is the motor being initialized a drive motor?
          +
          +
        • +
        + + + +
          +
        • +

          SparkMaxSwerve

          +
          public SparkMaxSwerve​(int id,
          +                      boolean isDriveMotor)
          +
          Initialize the SwerveMotor as a CANSparkMax connected to a Brushless Motor.
          +
          +
          Parameters:
          +
          id - CAN ID of the SparkMax.
          +
          isDriveMotor - Is the motor being initialized a drive motor?
          +
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          setVoltageCompensation

          +
          public void setVoltageCompensation​(double nominalVoltage)
          +
          Set the voltage compensation for the swerve module motor.
          +
          +
          Specified by:
          +
          setVoltageCompensation in class SwerveMotor
          +
          Parameters:
          +
          nominalVoltage - Nominal voltage for operation to output to.
          +
          +
        • +
        + + + +
          +
        • +

          setCurrentLimit

          +
          public 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. This is useful to protect the motor from current spikes.
          +
          +
          Specified by:
          +
          setCurrentLimit in class SwerveMotor
          +
          Parameters:
          +
          currentLimit - Current limit in AMPS at free speed.
          +
          +
        • +
        + + + +
          +
        • +

          setLoopRampRate

          +
          public void setLoopRampRate​(double rampRate)
          +
          Set the maximum rate the open/closed loop output can change by.
          +
          +
          Specified by:
          +
          setLoopRampRate in class SwerveMotor
          +
          Parameters:
          +
          rampRate - Time in seconds to go from 0 to full throttle.
          +
          +
        • +
        + + + +
          +
        • +

          getMotor

          +
          public Object getMotor()
          +
          Get the motor object from the module.
          +
          +
          Specified by:
          +
          getMotor in class SwerveMotor
          +
          Returns:
          +
          Motor object.
          +
          +
        • +
        + + + +
          +
        • +

          isAttachedAbsoluteEncoder

          +
          public boolean isAttachedAbsoluteEncoder()
          +
          Queries whether the absolute encoder is directly attached to the motor controller.
          +
          +
          Specified by:
          +
          isAttachedAbsoluteEncoder in class SwerveMotor
          +
          Returns:
          +
          connected absolute encoder state.
          +
          +
        • +
        + + + +
          +
        • +

          factoryDefaults

          +
          public void factoryDefaults()
          +
          Configure the factory defaults.
          +
          +
          Specified by:
          +
          factoryDefaults in class SwerveMotor
          +
          +
        • +
        + + + +
          +
        • +

          clearStickyFaults

          +
          public void clearStickyFaults()
          +
          Clear the sticky faults on the motor controller.
          +
          +
          Specified by:
          +
          clearStickyFaults in class SwerveMotor
          +
          +
        • +
        + + + + + + + +
          +
        • +

          configureIntegratedEncoder

          +
          public void configureIntegratedEncoder​(double positionConversionFactor)
          +
          Configure the integrated encoder for the swerve module. Sets the conversion factors for position and velocity.
          +
          +
          Specified by:
          +
          configureIntegratedEncoder in class SwerveMotor
          +
          Parameters:
          +
          positionConversionFactor - The conversion factor to apply.
          +
          +
        • +
        + + + +
          +
        • +

          configurePIDF

          +
          public void configurePIDF​(PIDFConfig config)
          +
          Configure the PIDF values for the closed loop controller.
          +
          +
          Specified by:
          +
          configurePIDF in class SwerveMotor
          +
          Parameters:
          +
          config - Configuration class holding the PIDF values.
          +
          +
        • +
        + + + +
          +
        • +

          configurePIDWrapping

          +
          public void configurePIDWrapping​(double minInput,
          +                                 double maxInput)
          +
          Configure the PID wrapping for the position closed loop controller.
          +
          +
          Specified by:
          +
          configurePIDWrapping in class SwerveMotor
          +
          Parameters:
          +
          minInput - Minimum PID input.
          +
          maxInput - Maximum PID input.
          +
          +
        • +
        + + + +
          +
        • +

          configureCANStatusFrames

          +
          public void configureCANStatusFrames​(int CANStatus0,
          +                                     int CANStatus1,
          +                                     int CANStatus2,
          +                                     int CANStatus3,
          +                                     int CANStatus4)
          +
          Set the CAN status frames.
          +
          +
          Parameters:
          +
          CANStatus0 - Applied Output, Faults, Sticky Faults, Is Follower
          +
          CANStatus1 - Motor Velocity, Motor Temperature, Motor Voltage, Motor Current
          +
          CANStatus2 - Motor Position
          +
          CANStatus3 - Analog Sensor Voltage, Analog Sensor Velocity, Analog Sensor Position
          +
          CANStatus4 - Alternate Encoder Velocity, Alternate Encoder Position
          +
          +
        • +
        + + + +
          +
        • +

          setMotorBrake

          +
          public void setMotorBrake​(boolean isBrakeMode)
          +
          Set the idle mode.
          +
          +
          Specified by:
          +
          setMotorBrake in class SwerveMotor
          +
          Parameters:
          +
          isBrakeMode - Set the brake mode.
          +
          +
        • +
        + + + +
          +
        • +

          setInverted

          +
          public void setInverted​(boolean inverted)
          +
          Set the motor to be inverted.
          +
          +
          Specified by:
          +
          setInverted in class SwerveMotor
          +
          Parameters:
          +
          inverted - State of inversion.
          +
          +
        • +
        + + + +
          +
        • +

          burnFlash

          +
          public void burnFlash()
          +
          Save the configurations from flash to EEPROM.
          +
          +
          Specified by:
          +
          burnFlash in class SwerveMotor
          +
          +
        • +
        + + + +
          +
        • +

          set

          +
          public void set​(double percentOutput)
          +
          Set the percentage output.
          +
          +
          Specified by:
          +
          set in class SwerveMotor
          +
          Parameters:
          +
          percentOutput - percent out for the motor controller.
          +
          +
        • +
        + + + +
          +
        • +

          setReference

          +
          public void setReference​(double setpoint,
          +                         double feedforward)
          +
          Set the closed loop PID controller reference point.
          +
          +
          Specified by:
          +
          setReference in class SwerveMotor
          +
          Parameters:
          +
          setpoint - Setpoint in MPS or Angle in degrees.
          +
          feedforward - Feedforward in volt-meter-per-second or kV.
          +
          +
        • +
        + + + +
          +
        • +

          getVelocity

          +
          public double getVelocity()
          +
          Get the velocity of the integrated encoder.
          +
          +
          Specified by:
          +
          getVelocity in class SwerveMotor
          +
          Returns:
          +
          velocity
          +
          +
        • +
        + + + +
          +
        • +

          getPosition

          +
          public double getPosition()
          +
          Get the position of the integrated encoder.
          +
          +
          Specified by:
          +
          getPosition in class SwerveMotor
          +
          Returns:
          +
          Position
          +
          +
        • +
        + + + +
          +
        • +

          setPosition

          +
          public void setPosition​(double position)
          +
          Set the integrated encoder position.
          +
          +
          Specified by:
          +
          setPosition in class SwerveMotor
          +
          Parameters:
          +
          position - Integrated encoder position.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/SwerveMotor.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/SwerveMotor.html new file mode 100644 index 0000000..496281b --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/SwerveMotor.html @@ -0,0 +1,736 @@ + + + + + +SwerveMotor + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.motors.SwerveMotor
      • +
      +
    • +
    +
    +
      +
    • +
      +
      Direct Known Subclasses:
      +
      SparkMaxSwerve
      +
      +
      +
      public abstract class SwerveMotor
      +extends Object
      +
      Swerve motor abstraction which defines a standard interface for motors within a swerve module.
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Summary

        + + + + + + + + + + + + +
        Fields 
        Modifier and TypeFieldDescription
        protected booleanisDriveMotor +
        Whether the swerve motor is a drive motor.
        +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Summary

        + + + + + + + + + + +
        Constructors 
        ConstructorDescription
        SwerveMotor() 
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Summary

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        All Methods Instance Methods Abstract Methods 
        Modifier and TypeMethodDescription
        abstract voidburnFlash() +
        Save the configurations from flash to EEPROM.
        +
        abstract voidclearStickyFaults() +
        Clear the sticky faults on the motor controller.
        +
        abstract voidconfigureIntegratedEncoder​(double positionConversionFactor) +
        Configure the integrated encoder for the swerve module.
        +
        abstract voidconfigurePIDF​(PIDFConfig config) +
        Configure the PIDF values for the closed loop controller.
        +
        abstract voidconfigurePIDWrapping​(double minInput, + double maxInput) +
        Configure the PID wrapping for the position closed loop controller.
        +
        abstract voidfactoryDefaults() +
        Configure the factory defaults.
        +
        abstract ObjectgetMotor() +
        Get the motor object from the module.
        +
        abstract doublegetPosition() +
        Get the position of the integrated encoder.
        +
        abstract doublegetVelocity() +
        Get the velocity of the integrated encoder.
        +
        abstract booleanisAttachedAbsoluteEncoder() +
        Queries whether the absolute encoder is directly attached to the motor controller.
        +
        abstract voidset​(double percentOutput) +
        Set the percentage output.
        +
        abstract SwerveMotorsetAbsoluteEncoder​(SwerveAbsoluteEncoder encoder) +
        Set the absolute encoder to be a compatible absolute encoder.
        +
        abstract voidsetCurrentLimit​(int currentLimit) +
        Set the current limit for the swerve drive motor, remember this may cause jumping if used in conjunction with + voltage compensation.
        +
        abstract voidsetInverted​(boolean inverted) +
        Set the motor to be inverted.
        +
        abstract voidsetLoopRampRate​(double rampRate) +
        Set the maximum rate the open/closed loop output can change by.
        +
        abstract voidsetMotorBrake​(boolean isBrakeMode) +
        Set the idle mode.
        +
        abstract voidsetPosition​(double position) +
        Set the integrated encoder position.
        +
        abstract voidsetReference​(double setpoint, + double feedforward) +
        Set the closed loop PID controller reference point.
        +
        abstract voidsetVoltageCompensation​(double nominalVoltage) +
        Set the voltage compensation for the swerve module motor.
        +
        + +
      • +
      +
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          isDriveMotor

          +
          protected boolean isDriveMotor
          +
          Whether the swerve motor is a drive motor.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveMotor

          +
          public SwerveMotor()
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          factoryDefaults

          +
          public abstract void factoryDefaults()
          +
          Configure the factory defaults.
          +
        • +
        + + + +
          +
        • +

          clearStickyFaults

          +
          public abstract void clearStickyFaults()
          +
          Clear the sticky faults on the motor controller.
          +
        • +
        + + + +
          +
        • +

          setAbsoluteEncoder

          +
          public abstract SwerveMotor setAbsoluteEncoder​(SwerveAbsoluteEncoder encoder)
          +
          Set the absolute encoder to be a compatible absolute encoder.
          +
          +
          Parameters:
          +
          encoder - The encoder to use.
          +
          +
        • +
        + + + +
          +
        • +

          configureIntegratedEncoder

          +
          public abstract void configureIntegratedEncoder​(double positionConversionFactor)
          +
          Configure the integrated encoder for the swerve module. Sets the conversion factors for position and velocity.
          +
          +
          Parameters:
          +
          positionConversionFactor - The conversion factor to apply for position.
          +
          +
        • +
        + + + +
          +
        • +

          configurePIDF

          +
          public abstract void configurePIDF​(PIDFConfig config)
          +
          Configure the PIDF values for the closed loop controller. 0 is disabled or off.
          +
          +
          Parameters:
          +
          config - Configuration class holding the PIDF values.
          +
          +
        • +
        + + + +
          +
        • +

          configurePIDWrapping

          +
          public abstract void configurePIDWrapping​(double minInput,
          +                                          double maxInput)
          +
          Configure the PID wrapping for the position closed loop controller.
          +
          +
          Parameters:
          +
          minInput - Minimum PID input.
          +
          maxInput - Maximum PID input.
          +
          +
        • +
        + + + +
          +
        • +

          setMotorBrake

          +
          public abstract void setMotorBrake​(boolean isBrakeMode)
          +
          Set the idle mode.
          +
          +
          Parameters:
          +
          isBrakeMode - Set the brake mode.
          +
          +
        • +
        + + + +
          +
        • +

          setInverted

          +
          public abstract void setInverted​(boolean inverted)
          +
          Set the motor to be inverted.
          +
          +
          Parameters:
          +
          inverted - State of inversion.
          +
          +
        • +
        + + + +
          +
        • +

          burnFlash

          +
          public abstract void burnFlash()
          +
          Save the configurations from flash to EEPROM.
          +
        • +
        + + + +
          +
        • +

          set

          +
          public abstract void set​(double percentOutput)
          +
          Set the percentage output.
          +
          +
          Parameters:
          +
          percentOutput - percent out for the motor controller.
          +
          +
        • +
        + + + +
          +
        • +

          setReference

          +
          public abstract void setReference​(double setpoint,
          +                                  double feedforward)
          +
          Set the closed loop PID controller reference point.
          +
          +
          Parameters:
          +
          setpoint - Setpoint in MPS or Angle in degrees.
          +
          feedforward - Feedforward in volt-meter-per-second or kV.
          +
          +
        • +
        + + + +
          +
        • +

          getVelocity

          +
          public abstract double getVelocity()
          +
          Get the velocity of the integrated encoder.
          +
          +
          Returns:
          +
          velocity
          +
          +
        • +
        + + + +
          +
        • +

          getPosition

          +
          public abstract double getPosition()
          +
          Get the position of the integrated encoder.
          +
          +
          Returns:
          +
          Position
          +
          +
        • +
        + + + +
          +
        • +

          setPosition

          +
          public abstract void setPosition​(double position)
          +
          Set the integrated encoder position.
          +
          +
          Parameters:
          +
          position - Integrated encoder position. Should be angle in degrees or meters per second.
          +
          +
        • +
        + + + +
          +
        • +

          setVoltageCompensation

          +
          public abstract void setVoltageCompensation​(double nominalVoltage)
          +
          Set the voltage compensation for the swerve module motor.
          +
          +
          Parameters:
          +
          nominalVoltage - Nominal voltage for operation to output to.
          +
          +
        • +
        + + + +
          +
        • +

          setCurrentLimit

          +
          public abstract 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. This is useful to protect the motor from current spikes.
          +
          +
          Parameters:
          +
          currentLimit - Current limit in AMPS at free speed.
          +
          +
        • +
        + + + +
          +
        • +

          setLoopRampRate

          +
          public abstract void setLoopRampRate​(double rampRate)
          +
          Set the maximum rate the open/closed loop output can change by.
          +
          +
          Parameters:
          +
          rampRate - Time in seconds to go from 0 to full throttle.
          +
          +
        • +
        + + + +
          +
        • +

          getMotor

          +
          public abstract Object getMotor()
          +
          Get the motor object from the module.
          +
          +
          Returns:
          +
          Motor object.
          +
          +
        • +
        + + + +
          +
        • +

          isAttachedAbsoluteEncoder

          +
          public abstract boolean isAttachedAbsoluteEncoder()
          +
          Queries whether the absolute encoder is directly attached to the motor controller.
          +
          +
          Returns:
          +
          connected absolute encoder state.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/package-summary.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/package-summary.html new file mode 100644 index 0000000..cc37fb7 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/package-summary.html @@ -0,0 +1,190 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.motors + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Package frc.robot.subsystems.swervedrive2.swervelib.motors

    +
    +
    +
      +
    • + + + + + + + + + + + + + + + + +
      Class Summary 
      ClassDescription
      SparkMaxSwerve +
      An implementation of CANSparkMax as a SwerveMotor.
      +
      SwerveMotor +
      Swerve motor abstraction which defines a standard interface for motors within a swerve module.
      +
      +
    • +
    • + + + + + + + + + + + + +
      Enum Summary 
      EnumDescription
      SparkMaxSwerve.SparkMAX_slotIdx +
      REV Slots for PID configuration.
      +
      +
    • +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/package-tree.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/package-tree.html new file mode 100644 index 0000000..9f383c1 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/motors/package-tree.html @@ -0,0 +1,180 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.motors Class Hierarchy + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Hierarchy For Package frc.robot.subsystems.swervedrive2.swervelib.motors

    +Package Hierarchies: + +
    +
    +
    +

    Class Hierarchy

    +
      +
    • java.lang.Object +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.motors.SwerveMotor + +
      • +
      +
    • +
    +
    +
    +

    Enum Hierarchy

    + +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/package-summary.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/package-summary.html new file mode 100644 index 0000000..49e3007 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/package-summary.html @@ -0,0 +1,179 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Package frc.robot.subsystems.swervedrive2.swervelib

    +
    +
    +
      +
    • + + + + + + + + + + + + + + + + + + + + +
      Class Summary 
      ClassDescription
      SwerveController +
      Controller class used to convert raw inputs into robot speeds.
      +
      SwerveDrive +
      Swerve Drive class representing and controlling the swerve drive.
      +
      SwerveModule +
      The Swerve Module class which represents and controls Swerve Modules for the swerve drive.
      +
      +
    • +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/package-tree.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/package-tree.html new file mode 100644 index 0000000..8e7cfeb --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/package-tree.html @@ -0,0 +1,164 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib Class Hierarchy + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Hierarchy For Package frc.robot.subsystems.swervedrive2.swervelib

    +Package Hierarchies: + +
    +
    +
    +

    Class Hierarchy

    + +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/PIDFConfig.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/PIDFConfig.html new file mode 100644 index 0000000..b4fd9c1 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/PIDFConfig.html @@ -0,0 +1,556 @@ + + + + + +PIDFConfig + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.PIDFConfig
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class PIDFConfig
      +extends Object
      +
      Hold the PIDF and Integral Zone values for a PID.
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Summary

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Fields 
        Modifier and TypeFieldDescription
        doubled +
        Derivative Gain for PID.
        +
        doublef +
        Feedforward value for PID.
        +
        doublei +
        Integral Gain for PID.
        +
        doubleiz +
        Integral zone of the PID.
        +
        PIDFRangeoutput +
        The PIDF output range.
        +
        doublep +
        Proportional Gain for PID.
        +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Summary

        + + + + + + + + + + + + + + + + + + + + + + + + + + +
        Constructors 
        ConstructorDescription
        PIDFConfig() +
        Used when parsing PIDF values from JSON.
        +
        PIDFConfig​(double p, + double d) +
        PIDF Config constructor to contain the values.
        +
        PIDFConfig​(double p, + double i, + double d) +
        PIDF Config constructor to contain the values.
        +
        PIDFConfig​(double p, + double i, + double d, + double f) +
        PIDF Config constructor to contain the values.
        +
        PIDFConfig​(double p, + double i, + double d, + double f, + double iz) +
        PIDF Config constructor to contain the values.
        +
        +
      • +
      +
      + +
      + +
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          p

          +
          public double p
          +
          Proportional Gain for PID.
          +
        • +
        + + + +
          +
        • +

          i

          +
          public double i
          +
          Integral Gain for PID.
          +
        • +
        + + + +
          +
        • +

          d

          +
          public double d
          +
          Derivative Gain for PID.
          +
        • +
        + + + +
          +
        • +

          f

          +
          public double f
          +
          Feedforward value for PID.
          +
        • +
        + + + +
          +
        • +

          iz

          +
          public double iz
          +
          Integral zone of the PID.
          +
        • +
        + + + +
          +
        • +

          output

          +
          public PIDFRange output
          +
          The PIDF output range.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          PIDFConfig

          +
          public PIDFConfig()
          +
          Used when parsing PIDF values from JSON.
          +
        • +
        + + + +
          +
        • +

          PIDFConfig

          +
          public PIDFConfig​(double p,
          +                  double i,
          +                  double d,
          +                  double f,
          +                  double iz)
          +
          PIDF Config constructor to contain the values.
          +
          +
          Parameters:
          +
          p - P gain.
          +
          i - I gain.
          +
          d - D gain.
          +
          f - F gain.
          +
          iz - Intergral zone.
          +
          +
        • +
        + + + +
          +
        • +

          PIDFConfig

          +
          public PIDFConfig​(double p,
          +                  double i,
          +                  double d,
          +                  double f)
          +
          PIDF Config constructor to contain the values.
          +
          +
          Parameters:
          +
          p - P gain.
          +
          i - I gain.
          +
          d - D gain.
          +
          f - F gain.
          +
          +
        • +
        + + + +
          +
        • +

          PIDFConfig

          +
          public PIDFConfig​(double p,
          +                  double i,
          +                  double d)
          +
          PIDF Config constructor to contain the values.
          +
          +
          Parameters:
          +
          p - P gain.
          +
          i - I gain.
          +
          d - D gain.
          +
          +
        • +
        + + + +
          +
        • +

          PIDFConfig

          +
          public PIDFConfig​(double p,
          +                  double d)
          +
          PIDF Config constructor to contain the values.
          +
          +
          Parameters:
          +
          p - P gain.
          +
          d - D gain.
          +
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          createPIDController

          +
          public edu.wpi.first.math.controller.PIDController createPIDController()
          +
          Create a PIDController from the PID values.
          +
          +
          Returns:
          +
          PIDController.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveControllerConfiguration.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveControllerConfiguration.html new file mode 100644 index 0000000..07c78d4 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveControllerConfiguration.html @@ -0,0 +1,402 @@ + + + + + +SwerveControllerConfiguration + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class SwerveControllerConfiguration

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.SwerveControllerConfiguration
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class SwerveControllerConfiguration
      +extends Object
      +
      Swerve Controller configuration class which is used to configure + SwerveController.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          maxSpeed

          +
          public final double maxSpeed
          +
          Maximum robot speed in meters per second.
          +
        • +
        + + + +
          +
        • +

          maxAngularVelocity

          +
          public final double maxAngularVelocity
          +
          Maximum angular velocity in rad/s
          +
        • +
        + + + +
          +
        • +

          headingPIDF

          +
          public final PIDFConfig headingPIDF
          +
          PIDF for the heading of the robot.
          +
        • +
        + + + +
          +
        • +

          angleJoyStickRadiusDeadband

          +
          public final double angleJoyStickRadiusDeadband
          +
          hypotenuse deadband for the robot angle control joystick.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveControllerConfiguration

          +
          public SwerveControllerConfiguration​(SwerveDriveConfiguration driveCfg,
          +                                     PIDFConfig headingPIDF,
          +                                     double angleJoyStickRadiusDeadband)
          +
          Construct the swerve controller configuration.
          +
          +
          Parameters:
          +
          driveCfg - Drive configuration.
          +
          headingPIDF - Heading PIDF configuration.
          +
          angleJoyStickRadiusDeadband - Deadband on radius of angle joystick.
          +
          +
        • +
        + + + +
          +
        • +

          SwerveControllerConfiguration

          +
          public SwerveControllerConfiguration​(SwerveDriveConfiguration driveCfg,
          +                                     PIDFConfig headingPIDF)
          +
          Construct the swerve controller configuration. Assumes hypotenuse deadband of 0.5 (minimum radius for angle to be + set on angle joystick is .5 of the controller).
          +
          +
          Parameters:
          +
          driveCfg - Drive configuration.
          +
          headingPIDF - Heading PIDF configuration.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveDriveConfiguration.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveDriveConfiguration.html new file mode 100644 index 0000000..e80eec8 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveDriveConfiguration.html @@ -0,0 +1,461 @@ + + + + + +SwerveDriveConfiguration + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class SwerveDriveConfiguration

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.SwerveDriveConfiguration
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class SwerveDriveConfiguration
      +extends Object
      +
      Swerve drive configurations used during SwerveDrive construction.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          moduleLocationsMeters

          +
          public edu.wpi.first.math.geometry.Translation2d[] moduleLocationsMeters
          +
          Swerve Module locations.
          +
        • +
        + + + +
          +
        • +

          imu

          +
          public SwerveIMU imu
          +
          Swerve IMU
          +
        • +
        + + + +
          +
        • +

          invertedIMU

          +
          public boolean invertedIMU
          +
          Invert the imu measurements.
          +
        • +
        + + + +
          +
        • +

          maxSpeed

          +
          public double maxSpeed
          +
          Max speed in meters per second.
          +
        • +
        + + + +
          +
        • +

          moduleCount

          +
          public int moduleCount
          +
          Number of modules on the robot.
          +
        • +
        + + + +
          +
        • +

          modules

          +
          public SwerveModule[] modules
          +
          Swerve Modules.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveDriveConfiguration

          +
          public SwerveDriveConfiguration​(SwerveModuleConfiguration[] moduleConfigs,
          +                                SwerveIMU swerveIMU,
          +                                double maxSpeed,
          +                                boolean invertedIMU)
          +
          Create swerve drive configuration.
          +
          +
          Parameters:
          +
          moduleConfigs - Module configuration.
          +
          swerveIMU - Swerve IMU.
          +
          maxSpeed - Max speed of the robot in meters per second.
          +
          invertedIMU - Invert the IMU.
          +
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          createModules

          +
          public SwerveModule[] createModules​(SwerveModuleConfiguration[] swerves)
          +
          Create modules based off of the SwerveModuleConfiguration.
          +
          +
          Parameters:
          +
          swerves - Swerve constants.
          +
          Returns:
          +
          Swerve Modules.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveModuleConfiguration.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveModuleConfiguration.html new file mode 100644 index 0000000..f7e153e --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveModuleConfiguration.html @@ -0,0 +1,677 @@ + + + + + +SwerveModuleConfiguration + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class SwerveModuleConfiguration

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.SwerveModuleConfiguration
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class SwerveModuleConfiguration
      +extends Object
      +
      Swerve Module configuration class which is used to configure + SwerveModule.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          angleOffset

          +
          public final double angleOffset
          +
          Angle offset in degrees for the Swerve Module.
          +
        • +
        + + + +
          +
        • +

          absoluteEncoderInverted

          +
          public final boolean absoluteEncoderInverted
          +
          Whether the absolute encoder is inverted.
          +
        • +
        + + + +
          +
        • +

          driveMotorInverted

          +
          public final boolean driveMotorInverted
          +
          State of inversion of the drive motor.
          +
        • +
        + + + +
          +
        • +

          angleMotorInverted

          +
          public final boolean angleMotorInverted
          +
          State of inversion of the angle motor.
          +
        • +
        + + + +
          +
        • +

          maxSpeed

          +
          public final double maxSpeed
          +
          Maximum robot speed in meters per second.
          +
        • +
        + + + +
          +
        • +

          anglePIDF

          +
          public PIDFConfig anglePIDF
          +
          PIDF configuration options for the angle motor closed-loop PID controller.
          +
        • +
        + + + +
          +
        • +

          velocityPIDF

          +
          public PIDFConfig velocityPIDF
          +
          PIDF configuration options for the drive motor closed-loop PID controller.
          +
        • +
        + + + +
          +
        • +

          angleKV

          +
          public double angleKV
          +
          Angle volt-meter-per-second.
          +
        • +
        + + + +
          +
        • +

          moduleLocation

          +
          public edu.wpi.first.math.geometry.Translation2d moduleLocation
          +
          Swerve module location relative to the robot.
          +
        • +
        + + + + + + + +
          +
        • +

          driveMotor

          +
          public SwerveMotor driveMotor
          +
          The drive motor and angle motor of this swerve module.
          +
        • +
        + + + +
          +
        • +

          angleMotor

          +
          public SwerveMotor angleMotor
          +
          The drive motor and angle motor of this swerve module.
          +
        • +
        + + + +
          +
        • +

          absoluteEncoder

          +
          public SwerveAbsoluteEncoder absoluteEncoder
          +
          The Absolute Encoder for the swerve module.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveModuleConfiguration

          +
          public SwerveModuleConfiguration​(SwerveMotor driveMotor,
          +                                 SwerveMotor angleMotor,
          +                                 SwerveAbsoluteEncoder absoluteEncoder,
          +                                 double angleOffset,
          +                                 double xMeters,
          +                                 double yMeters,
          +                                 PIDFConfig anglePIDF,
          +                                 PIDFConfig velocityPIDF,
          +                                 double maxSpeed,
          +                                 SwerveModulePhysicalCharacteristics physicalCharacteristics,
          +                                 boolean absoluteEncoderInverted,
          +                                 boolean driveMotorInverted,
          +                                 boolean angleMotorInverted)
          +
          Construct a configuration object for swerve modules.
          +
          +
          Parameters:
          +
          driveMotor - Drive SwerveMotor.
          +
          angleMotor - Angle SwerveMotor
          +
          absoluteEncoder - Absolute encoder SwerveAbsoluteEncoder.
          +
          angleOffset - Absolute angle offset to 0.
          +
          absoluteEncoderInverted - Absolute encoder inverted.
          +
          angleMotorInverted - State of inversion of the angle motor.
          +
          driveMotorInverted - Drive motor inverted.
          +
          xMeters - Module location in meters from the center horizontally.
          +
          yMeters - Module location in meters from center vertically.
          +
          anglePIDF - Angle PIDF configuration.
          +
          velocityPIDF - Velocity PIDF configuration.
          +
          maxSpeed - Maximum speed in meters per second.
          +
          physicalCharacteristics - Physical characteristics of the swerve module.
          +
          +
        • +
        + + + +
          +
        • +

          SwerveModuleConfiguration

          +
          public SwerveModuleConfiguration​(SwerveMotor driveMotor,
          +                                 SwerveMotor angleMotor,
          +                                 SwerveAbsoluteEncoder absoluteEncoder,
          +                                 double angleOffset,
          +                                 double xMeters,
          +                                 double yMeters,
          +                                 PIDFConfig anglePIDF,
          +                                 PIDFConfig velocityPIDF,
          +                                 double maxSpeed,
          +                                 SwerveModulePhysicalCharacteristics physicalCharacteristics)
          +
          Construct a configuration object for swerve modules. Assumes the absolute encoder and drive motor are not + inverted.
          +
          +
          Parameters:
          +
          driveMotor - Drive SwerveMotor.
          +
          angleMotor - Angle SwerveMotor
          +
          absoluteEncoder - Absolute encoder SwerveAbsoluteEncoder.
          +
          angleOffset - Absolute angle offset to 0.
          +
          xMeters - Module location in meters from the center horizontally.
          +
          yMeters - Module location in meters from center vertically.
          +
          anglePIDF - Angle PIDF configuration.
          +
          velocityPIDF - Velocity PIDF configuration.
          +
          maxSpeed - Maximum robot speed in meters per second.
          +
          physicalCharacteristics - Physical characteristics of the swerve module.
          +
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          createDriveFeedforward

          +
          public edu.wpi.first.math.controller.SimpleMotorFeedforward createDriveFeedforward()
          +
          Create the drive feedforward for swerve modules.
          +
          +
          Returns:
          +
          Drive feedforward for drive motor on a swerve module.
          +
          +
        • +
        + + + +
          +
        • +

          getPositionEncoderConversion

          +
          public double getPositionEncoderConversion​(boolean isDriveMotor)
          +
          Get the encoder conversion for position encoders.
          +
          +
          Parameters:
          +
          isDriveMotor - For the drive motor.
          +
          Returns:
          +
          Position encoder conversion factor.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveModulePhysicalCharacteristics.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveModulePhysicalCharacteristics.html new file mode 100644 index 0000000..3629e96 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveModulePhysicalCharacteristics.html @@ -0,0 +1,588 @@ + + + + + +SwerveModulePhysicalCharacteristics + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class SwerveModulePhysicalCharacteristics

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.SwerveModulePhysicalCharacteristics
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class SwerveModulePhysicalCharacteristics
      +extends Object
      +
      Configuration class which stores physical characteristics shared between every swerve module.
      +
    • +
    +
    +
    +
      +
    • + +
      + +
      + +
      +
        +
      • + + +

        Constructor Summary

        + + + + + + + + + + + + + + +
        Constructors 
        ConstructorDescription
        SwerveModulePhysicalCharacteristics​(double driveGearRatio, + double angleGearRatio, + double angleMotorFreeSpeedRPM, + double wheelDiameter, + double driveMotorRampRate, + double angleMotorRampRate, + int driveEncoderPulsePerRotation, + int angleEncoderPulsePerRotation) +
        Construct the swerve module physical characteristics.
        +
        SwerveModulePhysicalCharacteristics​(double driveGearRatio, + double angleGearRatio, + double angleMotorFreeSpeedRPM, + double wheelDiameter, + double wheelGripCoefficientOfFriction, + double optimalVoltage, + int driveMotorCurrentLimit, + int angleMotorCurrentLimit, + double driveMotorRampRate, + double angleMotorRampRate, + int driveEncoderPulsePerRotation, + int angleEncoderPulsePerRotation) +
        Construct the swerve module physical characteristics.
        +
        +
      • +
      +
      + +
      + +
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          wheelDiameter

          +
          public final double wheelDiameter
          +
          Wheel diameter in meters.
          +
        • +
        + + + +
          +
        • +

          driveGearRatio

          +
          public final double driveGearRatio
          +
          Drive gear ratio. How many times the motor has to spin before the wheel makes a complete rotation.
          +
        • +
        + + + +
          +
        • +

          angleGearRatio

          +
          public final double angleGearRatio
          +
          Angle gear ratio. How many times the motor has to spin before the wheel makes a full rotation.
          +
        • +
        + + + +
          +
        • +

          driveEncoderPulsePerRotation

          +
          public final int driveEncoderPulsePerRotation
          +
          Drive motor encoder pulse per rotation. 1 if integrated encoder.
          +
        • +
        + + + +
          +
        • +

          angleEncoderPulsePerRotation

          +
          public final int angleEncoderPulsePerRotation
          +
          Angle motor encoder pulse per rotation. 1 if integrated encoder.
          +
        • +
        + + + +
          +
        • +

          optimalVoltage

          +
          public final double optimalVoltage
          +
          Optimal voltage of the robot.
          +
        • +
        + + + +
          +
        • +

          driveMotorCurrentLimit

          +
          public final int driveMotorCurrentLimit
          +
          Current limits for the Swerve Module.
          +
        • +
        + + + +
          +
        • +

          angleMotorCurrentLimit

          +
          public final int angleMotorCurrentLimit
          +
          Current limits for the Swerve Module.
          +
        • +
        + + + +
          +
        • +

          driveMotorRampRate

          +
          public final double driveMotorRampRate
          +
          The time it takes for the motor to go from 0 to full throttle in seconds.
          +
        • +
        + + + +
          +
        • +

          angleMotorRampRate

          +
          public final double angleMotorRampRate
          +
          The time it takes for the motor to go from 0 to full throttle in seconds.
          +
        • +
        + + + +
          +
        • +

          wheelGripCoefficientOfFriction

          +
          public final double wheelGripCoefficientOfFriction
          +
          Wheel grip tape coefficient of friction on carpet, as described by the vendor.
          +
        • +
        + + + +
          +
        • +

          angleMotorFreeSpeedRPM

          +
          public final double angleMotorFreeSpeedRPM
          +
          Free speed rotations per minute of the motor, as described by the vendor.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveModulePhysicalCharacteristics

          +
          public SwerveModulePhysicalCharacteristics​(double driveGearRatio,
          +                                           double angleGearRatio,
          +                                           double angleMotorFreeSpeedRPM,
          +                                           double wheelDiameter,
          +                                           double wheelGripCoefficientOfFriction,
          +                                           double optimalVoltage,
          +                                           int driveMotorCurrentLimit,
          +                                           int angleMotorCurrentLimit,
          +                                           double driveMotorRampRate,
          +                                           double angleMotorRampRate,
          +                                           int driveEncoderPulsePerRotation,
          +                                           int angleEncoderPulsePerRotation)
          +
          Construct the swerve module physical characteristics.
          +
          +
          Parameters:
          +
          driveGearRatio - Gear ratio of the drive motor. Number of motor rotations to rotate the + wheel.
          +
          angleGearRatio - Gear ratio of the angle motor. Number of motor rotations to spin the wheel.
          +
          angleMotorFreeSpeedRPM - Motor free speed rotation per minute.
          +
          wheelDiameter - Wheel diameter in meters.
          +
          wheelGripCoefficientOfFriction - Wheel grip coefficient of friction on carpet given by manufacturer.
          +
          optimalVoltage - Optimal robot voltage.
          +
          driveMotorCurrentLimit - Current limit for the drive motor.
          +
          angleMotorCurrentLimit - Current limit for the angle motor.
          +
          driveMotorRampRate - The time in seconds to go from 0 to full throttle on the motor. (Prevents + over drawing power from battery)
          +
          angleMotorRampRate - The time in seconds to go from 0 to full throttle on the motor. (Prevents + overdrawing power and power loss).
          +
          driveEncoderPulsePerRotation - The number of encoder pulses per motor rotation, 1 for integrated encoders.
          +
          angleEncoderPulsePerRotation - The number of encoder pulses per motor rotation, 1 for integrated encoders.
          +
          +
        • +
        + + + +
          +
        • +

          SwerveModulePhysicalCharacteristics

          +
          public SwerveModulePhysicalCharacteristics​(double driveGearRatio,
          +                                           double angleGearRatio,
          +                                           double angleMotorFreeSpeedRPM,
          +                                           double wheelDiameter,
          +                                           double driveMotorRampRate,
          +                                           double angleMotorRampRate,
          +                                           int driveEncoderPulsePerRotation,
          +                                           int angleEncoderPulsePerRotation)
          +
          Construct the swerve module physical characteristics. Assume coefficient of friction is 1.19 (taken from blue + nitrile on carpet from Studica) and optimal voltage is 12v. Assumes the drive motor current limit is 40A, and the + angle motor current limit is 20A.
          +
          +
          Parameters:
          +
          driveGearRatio - Gear ratio of the drive motor. Number of motor rotations to rotate the wheel.
          +
          angleGearRatio - Gear ratio of the angle motor. Number of motor rotations to spin the wheel.
          +
          angleMotorFreeSpeedRPM - Motor free speed rotation per minute.
          +
          wheelDiameter - Wheel diameter in meters.
          +
          driveMotorRampRate - The time in seconds to go from 0 to full throttle on the motor. (Prevents over + drawing power from battery)
          +
          angleMotorRampRate - The time in seconds to go from 0 to full throttle on the motor. (Prevents + overdrawing power and power loss).
          +
          driveEncoderPulsePerRotation - The number of encoder pulses per motor rotation, 1 for integrated encoders.
          +
          angleEncoderPulsePerRotation - The number of encoder pulses per motor rotation, 1 for integrated encoders.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveParser.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveParser.html new file mode 100644 index 0000000..52776f6 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/SwerveParser.html @@ -0,0 +1,520 @@ + + + + + +SwerveParser + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.SwerveParser
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class SwerveParser
      +extends Object
      +
      Helper class used to parse the JSON directory with specified configuration options.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      + +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveParser

          +
          public SwerveParser​(File directory)
          +             throws IOException
          +
          Construct a swerve parser. Will throw an error if there is a missing file.
          +
          +
          Parameters:
          +
          directory - Directory with swerve configurations.
          +
          Throws:
          +
          IOException
          +
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + + + + + +
          +
        • +

          openJson

          +
          private com.fasterxml.jackson.databind.JsonNode openJson​(File file)
          +
          Open JSON file.
          +
          +
          Parameters:
          +
          file - JSON File to open.
          +
          Returns:
          +
          JsonNode of file.
          +
          +
        • +
        + + + +
          +
        • +

          checkDirectory

          +
          private void checkDirectory​(File directory)
          +
          Check directory structure.
          +
          +
          Parameters:
          +
          directory - JSON Configuration Directory
          +
          +
        • +
        + + + + +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/deserializer/PIDFRange.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/deserializer/PIDFRange.html new file mode 100644 index 0000000..c0cd198 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/deserializer/PIDFRange.html @@ -0,0 +1,330 @@ + + + + + +PIDFRange + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.deserializer.PIDFRange
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class PIDFRange
      +extends Object
      +
      Class to hold the minimum and maximum input or output of the PIDF.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          min

          +
          public double min
          +
          Minimum value.
          +
        • +
        + + + +
          +
        • +

          max

          +
          public double max
          +
          Maximum value.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          PIDFRange

          +
          public PIDFRange()
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/deserializer/package-summary.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/deserializer/package-summary.html new file mode 100644 index 0000000..cc275ce --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/deserializer/package-summary.html @@ -0,0 +1,167 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.parser.deserializer + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Package frc.robot.subsystems.swervedrive2.swervelib.parser.deserializer

    +
    +
    +
      +
    • + + + + + + + + + + + + +
      Class Summary 
      ClassDescription
      PIDFRange +
      Class to hold the minimum and maximum input or output of the PIDF.
      +
      +
    • +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/deserializer/package-tree.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/deserializer/package-tree.html new file mode 100644 index 0000000..4653bdb --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/deserializer/package-tree.html @@ -0,0 +1,162 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.parser.deserializer Class Hierarchy + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Hierarchy For Package frc.robot.subsystems.swervedrive2.swervelib.parser.deserializer

    +Package Hierarchies: + +
    +
    +
    +

    Class Hierarchy

    +
      +
    • java.lang.Object +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.deserializer.PIDFRange
      • +
      +
    • +
    +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/ControllerPropertiesJson.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/ControllerPropertiesJson.html new file mode 100644 index 0000000..bd1b635 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/ControllerPropertiesJson.html @@ -0,0 +1,377 @@ + + + + + +ControllerPropertiesJson + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class ControllerPropertiesJson

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.json.ControllerPropertiesJson
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class ControllerPropertiesJson
      +extends Object
      +
      SwerveController parsed class. Used to access the JSON data.
      +
    • +
    +
    +
    + +
    +
    + +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/DeviceJson.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/DeviceJson.html new file mode 100644 index 0000000..076f54a --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/DeviceJson.html @@ -0,0 +1,459 @@ + + + + + +DeviceJson + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.json.DeviceJson
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class DeviceJson
      +extends Object
      +
      Device JSON parsed class. Used to access the JSON data.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          type

          +
          public String type
          +
          The device type, e.g. pigeon/pigeon2/sparkmax/talonfx/navx
          +
        • +
        + + + +
          +
        • +

          id

          +
          public int id
          +
          The CAN ID or pin ID of the device.
          +
        • +
        + + + +
          +
        • +

          canbus

          +
          public String canbus
          +
          The CAN bus name which the device resides on if using CAN.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          DeviceJson

          +
          public DeviceJson()
          +
        • +
        +
      • +
      +
      + +
      + +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/ModuleJson.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/ModuleJson.html new file mode 100644 index 0000000..3a68eb0 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/ModuleJson.html @@ -0,0 +1,471 @@ + + + + + +ModuleJson + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.json.ModuleJson
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class ModuleJson
      +extends Object
      +
      SwerveModule JSON parsed class. Used to access the JSON data.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          drive

          +
          public DeviceJson drive
          +
          Drive motor device configuration.
          +
        • +
        + + + +
          +
        • +

          angle

          +
          public DeviceJson angle
          +
          Angle motor device configuration.
          +
        • +
        + + + +
          +
        • +

          encoder

          +
          public DeviceJson encoder
          +
          Absolute encoder device configuration.
          +
        • +
        + + + +
          +
        • +

          inverted

          +
          public BoolMotorJson inverted
          +
          Defines which motors are inverted.
          +
        • +
        + + + +
          +
        • +

          absoluteEncoderOffset

          +
          public double absoluteEncoderOffset
          +
          Absolute encoder offset from 0 in degrees.
          +
        • +
        + + + +
          +
        • +

          absoluteEncoderInverted

          +
          public boolean absoluteEncoderInverted
          +
          Absolute encoder inversion state.
          +
        • +
        + + + +
          +
        • +

          location

          +
          public LocationJson location
          +
          The location of the swerve module from the center of the robot in inches.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          ModuleJson

          +
          public ModuleJson()
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          createModuleConfiguration

          +
          public SwerveModuleConfiguration createModuleConfiguration​(PIDFConfig anglePIDF,
          +                                                           PIDFConfig velocityPIDF,
          +                                                           double maxSpeed,
          +                                                           SwerveModulePhysicalCharacteristics physicalCharacteristics)
          +
          Create the swerve module configuration based off of parsed data.
          +
          +
          Parameters:
          +
          anglePIDF - The PIDF values for the angle motor.
          +
          velocityPIDF - The velocity PIDF values for the drive motor.
          +
          maxSpeed - The maximum speed of the robot in meters per second.
          +
          physicalCharacteristics - Physical characteristics of the swerve module.
          +
          Returns:
          +
          SwerveModuleConfiguration based on the provided data and parsed data.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/MotorConfigDouble.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/MotorConfigDouble.html new file mode 100644 index 0000000..ad9c63b --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/MotorConfigDouble.html @@ -0,0 +1,356 @@ + + + + + +MotorConfigDouble + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class MotorConfigDouble

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.json.MotorConfigDouble
      • +
      +
    • +
    +
    +
      +
    • +
      +
      class MotorConfigDouble
      +extends Object
      +
      Used to store doubles for motor configuration.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          drive

          +
          public double drive
          +
          Drive motor.
          +
        • +
        + + + +
          +
        • +

          angle

          +
          public double angle
          +
          Angle motor.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          MotorConfigDouble

          +
          public MotorConfigDouble()
          +
          Default constructor.
          +
        • +
        + + + +
          +
        • +

          MotorConfigDouble

          +
          public MotorConfigDouble​(double angle,
          +                         double drive)
          +
          Default constructor.
          +
          +
          Parameters:
          +
          angle - Angle data.
          +
          drive - Drive data.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/MotorConfigInt.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/MotorConfigInt.html new file mode 100644 index 0000000..85aec7b --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/MotorConfigInt.html @@ -0,0 +1,356 @@ + + + + + +MotorConfigInt + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.json.MotorConfigInt
      • +
      +
    • +
    +
    +
      +
    • +
      +
      class MotorConfigInt
      +extends Object
      +
      Used to store ints for motor configuration.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          drive

          +
          public int drive
          +
          Drive motor.
          +
        • +
        + + + +
          +
        • +

          angle

          +
          public int angle
          +
          Angle motor.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          MotorConfigInt

          +
          public MotorConfigInt()
          +
          Default constructor.
          +
        • +
        + + + +
          +
        • +

          MotorConfigInt

          +
          public MotorConfigInt​(int drive,
          +                      int angle)
          +
          Default constructor with values.
          +
          +
          Parameters:
          +
          drive - Drive data.
          +
          angle - Angle data.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/PIDFPropertiesJson.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/PIDFPropertiesJson.html new file mode 100644 index 0000000..bc46570 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/PIDFPropertiesJson.html @@ -0,0 +1,331 @@ + + + + + +PIDFPropertiesJson + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class PIDFPropertiesJson

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.json.PIDFPropertiesJson
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class PIDFPropertiesJson
      +extends Object
      +
      SwerveModule PID with Feedforward for the drive motor and angle + motor.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          drive

          +
          public PIDFConfig drive
          +
          The PIDF with Integral Zone used for the drive motor.
          +
        • +
        + + + +
          +
        • +

          angle

          +
          public PIDFConfig angle
          +
          The PIDF with Integral Zone used for the angle motor.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          PIDFPropertiesJson

          +
          public PIDFPropertiesJson()
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/PhysicalPropertiesJson.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/PhysicalPropertiesJson.html new file mode 100644 index 0000000..ff7b522 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/PhysicalPropertiesJson.html @@ -0,0 +1,463 @@ + + + + + +PhysicalPropertiesJson + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + +

    Class PhysicalPropertiesJson

    +
    +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.json.PhysicalPropertiesJson
      • +
      +
    • +
    +
    + +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          wheelDiameter

          +
          public double wheelDiameter
          +
          Wheel diameter in inches.
          +
        • +
        + + + +
          +
        • +

          gearRatio

          +
          public MotorConfigDouble gearRatio
          +
          Gear ratio for the motors, number of times the motor has to spin before the wheel rotates a single time.
          +
        • +
        + + + +
          +
        • +

          encoderPulsePerRotation

          +
          public MotorConfigInt encoderPulsePerRotation
          +
          Encoder pulse per rotation for non-integrated encoders. 1 for integrated encoders.
          +
        • +
        + + + +
          +
        • +

          currentLimit

          +
          public MotorConfigInt currentLimit
          +
          The current limit in AMPs to apply to the motors.
          +
        • +
        + + + +
          +
        • +

          rampRate

          +
          public MotorConfigDouble rampRate
          +
          The minimum number of seconds to take for the motor to go from 0 to full throttle.
          +
        • +
        + + + +
          +
        • +

          wheelGripCoefficientOfFriction

          +
          public double wheelGripCoefficientOfFriction
          +
          The grip tape coefficient of friction on carpet. Used to calculate the practical maximum acceleration.
          +
        • +
        + + + +
          +
        • +

          angleMotorFreeSpeedRPM

          +
          public double angleMotorFreeSpeedRPM
          +
          Angle motor free speed rotations per minute.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          PhysicalPropertiesJson

          +
          public PhysicalPropertiesJson()
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          createPhysicalProperties

          +
          public SwerveModulePhysicalCharacteristics createPhysicalProperties​(double optimalVoltage)
          +
          Create the physical characteristics based off the parsed data.
          +
          +
          Parameters:
          +
          optimalVoltage - Optimal voltage to compensate for and use to calculate drive motor feedforward.
          +
          Returns:
          +
          SwerveModulePhysicalCharacteristics based on parsed data.
          +
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/SwerveDriveJson.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/SwerveDriveJson.html new file mode 100644 index 0000000..2720603 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/SwerveDriveJson.html @@ -0,0 +1,382 @@ + + + + + +SwerveDriveJson + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.json.SwerveDriveJson
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class SwerveDriveJson
      +extends Object
      +
      SwerveDrive JSON parsed class. Used to access parsed data from + the swervedrive.json file.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          maxSpeed

          +
          public double maxSpeed
          +
          Maximum robot speed in feet per second.
          +
        • +
        + + + +
          +
        • +

          optimalVoltage

          +
          public double optimalVoltage
          +
          Optimal voltage to compensate to and base feedforward calculations off of.
          +
        • +
        + + + +
          +
        • +

          imu

          +
          public DeviceJson imu
          +
          Robot IMU used to determine heading of the robot.
          +
        • +
        + + + +
          +
        • +

          invertedIMU

          +
          public boolean invertedIMU
          +
          Invert the IMU of the robot.
          +
        • +
        + + + +
          +
        • +

          modules

          +
          public String[] modules
          +
          Module JSONs in order clockwise order starting from front left.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          SwerveDriveJson

          +
          public SwerveDriveJson()
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/modules/BoolMotorJson.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/modules/BoolMotorJson.html new file mode 100644 index 0000000..d01ff54 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/modules/BoolMotorJson.html @@ -0,0 +1,330 @@ + + + + + +BoolMotorJson + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.json.modules.BoolMotorJson
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class BoolMotorJson
      +extends Object
      +
      Inverted motor JSON parsed class. Used to access the JSON data.
      +
    • +
    +
    +
    + +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          drive

          +
          public boolean drive
          +
          Drive motor inversion state.
          +
        • +
        + + + +
          +
        • +

          angle

          +
          public boolean angle
          +
          Angle motor inversion state.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          BoolMotorJson

          +
          public BoolMotorJson()
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/modules/LocationJson.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/modules/LocationJson.html new file mode 100644 index 0000000..00d13cb --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/modules/LocationJson.html @@ -0,0 +1,331 @@ + + + + + +LocationJson + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    +
      +
    • java.lang.Object
    • +
    • +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.json.modules.LocationJson
      • +
      +
    • +
    +
    +
      +
    • +
      +
      public class LocationJson
      +extends Object
      +
      Location JSON parsed class. Used to access the JSON data. Module locations, in inches, as distances to the center of + the robot. Positive x is torwards the robot front, and * +y is torwards robot left.
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Summary

        + + + + + + + + + + + + + + + + + +
        Fields 
        Modifier and TypeFieldDescription
        doublex +
        Location of the swerve module in inches from the center of the robot horizontally.
        +
        doubley +
        Location of the swerve module in inches from the center of the robot vertically.
        +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Summary

        + + + + + + + + + + +
        Constructors 
        ConstructorDescription
        LocationJson() 
        +
      • +
      +
      + +
      + +
      +
    • +
    +
    +
    +
      +
    • + +
      +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          x

          +
          public double x
          +
          Location of the swerve module in inches from the center of the robot horizontally.
          +
        • +
        + + + +
          +
        • +

          y

          +
          public double y
          +
          Location of the swerve module in inches from the center of the robot vertically.
          +
        • +
        +
      • +
      +
      + +
      +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          LocationJson

          +
          public LocationJson()
          +
        • +
        +
      • +
      +
      +
    • +
    +
    +
    +
    + + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/modules/package-summary.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/modules/package-summary.html new file mode 100644 index 0000000..e1c01da --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/modules/package-summary.html @@ -0,0 +1,173 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.parser.json.modules + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Package frc.robot.subsystems.swervedrive2.swervelib.parser.json.modules

    +
    +
    +
      +
    • + + + + + + + + + + + + + + + + +
      Class Summary 
      ClassDescription
      BoolMotorJson +
      Inverted motor JSON parsed class.
      +
      LocationJson +
      Location JSON parsed class.
      +
      +
    • +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/modules/package-tree.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/modules/package-tree.html new file mode 100644 index 0000000..f971d2f --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/modules/package-tree.html @@ -0,0 +1,163 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.parser.json.modules Class Hierarchy + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Hierarchy For Package frc.robot.subsystems.swervedrive2.swervelib.parser.json.modules

    +Package Hierarchies: + +
    +
    +
    +

    Class Hierarchy

    +
      +
    • java.lang.Object +
        +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.json.modules.BoolMotorJson
      • +
      • frc.robot.subsystems.swervedrive2.swervelib.parser.json.modules.LocationJson
      • +
      +
    • +
    +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/package-summary.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/package-summary.html new file mode 100644 index 0000000..89acc9a --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/package-summary.html @@ -0,0 +1,210 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.parser.json + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Package frc.robot.subsystems.swervedrive2.swervelib.parser.json

    +
    +
    + +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/package-tree.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/package-tree.html new file mode 100644 index 0000000..8a502a5 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/json/package-tree.html @@ -0,0 +1,169 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.parser.json Class Hierarchy + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Hierarchy For Package frc.robot.subsystems.swervedrive2.swervelib.parser.json

    +Package Hierarchies: + +
    +
    +
    +

    Class Hierarchy

    + +
    +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/package-summary.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/package-summary.html new file mode 100644 index 0000000..7302e43 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/package-summary.html @@ -0,0 +1,199 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.parser + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Package frc.robot.subsystems.swervedrive2.swervelib.parser

    +
    +
    + +
    +
    + + + diff --git a/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/package-tree.html b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/package-tree.html new file mode 100644 index 0000000..ef2d414 --- /dev/null +++ b/docs/frc/robot/subsystems/swervedrive2/swervelib/parser/package-tree.html @@ -0,0 +1,167 @@ + + + + + +frc.robot.subsystems.swervedrive2.swervelib.parser Class Hierarchy + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Hierarchy For Package frc.robot.subsystems.swervedrive2.swervelib.parser

    +Package Hierarchies: + +
    +
    +
    +

    Class Hierarchy

    + +
    +
    +
    + + + diff --git a/docs/help-doc.html b/docs/help-doc.html index 01fba0b..7697a18 100644 --- a/docs/help-doc.html +++ b/docs/help-doc.html @@ -2,20 +2,21 @@ - + API Help - + - + + - - + +
  • Overview
  • Package
  • Class
  • -
  • Use
  • Tree
  • Deprecated
  • Index
  • @@ -100,13 +100,13 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
  • Overview
  • Package
  • Class
  • -
  • Use
  • Tree
  • Deprecated
  • diff --git a/docs/index-files/index-21.html b/docs/index-files/index-21.html index 390afec..e961fff 100644 --- a/docs/index-files/index-21.html +++ b/docs/index-files/index-21.html @@ -2,20 +2,21 @@ - + W-Index - + - + + - - + +
  • Overview
  • Package
  • Class
  • -
  • Use
  • Tree
  • Deprecated
  • @@ -93,17 +93,33 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
    -
    A B C D E F G H I K L M N O P R S T U V W Z 
    All Classes All Packages +
    A B C D E F G H I K L M N O P R S T U V W X Y Z 
    All Classes All Packages

    W

    -
    wheelBase - Variable in class frc.robot.subsystems.swervedrive.swerve.SwerveModule
    +
    wheelDiameter - Variable in class frc.robot.subsystems.swervedrive2.swervelib.parser.json.PhysicalPropertiesJson
    -
    The Distance between front and back wheels of the robot in meters.
    +
    Wheel diameter in inches.
    +
    +
    wheelDiameter - Variable in class frc.robot.subsystems.swervedrive2.swervelib.parser.SwerveModulePhysicalCharacteristics
    +
    +
    Wheel diameter in meters.
    +
    +
    wheelGripCoefficientOfFriction - Variable in class frc.robot.subsystems.swervedrive2.swervelib.parser.json.PhysicalPropertiesJson
    +
    +
    The grip tape coefficient of friction on carpet.
    +
    +
    wheelGripCoefficientOfFriction - Variable in class frc.robot.subsystems.swervedrive2.swervelib.parser.SwerveModulePhysicalCharacteristics
    +
    +
    Wheel grip tape coefficient of friction on carpet, as described by the vendor.
    +
    +
    withinHypotDeadband(double, double) - Method in class frc.robot.subsystems.swervedrive2.swervelib.SwerveController
    +
    +
    Calculate the hypot deadband and check if the joystick is within it.
    -A B C D E F G H I K L M N O P R S T U V W Z 
    All Classes All Packages
    +A B C D E F G H I K L M N O P R S T U V W X Y Z 
    All Classes All Packages