Class OpenLoopTankDriveTrain
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.SubsystemBase
-
- io.github.frc5024.lib5k.bases.drivetrain.AbstractDriveTrain
-
- io.github.frc5024.lib5k.bases.drivetrain.implementations.TankDriveTrain
-
- io.github.frc5024.lib5k.bases.drivetrain.implementations.OpenLoopTankDriveTrain
-
- All Implemented Interfaces:
Sendable
,Subsystem
,IDifferentialDrivebase
,SafeSystem
,java.lang.AutoCloseable
public abstract class OpenLoopTankDriveTrain extends TankDriveTrain
OpenLoopTankDriveTrain is a TankDriveTrain implementation that can only be controlled manually. No autonomous control is available
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.github.frc5024.lib5k.bases.drivetrain.AbstractDriveTrain
AbstractDriveTrain.State
-
-
Field Summary
-
Fields inherited from class io.github.frc5024.lib5k.bases.drivetrain.implementations.TankDriveTrain
maxSpeedPercent
-
Fields inherited from class io.github.frc5024.lib5k.bases.drivetrain.AbstractDriveTrain
logger, stateMachine
-
-
Constructor Summary
Constructors Constructor Description OpenLoopTankDriveTrain()
Create a OpenLoopTankDriveTrain
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
handleAutonomousRotation(StateMetadata<AbstractDriveTrain.State> meta, Rotation2d goalHeading, Rotation2d epsilon)
State handler for autonomous rotation controlprotected void
handleDrivingToPose(StateMetadata<AbstractDriveTrain.State> meta, Translation2d goalPose, Translation2d epsilon)
State handler for driving to a new pose autonomouslyvoid
setGoalHeading(Rotation2d heading, Rotation2d epsilon)
Set a field-relative heading for the robot to face, and immediately start facing it.void
setGoalPose(Pose2d pose, Translation2d epsilon)
Set a goal pose for the robot to be at, and immediately start driving to it.void
setGoalPose(Translation2d pose, Translation2d epsilon)
Set a goal pose for the robot to be at, and immediately start driving to it.-
Methods inherited from class io.github.frc5024.lib5k.bases.drivetrain.implementations.TankDriveTrain
calculateThrottleCorrectionFactor, enableConstantCurvature, getFrontSide, getPose, getVelocity, handleDriverInputs, handleOpenLoopControl, handleVoltage, periodic, reset, resetEncoders, resetPose, setEncodersInverted, setFrontSide, setMaxSpeedPercent, setMotorsInverted, setOpenLoop, setOpenLoop, stop
-
Methods inherited from class io.github.frc5024.lib5k.bases.drivetrain.AbstractDriveTrain
close, createPathingCommand, createTurnCommand, enableBrakes, getCurrentHeading, getCurrentState, getSpeed, handleGearShift, isAtGoal, runIteration, setRampRate
-
Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystem
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.frc5024.lib5k.hardware.common.drivebase.IDifferentialDrivebase
getLeftMeters, getRightMeters, getWidthMeters
-
Methods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
getCurrentCommand, getDefaultCommand, register, setDefaultCommand, simulationPeriodic
-
-
-
-
Method Detail
-
handleAutonomousRotation
protected void handleAutonomousRotation(StateMetadata<AbstractDriveTrain.State> meta, Rotation2d goalHeading, Rotation2d epsilon)
Description copied from class:AbstractDriveTrain
State handler for autonomous rotation control- Specified by:
handleAutonomousRotation
in classAbstractDriveTrain
- Parameters:
meta
- State metadatagoalHeading
- Goal headingepsilon
- Rotation epsilon
-
handleDrivingToPose
protected void handleDrivingToPose(StateMetadata<AbstractDriveTrain.State> meta, Translation2d goalPose, Translation2d epsilon)
Description copied from class:AbstractDriveTrain
State handler for driving to a new pose autonomously- Specified by:
handleDrivingToPose
in classAbstractDriveTrain
- Parameters:
meta
- State metadatagoalPose
- Goal poseepsilon
- Epsilon around the goal pose in meters
-
setGoalHeading
public void setGoalHeading(Rotation2d heading, Rotation2d epsilon)
Description copied from class:AbstractDriveTrain
Set a field-relative heading for the robot to face, and immediately start facing it.- Overrides:
setGoalHeading
in classAbstractDriveTrain
- Parameters:
heading
- Field-relative heading goalepsilon
- Heading epsilon
-
setGoalPose
public void setGoalPose(Pose2d pose, Translation2d epsilon)
Description copied from class:AbstractDriveTrain
Set a goal pose for the robot to be at, and immediately start driving to it.- Overrides:
setGoalPose
in classAbstractDriveTrain
- Parameters:
pose
- Field-relative poseepsilon
- Pose epsilon in meters
-
setGoalPose
public void setGoalPose(Translation2d pose, Translation2d epsilon)
Description copied from class:AbstractDriveTrain
Set a goal pose for the robot to be at, and immediately start driving to it.- Overrides:
setGoalPose
in classAbstractDriveTrain
- Parameters:
pose
- Field-relative poseepsilon
- Pose epsilon in meters
-
-