Class DoubleArmImpl
java.lang.Object
org.firstinspires.ftc.teamcode.fy24.subsystems.doublearm.DoubleArmImpl
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.firstinspires.ftc.teamcode.fy24.subsystems.doublearm.DoubleArm
DoubleArm.Parameters -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the current average position of the elevator motors.doubleGet the current average power of the elevator motors.doubleGet the current average velocity of the elevator motors.intGet the current average position of the pivot motors.doubleGet the current average power of the pivot motors.doubleGet the current average velocity of the pivot motors.voidsetElevatorDistance(double distance) Set the target position of the elevator motors to a distance from the back of the robot.voidsetElevatorLowerLimit(int i) Set a new upper limit for the elevator, in inches.voidsetElevatorPower(double power) Set the power of the elevator motors.voidsetElevatorUpperLimit(int i) Set a new lower limit for the elevator, in inches.voidsetElevatorVelocity(int velocity) Set the velocity of the elevator motors in ticks per second.voidsetPivotAngle(org.firstinspires.ftc.robotcore.external.navigation.AngleUnit unit, double angle) Set the target position of the pivot motors to an angle.voidsetPivotPower(double power) Set the power of the pivot motors.voidsetPivotVelocity(int velocity) Set the velocity of the pivot motors in ticks per second.voidupdate()Called by robot.update().
-
Constructor Details
-
DoubleArmImpl
-
-
Method Details
-
setPivotPower
public void setPivotPower(double power) Description copied from interface:DoubleArmSet 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:
setPivotPowerin interfaceDoubleArm- Parameters:
power- from -1 to 1 just like setPower() on a normal motor
-
getPivotPower
public double getPivotPower()Description copied from interface:DoubleArmGet the current average power of the pivot motors.- Specified by:
getPivotPowerin interfaceDoubleArm
-
setPivotVelocity
public void setPivotVelocity(int velocity) Description copied from interface:DoubleArmSet the velocity of the pivot motors in ticks per second.- Specified by:
setPivotVelocityin interfaceDoubleArm- Parameters:
velocity- The velocity to set, in ticks per second
-
getPivotVelocity
public double getPivotVelocity()Description copied from interface:DoubleArmGet the current average velocity of the pivot motors.- Specified by:
getPivotVelocityin interfaceDoubleArm
-
getPivotPosition
public int getPivotPosition()Description copied from interface:DoubleArmGet the current average position of the pivot motors.- Specified by:
getPivotPositionin interfaceDoubleArm
-
setElevatorDistance
public void setElevatorDistance(double distance) Description copied from interface:DoubleArmSet the target position of the elevator motors to a distance from the back of the robot.- Specified by:
setElevatorDistancein interfaceDoubleArm- Parameters:
distance- in inches
-
setElevatorPower
public void setElevatorPower(double power) Description copied from interface:DoubleArmSet 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:
setElevatorPowerin interfaceDoubleArm- Parameters:
power- from -1 to 1, just like setPower() on a normal motor
-
getElevatorPower
public double getElevatorPower()Description copied from interface:DoubleArmGet the current average power of the elevator motors. This does not actually set power anymore - this sets the velocity to the max. velocity multiplied by your requested power.- Specified by:
getElevatorPowerin interfaceDoubleArm
-
setElevatorVelocity
public void setElevatorVelocity(int velocity) Description copied from interface:DoubleArmSet the velocity of the elevator motors in ticks per second.- Specified by:
setElevatorVelocityin interfaceDoubleArm- Parameters:
velocity- The velocity to set, in ticks per second
-
getElevatorVelocity
public double getElevatorVelocity()Description copied from interface:DoubleArmGet the current average velocity of the elevator motors.- Specified by:
getElevatorVelocityin interfaceDoubleArm
-
getElevatorPosition
public int getElevatorPosition()Description copied from interface:DoubleArmGet the current average position of the elevator motors.- Specified by:
getElevatorPositionin interfaceDoubleArm
-
update
public void update()Called by robot.update(). You do not need to call this method. -
setElevatorUpperLimit
public void setElevatorUpperLimit(int i) Set a new lower limit for the elevator, in inches. The new lower limit, in inches. -
setElevatorLowerLimit
public void setElevatorLowerLimit(int i) Set a new upper limit for the elevator, in inches. The new upper limit, in inches.