mirror of
https://github.com/TimeCrafters/UltimateGoal.git
synced 2025-12-16 06:02:33 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -21,9 +21,8 @@ public class AubreyFirstState extends CyberarmState {
|
||||
@Override
|
||||
public void exec() {
|
||||
UwU= -engine.gamepad1.left_stick_y ;
|
||||
OwO= -engine.gamepad1. right_stick_y;
|
||||
robot.driveBackLeft.setPower(UwU);
|
||||
if(robot. limitSwitch. isPressed()) {
|
||||
OwO= -engine.gamepad1.right_stick_y;
|
||||
if(robot.wobbleTouchSensor.isPressed()) {
|
||||
double power = .5;
|
||||
robot.driveFrontLeft.setPower(-power);
|
||||
robot.driveFrontRight.setPower(power);
|
||||
@@ -33,8 +32,9 @@ public class AubreyFirstState extends CyberarmState {
|
||||
|
||||
}else {
|
||||
robot.driveFrontLeft.setPower(UwU);
|
||||
robot.driveBackRight. setPower(OwO);
|
||||
robot.driveBackLeft. setPower(OwO);
|
||||
robot.driveBackRight.setPower(OwO);
|
||||
robot.driveBackLeft.setPower(OwO);
|
||||
robot.driveBackLeft.setPower(UwU);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.timecrafters.javaClass.spencer;
|
||||
|
||||
import org.cyberarm.engine.V2.CyberarmState;
|
||||
import org.timecrafters.javaClass.samples.SampleRobot;
|
||||
|
||||
public class SpencerDriveFoward extends CyberarmState {
|
||||
|
||||
|
||||
private SampleRobot robot;
|
||||
|
||||
public SpencerDriveFoward(SampleRobot robot) {
|
||||
this.robot = robot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exec() {
|
||||
if ()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,7 +7,10 @@ public class SpencerFirstState extends CyberarmState {
|
||||
|
||||
//here, you'll find some of your variables. you can add more as you need them.
|
||||
private SampleRobot robot;
|
||||
|
||||
private double rightStick;
|
||||
private double leftStick;
|
||||
private boolean leftBumper;
|
||||
private boolean rightBumper;
|
||||
//This is the constructor. It lets other code bits run use the code you put here
|
||||
public SpencerFirstState(SampleRobot robot) {
|
||||
this.robot = robot;
|
||||
@@ -17,6 +20,27 @@ public class SpencerFirstState extends CyberarmState {
|
||||
//This one is set up to repeat every few milliseconds
|
||||
@Override
|
||||
public void exec() {
|
||||
rightStick = engine.gamepad1.right_stick_y;
|
||||
leftStick = engine.gamepad1.left_stick_y;
|
||||
leftBumper = engine.gamepad1.left_bumper;
|
||||
rightBumper = engine.gamepad1.right_bumper;
|
||||
|
||||
robot.driveFrontLeft.setPower(-leftStick);
|
||||
robot.driveFrontRight.setPower(-rightStick);
|
||||
robot.driveBackLeft.setPower(-leftStick);
|
||||
robot.driveBackRight.setPower(-rightStick);
|
||||
if (leftBumper) {
|
||||
robot.driveFrontLeft.setPower(-1);
|
||||
robot.driveFrontRight.setPower(-1);
|
||||
robot.driveBackLeft.setPower(-1);
|
||||
robot.driveBackRight.setPower(-1);
|
||||
} else if (rightBumper) {
|
||||
robot.driveFrontLeft.setPower(1);
|
||||
robot.driveFrontRight.setPower(1);
|
||||
robot.driveBackLeft.setPower(1);
|
||||
robot.driveBackRight.setPower(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user