Changing arm controls to be more intuitive
This commit is contained in:
@ -45,7 +45,7 @@ public class DevTeleop extends OpMode {
|
|||||||
public DcMotor frontRightMotor;
|
public DcMotor frontRightMotor;
|
||||||
public DcMotor backRightMotor;
|
public DcMotor backRightMotor;
|
||||||
|
|
||||||
private double MAX_POWER = .6;
|
private double MAX_POWER = .45;
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
claw = new ClawSubsystem(hardwareMap, ClawSubsystem.ClawState.CLOSED);
|
claw = new ClawSubsystem(hardwareMap, ClawSubsystem.ClawState.CLOSED);
|
||||||
@ -74,22 +74,22 @@ public class DevTeleop extends OpMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void theDrop(ArmSubsystem arm, WristSubsystem wrist) {
|
public void theDrop(ArmSubsystem arm, WristSubsystem wrist) {
|
||||||
|
//pick up
|
||||||
if (currentGamepad1.a && !previousGamepad1.a) {
|
if (currentGamepad2.dpad_down && !previousGamepad2.dpad_down) {
|
||||||
wrist.floorWrist();
|
wrist.floorWrist();
|
||||||
arm.engageArm();
|
arm.engageArm();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public void thePickup(ClawSubsystem claw) {
|
public void thePickup(ClawSubsystem claw) {
|
||||||
|
//claw open close
|
||||||
if (currentGamepad1.right_bumper && !previousGamepad1.right_bumper) {
|
if (currentGamepad2.right_bumper && !previousGamepad2.right_bumper) {
|
||||||
claw.switchState();
|
claw.switchState();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void theLift(ArmSubsystem arm, WristSubsystem wrist) {
|
/* public void theLift(ArmSubsystem arm, WristSubsystem wrist) {
|
||||||
|
|
||||||
if (currentGamepad1.b && !previousGamepad1.b) {
|
if (currentGamepad1.b && !previousGamepad1.b) {
|
||||||
arm.parkArm();
|
arm.parkArm();
|
||||||
@ -97,17 +97,19 @@ public class DevTeleop extends OpMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
public void theLowBucketScore(LiftSubsystem lift, WristSubsystem wrist, ArmSubsystem arm) {
|
public void theLowBucketScore(LiftSubsystem lift, WristSubsystem wrist, ArmSubsystem arm) {
|
||||||
if (currentGamepad2.y && !previousGamepad2.y) {
|
//low bucket
|
||||||
|
if (currentGamepad2.a && !previousGamepad2.a) {
|
||||||
lift.toLowBucket();
|
lift.toLowBucket();
|
||||||
arm.bucketArm();
|
arm.bucketArm();
|
||||||
wrist.bucketWrist();
|
wrist.bucketWrist();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void theHighBucketScore(LiftSubsystem lift, WristSubsystem wrist, ArmSubsystem arm) {
|
|
||||||
|
|
||||||
if (currentGamepad2.a && !previousGamepad2.a) {
|
public void theHighBucketScore(LiftSubsystem lift, WristSubsystem wrist, ArmSubsystem arm) {
|
||||||
|
//high basket
|
||||||
|
if (currentGamepad2.b && !previousGamepad2.b) {
|
||||||
lift.toHighBucket();
|
lift.toHighBucket();
|
||||||
arm.bucketArm();
|
arm.bucketArm();
|
||||||
wrist.bucketWrist();
|
wrist.bucketWrist();
|
||||||
@ -115,7 +117,8 @@ public class DevTeleop extends OpMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void theTravel(LiftSubsystem lift, ArmSubsystem arm, WristSubsystem wrist){
|
public void theTravel(LiftSubsystem lift, ArmSubsystem arm, WristSubsystem wrist){
|
||||||
if (currentGamepad2.dpad_down && !previousGamepad2.dpad_down){
|
//
|
||||||
|
if (currentGamepad2.dpad_right && !previousGamepad2.dpad_right){
|
||||||
lift.toFloor();
|
lift.toFloor();
|
||||||
arm.bucketArm();
|
arm.bucketArm();
|
||||||
wrist.floorWrist();
|
wrist.floorWrist();
|
||||||
@ -131,7 +134,7 @@ public class DevTeleop extends OpMode {
|
|||||||
|
|
||||||
theDrop(arm, wrist);
|
theDrop(arm, wrist);
|
||||||
thePickup(claw);
|
thePickup(claw);
|
||||||
theLift(arm, wrist);
|
// theLift(arm, wrist);
|
||||||
theLowBucketScore(lift, wrist, arm);
|
theLowBucketScore(lift, wrist, arm);
|
||||||
theHighBucketScore(lift, wrist, arm);
|
theHighBucketScore(lift, wrist, arm);
|
||||||
theTravel(lift, arm, wrist);
|
theTravel(lift, arm, wrist);
|
||||||
|
Reference in New Issue
Block a user