Package com.crossbotics.ftchelper.robot
Class Arm
- All Implemented Interfaces:
Subsystem
An arm that swings on one motor, with named angles in degrees.
arm = add(Arm.motor("arm", "gobilda-5203-117").gearRatio(2)); // Robot.java: 2 motor turns per arm turn
public static class Arm { // Tunables.java (degrees)
public static double min = 0, max = 180; // the safe range
public static double kP = 0.02, kI = 0, kD = 0.001, kF = 0.0;
public static double stowed = 0, score = 110; // named angles
}
0 degrees is where the arm is when the program starts (the encoder counts from there). Start
every match with the arm resting on the same stop, and measure the angles from it (so min
is usually 0). Suggested button: operator right stick Y moves it by hand.
Docs: docs/modules/robot.md (section "Arm")
-
Method Summary
Modifier and TypeMethodDescriptionbottomSwitch(String switchName) A touch sensor at theminend: pressing it sets the angle to 0.gearRatio(double motorTurnsPerArmTurn) Motor turns per arm turn (gears, sprockets or a belt).static ArmAn arm on this motor.Methods inherited from class com.crossbotics.ftchelper.robot.MotorPositions
addTelemetry, goTo, hold, isAt, isAtTarget, manual, part, position, positions, reversed, stepDown, stepUp, stop, update
-
Method Details
-
motor
An arm on this motor.- Parameters:
motor- the motor's configuration namemotorId- the motor's parts-catalog id (seeMotors), e.g. "gobilda-5203-117"
-
gearRatio
Motor turns per arm turn (gears, sprockets or a belt). Default 1. -
bottomSwitch
A touch sensor at theminend: pressing it sets the angle to 0.
-