Package frc.robot.hardware
Class RobotHardware.MecanumDrivetrain
- java.lang.Object
-
- edu.wpi.first.wpilibj.MotorSafety
-
- edu.wpi.first.wpilibj.drive.RobotDriveBase
-
- edu.wpi.first.wpilibj.drive.MecanumDrive
-
- frc.robot.hardware.RobotHardware.MecanumDrivetrain
-
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable,java.lang.AutoCloseable
- Enclosing class:
- RobotHardware
public class RobotHardware.MecanumDrivetrain extends edu.wpi.first.wpilibj.drive.MecanumDrive
-
-
Field Summary
Fields Modifier and Type Field Description private doublelastInchesprivate doubletargetPositiondoublewheelCircumferencedoublewheelDiameter
-
Constructor Summary
Constructors Constructor Description MecanumDrivetrain(edu.wpi.first.wpilibj.motorcontrol.MotorController frontLeftMotor, edu.wpi.first.wpilibj.motorcontrol.MotorController rearLeftMotor, edu.wpi.first.wpilibj.motorcontrol.MotorController frontRightMotor, edu.wpi.first.wpilibj.motorcontrol.MotorController rearRightMotor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidDrive(double inches, double speed)voidDrive(double x, double y, double z)Classic Mecanum DrivevoidRelativeDrive(double x, double y, double z, double gyro)Mecanum Drive using a Gyro for Relative DrivingvoidTankDrive(double left, double right)Tank Drive requireing a left and right input-
Methods inherited from class edu.wpi.first.wpilibj.drive.MecanumDrive
close, driveCartesian, driveCartesian, driveCartesianIK, driveCartesianIK, drivePolar, getDescription, initSendable, stopMotor
-
Methods inherited from class edu.wpi.first.wpilibj.drive.RobotDriveBase
applyDeadband, feedWatchdog, normalize, setDeadband, setMaxOutput
-
-
-
-
Constructor Detail
-
MecanumDrivetrain
public MecanumDrivetrain(edu.wpi.first.wpilibj.motorcontrol.MotorController frontLeftMotor, edu.wpi.first.wpilibj.motorcontrol.MotorController rearLeftMotor, edu.wpi.first.wpilibj.motorcontrol.MotorController frontRightMotor, edu.wpi.first.wpilibj.motorcontrol.MotorController rearRightMotor)
-
-
Method Detail
-
Drive
public void Drive(double inches, double speed)
-
Drive
public void Drive(double x, double y, double z)Classic Mecanum Drive- Parameters:
x- the left/right affectory- the forward/backward affectorz- the rotation affector
-
RelativeDrive
public void RelativeDrive(double x, double y, double z, double gyro)Mecanum Drive using a Gyro for Relative Driving- Parameters:
x- the left/right affectory- the forward/backward affectorz- the rotation affectorgyro- the gyro
-
TankDrive
public void TankDrive(double left, double right)Tank Drive requireing a left and right input- Parameters:
left- what to set the left side toright- what to set the right side to
-
-