Added Hoverstate
This commit is contained in:
@ -80,6 +80,8 @@ public class DevTeleop extends OpMode {
|
||||
arm.engageArm();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
public void thePickup(ClawSubsystem claw) {
|
||||
//claw open close
|
||||
@ -124,6 +126,17 @@ public class DevTeleop extends OpMode {
|
||||
wrist.floorWrist();
|
||||
}
|
||||
}
|
||||
|
||||
public void hoverState(ArmSubsystem arm, WristSubsystem wrist, LiftSubsystem lift){
|
||||
if (currentGamepad1.dpad_left && !previousGamepad2.dpad_left){
|
||||
lift.toHover();
|
||||
wrist.floorWrist();
|
||||
arm.engageArm();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loop() {
|
||||
previousGamepad1.copy(currentGamepad1);
|
||||
|
@ -5,7 +5,7 @@ import com.acmerobotics.dashboard.config.Config;
|
||||
@Config
|
||||
public class RobotConstants {
|
||||
public static double clawClose = 1.00;
|
||||
public static double clawOpen = 0.25;
|
||||
public static double clawOpen = 0.05;
|
||||
|
||||
public static double armEngage = 0.5;
|
||||
public static double armPark = 0.125;
|
||||
@ -18,4 +18,5 @@ public class RobotConstants {
|
||||
public static int liftToLowBucketPos = 2250;
|
||||
public static int liftToHighBucketPos = 3850;
|
||||
public static double liftPower = .45;
|
||||
public static int liftToHoverState = 60;
|
||||
}
|
@ -5,6 +5,7 @@ import static org.firstinspires.ftc.teamcode.configs.RobotConstants.liftToFloatP
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.liftToFloorPos;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.liftToHighBucketPos;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.liftToLowBucketPos;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.liftToHoverState;
|
||||
|
||||
import com.qualcomm.robotcore.hardware.DcMotor;
|
||||
import com.qualcomm.robotcore.hardware.DcMotorSimple;
|
||||
@ -18,7 +19,7 @@ public class LiftSubsystem {
|
||||
public RunAction toFloor, toLowBucket, toHighBucket;
|
||||
|
||||
public enum LiftState {
|
||||
FLOOR, LOW_BUCKET, HIGH_BUCKET, FLOAT
|
||||
FLOOR, LOW_BUCKET, HIGH_BUCKET, FLOAT, HOVER
|
||||
}
|
||||
|
||||
private LiftState liftState;
|
||||
@ -47,6 +48,11 @@ public class LiftSubsystem {
|
||||
}
|
||||
}
|
||||
|
||||
public void toHover() {
|
||||
this.setTarget(liftToHoverState);
|
||||
this.setState(LiftState.HOVER);
|
||||
}
|
||||
|
||||
public void toFloor() {
|
||||
this.setTarget(liftToFloorPos);
|
||||
this.setState(LiftState.FLOOR);
|
||||
|
Reference in New Issue
Block a user