Class Drive

java.lang.Object
org.edu_nation.easy_ftc.mechanism.Drive

public class Drive extends Object
Implements a drivetrain by extending the functionality of MotorMechanism
See Also:
  • Method Details

    • control

      public void control(double multiplier)
      Enable teleoperated drivetrain movement with gamepad (joysticks), scaling by multiplier
      Parameters:
      multiplier - fraction of total power/velocity to use for mechanism control at given input value
      Throws:
      IllegalArgumentException - if multiplier is not in the interval (0, 1]
    • control

      public void control()
      Enable teleoperated drivetrain movement with gamepad (joysticks), with multiplier = 1.0
    • command

      public void command(Drive.Direction direction, double measurement, double power)
      Initiate an automated drivetrain movement
      Parameters:
      direction - direction to move the mechanism; see Drive.Direction for accepted values
      measurement - time(s) or distance to move the mechanism
      power - fraction of total power/velocity to use for mechanism command
      Throws:
      NullPointerException - if direction is null
      IllegalArgumentException - if direction is an unexpected value
      IllegalArgumentException - if measurement < 0
      IllegalArgumentException - if power is not in the interval (0, 1]
    • command

      public void command(Drive.Direction direction, double measurement, double power, org.firstinspires.ftc.robotcore.external.navigation.AngleUnit unit)
      Initiate an automated drivetrain turn using the IMU's gyro
      Parameters:
      direction - direction to move the mechanism; see Drive.Direction for accepted values (one of: ROTATE_LEFT, ROTATE_RIGHT)
      measurement - angle to rotate
      power - fraction of total power/velocity to use for mechanism command
      unit - AngleUnit to use for the measurement (one of: DEGREES, RADIANS)
      Throws:
      NullPointerException - if direction is null
      NullPointerException - if unit is null
      IllegalArgumentException - if direction is an unexpected value
      IllegalArgumentException - if measurement < 0
      IllegalArgumentException - if power is not in the interval (0, 1]