Package frc.robot.systems.drive
Class Drive
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.systems.drive.Drive
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable,edu.wpi.first.wpilibj2.command.Subsystem
public class Drive
extends edu.wpi.first.wpilibj2.command.SubsystemBase
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptJoystickInputs(DoubleSupplier xSupplier, DoubleSupplier ySupplier, DoubleSupplier thetaSupplier, DoubleSupplier povSupplierDegrees) booleanatGoal()doublecalculateDriveFeedforward(SwerveSetpoint setpoint, edu.wpi.first.math.kinematics.SwerveModuleState currentState, edu.wpi.first.math.kinematics.SwerveModuleState unoptimizedState, edu.wpi.first.math.kinematics.SwerveModuleState optimizedState, int i) edu.wpi.first.wpilibj2.command.Commandedu.wpi.first.wpilibj2.command.Commandedu.wpi.first.wpilibj2.command.CommandcustomFollowPathComamnd(com.pathplanner.lib.path.PathPlannerPath path) edu.wpi.first.wpilibj2.command.CommandcustomFollowPathComamnd(com.pathplanner.lib.path.PathPlannerPath path, com.pathplanner.lib.controllers.PPHolonomicDriveController drivePID) doubleedu.wpi.first.math.kinematics.ChassisSpeedsbooleanedu.wpi.first.math.kinematics.SwerveModulePosition[]edu.wpi.first.math.kinematics.SwerveModuleState[]edu.wpi.first.math.geometry.Pose2dedu.wpi.first.math.geometry.Pose2dedu.wpi.first.math.kinematics.ChassisSpeedsedu.wpi.first.math.geometry.Rotation2dbooleanbooleanvoidperiodic()voidvoidvoidrunAngularCharacterization(double volts) voidrunLinearCharcterization(double volts) voidrunMOICharacterization(double amps) voidrunSwerve(edu.wpi.first.math.kinematics.ChassisSpeeds speeds) edu.wpi.first.wpilibj2.command.CommandvoidsetDriveState(Drive.DriveState state) edu.wpi.first.wpilibj2.command.Commandedu.wpi.first.wpilibj2.command.CommandvoidsetForwardAmperagesForAllModules(double amps) voidsetPose(edu.wpi.first.math.geometry.Pose2d pose) voidsetPoses(edu.wpi.first.math.geometry.Pose2d estimatorPose, edu.wpi.first.math.geometry.Pose2d odometryPose) edu.wpi.first.wpilibj2.command.CommandMethods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Field Details
-
robotConfig
public static com.pathplanner.lib.config.RobotConfig robotConfig
-
-
Constructor Details
-
Drive
-
-
Method Details
-
customFollowPathComamnd
public edu.wpi.first.wpilibj2.command.Command customFollowPathComamnd(com.pathplanner.lib.path.PathPlannerPath path) -
customFollowPathComamnd
public edu.wpi.first.wpilibj2.command.Command customFollowPathComamnd(com.pathplanner.lib.path.PathPlannerPath path, com.pathplanner.lib.controllers.PPHolonomicDriveController drivePID) -
periodic
public void periodic() -
setDriveStateCommand
-
setDriveStateCommandContinued
-
setDriveState
-
runSwerve
public void runSwerve(edu.wpi.first.math.kinematics.ChassisSpeeds speeds) -
calculateDriveFeedforward
public double calculateDriveFeedforward(SwerveSetpoint setpoint, edu.wpi.first.math.kinematics.SwerveModuleState currentState, edu.wpi.first.math.kinematics.SwerveModuleState unoptimizedState, edu.wpi.first.math.kinematics.SwerveModuleState optimizedState, int i) -
setDriveProfile
public edu.wpi.first.wpilibj2.command.Command setDriveProfile(ManualTeleopController.DriverProfiles profile) -
resetGyro
public void resetGyro() -
setPose
public void setPose(edu.wpi.first.math.geometry.Pose2d pose) -
setPoses
public void setPoses(edu.wpi.first.math.geometry.Pose2d estimatorPose, edu.wpi.first.math.geometry.Pose2d odometryPose) -
resetModulesEncoders
public void resetModulesEncoders() -
characterizeLinearMotion
public edu.wpi.first.wpilibj2.command.Command characterizeLinearMotion() -
waitUnitllAutoAlignFinishes
public edu.wpi.first.wpilibj2.command.Command waitUnitllAutoAlignFinishes() -
waitUnitllAutoAlignFinishesSupplier
-
runLinearCharcterization
public void runLinearCharcterization(double volts) -
setForwardAmperagesForAllModules
public void setForwardAmperagesForAllModules(double amps) -
characterizeAngularMotion
public edu.wpi.first.wpilibj2.command.Command characterizeAngularMotion() -
runAngularCharacterization
public void runAngularCharacterization(double volts) -
runMOICharacterization
public void runMOICharacterization(double amps) -
getModuleStates
public edu.wpi.first.math.kinematics.SwerveModuleState[] getModuleStates() -
getModulePositions
public edu.wpi.first.math.kinematics.SwerveModulePosition[] getModulePositions() -
getPoseEstimate
public edu.wpi.first.math.geometry.Pose2d getPoseEstimate() -
getOdometryPose
public edu.wpi.first.math.geometry.Pose2d getOdometryPose() -
getRobotRotation
public edu.wpi.first.math.geometry.Rotation2d getRobotRotation() -
getRobotChassisSpeeds
public edu.wpi.first.math.kinematics.ChassisSpeeds getRobotChassisSpeeds() -
getDesiredChassisSpeeds
public edu.wpi.first.math.kinematics.ChassisSpeeds getDesiredChassisSpeeds() -
inHeadingTolerance
public boolean inHeadingTolerance() -
distanceFromReefCenter
public double distanceFromReefCenter() -
acceptJoystickInputs
public void acceptJoystickInputs(DoubleSupplier xSupplier, DoubleSupplier ySupplier, DoubleSupplier thetaSupplier, DoubleSupplier povSupplierDegrees) -
atGoal
public boolean atGoal() -
notAtGoal
public boolean notAtGoal() -
getDriveToPoseTolerance
public boolean getDriveToPoseTolerance()
-