speed buttons added, extra steps taken out of auto.

This commit is contained in:
robotics2
2023-11-28 16:27:08 -08:00
parent 0d131c1b1e
commit a260b373de
3 changed files with 20 additions and 15 deletions

View File

@ -261,8 +261,7 @@ public class Autonomoustest extends LinearOpMode {
arm.setPower(0); arm.setPower(0);
driveForward(-21); driveForward(-21);
straightLeft(32); straightLeft(32);
driveForward(18); driveForward(-10);
driveForward(-28);
straightRight(33); straightRight(33);
driveForward(-1.5); driveForward(-1.5);
raisearm(80); raisearm(80);
@ -291,8 +290,7 @@ public class Autonomoustest extends LinearOpMode {
driveForward(-15.5); driveForward(-15.5);
turnLeft(90); turnLeft(90);
straightLeft(15); straightLeft(15);
driveForward(8); driveForward(-20.5);
driveForward(-28.5);
straightRight(19); straightRight(19);
driveForward(-1.5); driveForward(-1.5);
raisearm(80); raisearm(80);
@ -320,8 +318,7 @@ else
driveForward(-15); driveForward(-15);
turnLeft(90); turnLeft(90);
straightLeft(15); straightLeft(15);
driveForward(8); driveForward(-18);
driveForward(-26);
straightRight(29); straightRight(29);
driveForward(-1.5); driveForward(-1.5);
raisearm(80); raisearm(80);

View File

@ -100,7 +100,11 @@ public class arm extends OpMode {
} }
double num = 2.5; //double num = 2.25;
final static double MOTOR_HI_SPEED_RATIO = 2.25;
final static double MOTOR_LO_SPEED_RATIO = 3.5;
final static double ARM_POWER = 3.5;
double num = MOTOR_HI_SPEED_RATIO;
/** /**
* User defined loop method. * User defined loop method.
* This method will be called repeatedly in a loop while this op mode is running * This method will be called repeatedly in a loop while this op mode is running
@ -112,10 +116,17 @@ public class arm extends OpMode {
backRight.setDirection(DcMotor.Direction.REVERSE); backRight.setDirection(DcMotor.Direction.REVERSE);
double armPower = gamepad2.right_stick_y/3.5; double armPower = gamepad2.right_stick_y/ARM_POWER;
// Normalize the values so no wheel power exceeds 100% // Normalize the values so no wheel power exceeds 100%
// This ensures that the robot maintains the desired motion. // This ensures that the robot maintains the desired motion.
if(gamepad1.a)
{
num = MOTOR_HI_SPEED_RATIO;
}
if (gamepad1.b)
{
num = MOTOR_LO_SPEED_RATIO;
}
if(gamepad2.right_stick_y != 0) if(gamepad2.right_stick_y != 0)
{ {
arm.setPower(armPower); arm.setPower(armPower);

View File

@ -251,8 +251,7 @@ public class bluefront extends LinearOpMode {
driveForward(-15.5); driveForward(-15.5);
turnRight(90); turnRight(90);
straightRight(15); straightRight(15);
driveForward(8); driveForward(-20.5);
driveForward(-28.5);
straightLeft(19); straightLeft(19);
raisearm(80); raisearm(80);
wrist.setPosition(0); wrist.setPosition(0);
@ -281,8 +280,7 @@ public class bluefront extends LinearOpMode {
arm.setPower(0); arm.setPower(0);
driveForward(-21); driveForward(-21);
straightRight(32); straightRight(32);
driveForward(18); driveForward(-10);
driveForward(-28);
straightLeft(33); straightLeft(33);
raisearm(80); raisearm(80);
wrist.setPosition(0); wrist.setPosition(0);
@ -309,8 +307,7 @@ public class bluefront extends LinearOpMode {
driveForward(-15); driveForward(-15);
turnRight(90); turnRight(90);
straightRight(15); straightRight(15);
driveForward(8); driveForward(-18);
driveForward(-26);
straightLeft(29); straightLeft(29);
raisearm(80); raisearm(80);
wrist.setPosition(0); wrist.setPosition(0);