Class DoubleArmImpl
java.lang.Object
org.firstinspires.ftc.teamcode.fy23.robot.subsystems.normalimpl.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.fy23.robot.subsystems.DoubleArm
DoubleArm.Parameters
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the current average position of the elevator motors.double
Get the current average power of the elevator motors.double
Get the current average velocity of the elevator motors.int
Get the current average position of the pivot motors.double
Get the current average power of the pivot motors.double
Get the current average velocity of the pivot motors.void
setElevatorDistance
(double distance) Set the target position of the elevator motors to a distance from the back of the robot.void
setElevatorLowerLimit
(int i) void
setElevatorPower
(double power) Set the power of the elevator motors.void
setElevatorUpperLimit
(int i) void
setElevatorVelocity
(int velocity) Set the velocity of the elevator motors in ticks per second.void
setPivotAngle
(org.firstinspires.ftc.robotcore.external.navigation.AngleUnit unit, double angle) Set the target position of the pivot motors to an angle.void
setPivotPower
(double power) Set the power of the pivot motors.void
setPivotVelocity
(int velocity) Set the velocity of the pivot motors in ticks per second.void
update()
Called by robot.update().
-
Constructor Details
-
DoubleArmImpl
-
-
Method Details
-
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 interfaceDoubleArm
- 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 interfaceDoubleArm
-
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 interfaceDoubleArm
- 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 interfaceDoubleArm
-
getPivotPosition
public int getPivotPosition()Description copied from interface:DoubleArm
Get the current average position of the pivot motors.- Specified by:
getPivotPosition
in interfaceDoubleArm
-
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 interfaceDoubleArm
- 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 interfaceDoubleArm
- 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 interfaceDoubleArm
-
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 interfaceDoubleArm
- 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 interfaceDoubleArm
-
getElevatorPosition
public int getElevatorPosition()Description copied from interface:DoubleArm
Get the current average position of the elevator motors.- Specified by:
getElevatorPosition
in interfaceDoubleArm
-
update
public void update()Description copied from interface:DoubleArm
Called by robot.update(). You do not need to call this method. -
setElevatorUpperLimit
public void setElevatorUpperLimit(int i) -
setElevatorLowerLimit
public void setElevatorLowerLimit(int i)