Package frc8768.robot.subsystems
Class SwerveSubsystem
java.lang.Object
frc8768.robot.subsystems.SwerveSubsystem
Container class for everything Swerve
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDashboard loggingvoid
drive
(edu.wpi.first.math.geometry.Translation2d translation2d, double rotation, boolean fieldRelative, boolean isOpenLoop, edu.wpi.first.math.geometry.Translation2d pivotPoint) Drive the motorsedu.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 Angleedu.wpi.first.wpilibj2.command.Command
sysIdDynamicDrive
(edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction direction) Get the command for SysID Driveedu.wpi.first.wpilibj2.command.Command
sysIdQuasistaticAngle
(edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction direction) Get the command for SysID Angleedu.wpi.first.wpilibj2.command.Command
sysIdQuasistaticDrive
(edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Direction direction) Get the command for SysID Drive
-
Constructor Details
-
SwerveSubsystem
- Parameters:
type
- Neos or Falcons, seeMotorType
- Throws:
IOException
- if it can't find the resources.
-
-
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/SecondsfieldRelative
- Use the Gyro as the permanent "front" of the RobotisOpenLoop
- Don't use PIDpivotPoint
- 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
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
Log string, (Could use a buffer here to prevent data race)- Returns:
- List of different Strings.
-