Class SwerveSubsystem

java.lang.Object
frc8768.robot.subsystems.SwerveSubsystem

public class SwerveSubsystem extends Object
Container class for everything Swerve
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Dashboard logging
    void
    drive(edu.wpi.first.math.geometry.Translation2d translation2d, double rotation, boolean fieldRelative, boolean isOpenLoop, edu.wpi.first.math.geometry.Translation2d pivotPoint)
    Drive the motors
    edu.wpi.first.math.geometry.Rotation3d
    Get the Gyro rotation in degrees.
    swervelib.SwerveDrive
    Get the underlying instance.
    log()
    Log string, (Could use a buffer here to prevent data race)
    edu.wpi.first.wpilibj2.command.Command
    sysIdDynamicAngle(edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction direction)
    Get the command for SysID Angle
    edu.wpi.first.wpilibj2.command.Command
    sysIdDynamicDrive(edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction direction)
    Get the command for SysID Drive
    edu.wpi.first.wpilibj2.command.Command
    sysIdQuasistaticAngle(edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction direction)
    Get the command for SysID Angle
    edu.wpi.first.wpilibj2.command.Command
    sysIdQuasistaticDrive(edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction direction)
    Get the command for SysID Drive

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • drive

      public void drive(edu.wpi.first.math.geometry.Translation2d translation2d, double rotation, boolean fieldRelative, boolean isOpenLoop, edu.wpi.first.math.geometry.Translation2d pivotPoint)
      Drive the motors
      Parameters:
      translation2d - X = Forward and back, Y = left and right.
      rotation - Rotation in Radians/Seconds
      fieldRelative - Use the Gyro as the permanent "front" of the Robot
      isOpenLoop - Don't use PID
      pivotPoint - 2d Pivot point for rotation
    • getGyroRot

      public edu.wpi.first.math.geometry.Rotation3d getGyroRot()
      Get the Gyro rotation in degrees.
      Returns:
      3d rotation.
    • getSwerveDrive

      public swervelib.SwerveDrive getSwerveDrive()
      Get the underlying instance.
      Returns:
      Underlying instance
    • dashboard

      public Map<String,Object> dashboard()
      Dashboard logging
      Returns:
      Map of Name to Value
    • sysIdQuasistaticDrive

      public edu.wpi.first.wpilibj2.command.Command sysIdQuasistaticDrive(edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction direction)
      Get the command for SysID Drive
      Returns:
      The associated command
    • sysIdQuasistaticAngle

      public edu.wpi.first.wpilibj2.command.Command sysIdQuasistaticAngle(edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction direction)
      Get the command for SysID Angle
      Returns:
      The associated command
    • sysIdDynamicDrive

      public edu.wpi.first.wpilibj2.command.Command sysIdDynamicDrive(edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction direction)
      Get the command for SysID Drive
      Returns:
      The associated command
    • sysIdDynamicAngle

      public edu.wpi.first.wpilibj2.command.Command sysIdDynamicAngle(edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction direction)
      Get the command for SysID Angle
      Returns:
      The associated command
    • log

      public List<String> log()
      Log string, (Could use a buffer here to prevent data race)
      Returns:
      List of different Strings.