Package frclib.drivebase
Class FrcRobotDrive
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frclib.drivebase.FrcRobotDrive
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable,edu.wpi.first.wpilibj2.command.Subsystem
- Direct Known Subclasses:
FrcDifferentialDrive,FrcMecanumDrive,FrcSwerveDrive
public class FrcRobotDrive
extends edu.wpi.first.wpilibj2.command.SubsystemBase
This class is intended to be extended by subclasses implementing different robot drive bases.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classThis class contains the Common Robot Info.static classThis class contains Vision parameters of a camera. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal TrcMotor[]final TrcGyrostatic final intstatic final intstatic final intstatic final intstatic final intstatic final intfinal FrcRobotDrive.RobotInfo -
Constructor Summary
ConstructorsConstructorDescriptionFrcRobotDrive(FrcRobotDrive.RobotInfo robotInfo) Constructor: Create an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()This method cancels any drive operation still in progress.voidThis method cancels any drive operation still in progress.protected voidconfigDriveBase(TrcDriveBase driveBase) This method configures the rest of drive base after it has been created.doubleThis method returns the gyro pitch.doubleThis method returns the gyro roll.doubleThis method returns the gyro yaw.Methods 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, periodic, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Field Details
-
INDEX_LEFT_FRONT
public static final int INDEX_LEFT_FRONT- See Also:
-
INDEX_RIGHT_FRONT
public static final int INDEX_RIGHT_FRONT- See Also:
-
INDEX_LEFT_BACK
public static final int INDEX_LEFT_BACK- See Also:
-
INDEX_RIGHT_BACK
public static final int INDEX_RIGHT_BACK- See Also:
-
INDEX_LEFT_CENTER
public static final int INDEX_LEFT_CENTER- See Also:
-
INDEX_RIGHT_CENTER
public static final int INDEX_RIGHT_CENTER- See Also:
-
robotInfo
-
imu
-
driveMotors
-
driveBase
-
pidDrive
-
purePursuitDrive
-
-
Constructor Details
-
FrcRobotDrive
Constructor: Create an instance of the object.- Parameters:
robotInfo- specifies the Robot Info.
-
-
Method Details
-
cancel
This method cancels any drive operation still in progress.- Parameters:
owner- specifies the owner that requested the cancel.
-
cancel
public void cancel()This method cancels any drive operation still in progress. -
configDriveBase
This method configures the rest of drive base after it has been created.- Parameters:
driveBase- specifies the created drive base.
-
getGyroPitch
public double getGyroPitch()This method returns the gyro pitch.- Returns:
- gyro pitch.
-
getGyroRoll
public double getGyroRoll()This method returns the gyro roll.- Returns:
- gyro roll.
-
getGyroYaw
public double getGyroYaw()This method returns the gyro yaw.- Returns:
- gyro yaw.
-