java.lang.Object
org.firstinspires.ftc.teamcode.fy23.robot.subsystems.normalimpl.DoubleArmImpl
All Implemented Interfaces:
DoubleArm

public class DoubleArmImpl extends Object implements DoubleArm
A normal implementation of DoubleArm featuring acceleration control and hard and soft safety limits. Note that this now uses velocity, not power, under the hood, so motor behavior may be just a bit different (and hopefully better) than what you're used to. A bug currently exists in either this or AccelLimiter such that maxAccel seems to be divided by 10. Workaround: If your max. velocity should be 800 t/s, set 8000 t/s in the AccelLimiters.
  • Constructor Details

  • Method Details

    • setPivotAngle

      public void setPivotAngle(org.firstinspires.ftc.robotcore.external.navigation.AngleUnit unit, double angle)
      Description copied from interface: DoubleArm
      Set the target position of the pivot motors to an angle. Safety limits apply.
      Specified by:
      setPivotAngle in interface DoubleArm
      Parameters:
      unit - See AngleUnit.
      angle - in the AngleUnit you set
    • setPivotPower

      public void setPivotPower(double power)
      Description copied from interface: DoubleArm
      Set the power of the pivot motors. Important when setting an angle - this works like setPower() does on a normal motor in RUN_TO_POSITION mode. This does not actually set power anymore - this sets the velocity to the max. velocity multiplied by your requested power.
      Specified by:
      setPivotPower in interface DoubleArm
      Parameters:
      power - from -1 to 1 just like setPower() on a normal motor
    • getPivotPower

      public double getPivotPower()
      Description copied from interface: DoubleArm
      Get the current average power of the pivot motors.
      Specified by:
      getPivotPower in interface DoubleArm
    • setPivotVelocity

      public void setPivotVelocity(int velocity)
      Description copied from interface: DoubleArm
      Set the velocity of the pivot motors in ticks per second.
      Specified by:
      setPivotVelocity in interface DoubleArm
      Parameters:
      velocity - The velocity to set, in ticks per second
    • getPivotVelocity

      public double getPivotVelocity()
      Description copied from interface: DoubleArm
      Get the current average velocity of the pivot motors.
      Specified by:
      getPivotVelocity in interface DoubleArm
    • getPivotPosition

      public int getPivotPosition()
      Description copied from interface: DoubleArm
      Get the current average position of the pivot motors.
      Specified by:
      getPivotPosition in interface DoubleArm
    • setElevatorDistance

      public void setElevatorDistance(double distance)
      Description copied from interface: DoubleArm
      Set the target position of the elevator motors to a distance from the back of the robot.
      Specified by:
      setElevatorDistance in interface DoubleArm
      Parameters:
      distance - in inches
    • setElevatorPower

      public void setElevatorPower(double power)
      Description copied from interface: DoubleArm
      Set the power of the elevator motors. Important when setting a distance - this works like setPower() does on a normal motor in RUN_TO_POSITION mode.
      Specified by:
      setElevatorPower in interface DoubleArm
      Parameters:
      power - from -1 to 1, just like setPower() on a normal motor
    • getElevatorPower

      public double getElevatorPower()
      Description copied from interface: DoubleArm
      Get the current average power of the elevator motors.
      Specified by:
      getElevatorPower in interface DoubleArm
    • setElevatorVelocity

      public void setElevatorVelocity(int velocity)
      Description copied from interface: DoubleArm
      Set the velocity of the elevator motors in ticks per second.
      Specified by:
      setElevatorVelocity in interface DoubleArm
      Parameters:
      velocity - The velocity to set, in ticks per second
    • getElevatorVelocity

      public double getElevatorVelocity()
      Description copied from interface: DoubleArm
      Get the current average velocity of the elevator motors.
      Specified by:
      getElevatorVelocity in interface DoubleArm
    • getElevatorPosition

      public int getElevatorPosition()
      Description copied from interface: DoubleArm
      Get the current average position of the elevator motors.
      Specified by:
      getElevatorPosition in interface DoubleArm
    • update

      public void update()
      Description copied from interface: DoubleArm
      Called by robot.update(). You do not need to call this method.
      Specified by:
      update in interface DoubleArm
    • setElevatorUpperLimit

      public void setElevatorUpperLimit(int i)
    • setElevatorLowerLimit

      public void setElevatorLowerLimit(int i)