Package org.hyperonline.hyperlib.driving
Interface DriveParameters
-
- All Known Implementing Classes:
ArcadeDriveParams
,TankDriveParams
public interface DriveParameters
TheDriveParameters
interface allows one to use polymorphism to represent the various drive modes of the robot, such as tank drive, arcade drive, meccanum drive (Cartesian or polar), swerve drive, etc. A single instance ofDriveParameters
should contain a specific set of values for one of those modes. Using this interface, one can drive the robot by continuously supplying the drive train withDriveParameters
objects. One can also create new drive modes and switch between modes without having to modify the drivetrain subsystem, or write separate commands for each mode. See the hypercode2016 userDrive class for a good example of this.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
drive(edu.wpi.first.wpilibj.drive.DifferentialDrive driveTrain, double currentGyro)
Drive the robot.
-
-
-
Method Detail
-
drive
void drive(edu.wpi.first.wpilibj.drive.DifferentialDrive driveTrain, double currentGyro)
Drive the robot. This method should not call any "stateful" methods of the drivetrain (anything that starts with "set") to allow one to switch between modes easily. TODO: pass a wrapper of DifferentialDrive, which only allows certain methods TODO: remove currentGyro. This is pretty irrelevant, and can be obtained in other ways.- Parameters:
driveTrain
- ADifferentialDrive
object representing the drivetrain of the robot.currentGyro
- The current gyro heading, if a gyro exists. Nothing should use this right now, so just pass in 0.0 if you're not sure.
-
-