Class 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
    • Nested Class Summary

      • Nested classes/interfaces inherited from class edu.wpi.first.wpilibj.drive.MecanumDrive

        edu.wpi.first.wpilibj.drive.MecanumDrive.WheelSpeeds
      • Nested classes/interfaces inherited from class edu.wpi.first.wpilibj.drive.RobotDriveBase

        edu.wpi.first.wpilibj.drive.RobotDriveBase.MotorType
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double lastInches  
      private double targetPosition  
      double wheelCircumference  
      double wheelDiameter  
      • Fields inherited from class edu.wpi.first.wpilibj.drive.RobotDriveBase

        kDefaultDeadband, kDefaultMaxOutput, m_deadband, m_maxOutput
    • 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
      void Drive​(double inches, double speed)  
      void Drive​(double x, double y, double z)
      Classic Mecanum Drive
      void RelativeDrive​(double x, double y, double z, double gyro)
      Mecanum Drive using a Gyro for Relative Driving
      void TankDrive​(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
      • Methods inherited from class edu.wpi.first.wpilibj.MotorSafety

        check, checkMotors, feed, getExpiration, isAlive, isSafetyEnabled, setExpiration, setSafetyEnabled
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • wheelDiameter

        public double wheelDiameter
      • wheelCircumference

        public double wheelCircumference
      • lastInches

        private double lastInches
      • targetPosition

        private double targetPosition
    • 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 affector
        y - the forward/backward affector
        z - 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 affector
        y - the forward/backward affector
        z - the rotation affector
        gyro - 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 to
        right - what to set the right side to