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 pXSupplier, DoubleSupplier pYSupplier, DoubleSupplier pThetaSupplier, Supplier<edu.wpi.first.math.geometry.Rotation2d> pPOVSupplier) 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.CommandcharacterizeAzimuths(int pModNumber) edu.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.wpilibj2.command.CommandgetGameDriveCommand(GameDriveManager.GameDriveStates pGameDriveStates) edu.wpi.first.math.kinematics.SwerveModulePosition[]edu.wpi.first.math.kinematics.SwerveModuleState[]edu.wpi.first.math.geometry.Rotation2dedu.wpi.first.math.geometry.Pose2dedu.wpi.first.math.geometry.Pose2dedu.wpi.first.math.kinematics.ChassisSpeedsbooleanbooleanvoidperiodic()voidvoidvoidrunAngularCharacterization(double volts) voidrunLinearCharcterization(double volts) voidrunMOICharacterization(double amps) voidrunSwerve(edu.wpi.first.math.kinematics.ChassisSpeeds speeds) edu.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.Commandedu.wpi.first.wpilibj2.command.CommandsetToGenericAutoAlign(Supplier<edu.wpi.first.math.geometry.Pose2d> pGoalPoseSup, HolonomicController.ConstraintType pConstraintType) edu.wpi.first.wpilibj2.command.CommandsetToGenericHeadingAlign(Supplier<edu.wpi.first.math.geometry.Rotation2d> pGoalRotation) edu.wpi.first.wpilibj2.command.Commandedu.wpi.first.wpilibj2.command.Commandedu.wpi.first.wpilibj2.command.Commandedu.wpi.first.wpilibj2.command.Commandedu.wpi.first.wpilibj2.command.Commandedu.wpi.first.wpilibj2.command.Commandedu.wpi.first.wpilibj2.command.Commandedu.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, idle, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Field Details
-
mRobotConfig
public static com.pathplanner.lib.config.RobotConfig mRobotConfig
-
-
Constructor Details
-
Drive
-
-
Method Details
-
getGameDriveCommand
public edu.wpi.first.wpilibj2.command.Command getGameDriveCommand(GameDriveManager.GameDriveStates pGameDriveStates) -
periodic
public void periodic() -
setToTeleop
public edu.wpi.first.wpilibj2.command.Command setToTeleop() -
setToTeleopSniper
public edu.wpi.first.wpilibj2.command.Command setToTeleopSniper() -
setToPOVSniper
public edu.wpi.first.wpilibj2.command.Command setToPOVSniper() -
setToStop
public edu.wpi.first.wpilibj2.command.Command setToStop() -
setToDriftTest
public edu.wpi.first.wpilibj2.command.Command setToDriftTest() -
setToLinearTest
public edu.wpi.first.wpilibj2.command.Command setToLinearTest() -
setToSysIDCharacterization
public edu.wpi.first.wpilibj2.command.Command setToSysIDCharacterization() -
setToWheelCharacterization
public edu.wpi.first.wpilibj2.command.Command setToWheelCharacterization() -
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) -
setToGenericAutoAlign
public edu.wpi.first.wpilibj2.command.Command setToGenericAutoAlign(Supplier<edu.wpi.first.math.geometry.Pose2d> pGoalPoseSup, HolonomicController.ConstraintType pConstraintType) -
setToGenericHeadingAlign
public edu.wpi.first.wpilibj2.command.Command setToGenericHeadingAlign(Supplier<edu.wpi.first.math.geometry.Rotation2d> pGoalRotation) -
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) -
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() -
setDriveProfile
public edu.wpi.first.wpilibj2.command.Command setDriveProfile(ManualTeleopController.DriverProfiles profile) -
characterizeLinearMotion
public edu.wpi.first.wpilibj2.command.Command characterizeLinearMotion() -
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) -
characterizeAzimuths
public edu.wpi.first.wpilibj2.command.Command characterizeAzimuths(int pModNumber) -
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() -
getmRobotRotation
public edu.wpi.first.math.geometry.Rotation2d getmRobotRotation() -
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 pXSupplier, DoubleSupplier pYSupplier, DoubleSupplier pThetaSupplier, Supplier<edu.wpi.first.math.geometry.Rotation2d> pPOVSupplier) -
atGoal
public boolean atGoal() -
notAtGoal
public boolean notAtGoal() -
getDriveToPoseTolerance
public boolean getDriveToPoseTolerance() -
waitUnitllAutoAlignFinishes
public edu.wpi.first.wpilibj2.command.Command waitUnitllAutoAlignFinishes() -
waitUnitllAutoAlignFinishesSupplier
-