mirror of
https://github.com/TimeCrafters/FreightFrenzy.git
synced 2025-12-15 22:12:35 +00:00
Compare commits
1 Commits
e025034655
...
add_tacnet
| Author | SHA1 | Date | |
|---|---|---|---|
| f888e683ef |
3
.idea/.gitignore
generated
vendored
3
.idea/.gitignore
generated
vendored
@@ -1,3 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
6
.idea/compiler.xml
generated
6
.idea/compiler.xml
generated
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="CompilerConfiguration">
|
|
||||||
<bytecodeTargetLevel target="11" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
30
.idea/jarRepositories.xml
generated
30
.idea/jarRepositories.xml
generated
@@ -1,30 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="RemoteRepositoriesConfiguration">
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="central" />
|
|
||||||
<option name="name" value="Maven Central repository" />
|
|
||||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="jboss.community" />
|
|
||||||
<option name="name" value="JBoss Community repository" />
|
|
||||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="MavenRepo" />
|
|
||||||
<option name="name" value="MavenRepo" />
|
|
||||||
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="BintrayJCenter" />
|
|
||||||
<option name="name" value="BintrayJCenter" />
|
|
||||||
<option name="url" value="https://jcenter.bintray.com/" />
|
|
||||||
</remote-repository>
|
|
||||||
<remote-repository>
|
|
||||||
<option name="id" value="Google" />
|
|
||||||
<option name="name" value="Google" />
|
|
||||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
|
||||||
</remote-repository>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
9
.idea/misc.xml
generated
9
.idea/misc.xml
generated
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectType">
|
|
||||||
<option name="id" value="Android" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,59 +0,0 @@
|
|||||||
package org.timecrafters.FreightFrenzy.Competition.Autonomous.Engines;
|
|
||||||
|
|
||||||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
|
||||||
|
|
||||||
import org.cyberarm.engine.V2.CyberarmEngine;
|
|
||||||
import org.timecrafters.FreightFrenzy.Competition.Autonomous.States.CollectorToggle;
|
|
||||||
import org.timecrafters.FreightFrenzy.Competition.Autonomous.States.DriveState;
|
|
||||||
import org.timecrafters.FreightFrenzy.Competition.Autonomous.States.TensorFlowState;
|
|
||||||
import org.timecrafters.FreightFrenzy.Competition.Autonomous.States.TurretArmExtension;
|
|
||||||
import org.timecrafters.FreightFrenzy.Competition.Autonomous.States.TurretOrbit;
|
|
||||||
import org.timecrafters.FreightFrenzy.Competition.Common.Robot;
|
|
||||||
|
|
||||||
@Autonomous (name = "Blue Duck Autonomous", group = "blue")
|
|
||||||
public class BlueDuckEngine extends CyberarmEngine {
|
|
||||||
Robot robot;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setup() {
|
|
||||||
this.robot = new Robot(this);
|
|
||||||
robot.resetEncoders();
|
|
||||||
|
|
||||||
addState(new TurretOrbit(robot, robot.turretServoWhite, robot.whiteMag, "BlueDuckAutonomous", "01_0"));
|
|
||||||
addState(new TensorFlowState(robot, robot.whiteArmRiser, robot.whiteArmBobbin, "BlueDuckAutonomous", "01_1"));
|
|
||||||
// addState(new TurretArmExtension(robot, robot.whiteArmBobbin, "RedWarehouseAutonomous", "02_0"));
|
|
||||||
// addState(new TurretArmRiser(robot, robot.whiteArmRiser, "RedWarehouseAutonomous", "03_0_middle"));
|
|
||||||
// addState(new TurretArmExtension(robot, robot.whiteArmBobbin, "RedWarehouseAutonomous", "04_0"));
|
|
||||||
addState(new CollectorToggle(robot, robot.collectorWhite, "BlueDuckAutonomous", "05_0"));
|
|
||||||
addState(new CollectorToggle(robot, robot.collectorWhite, "BlueDuckAutonomous", "06_0"));
|
|
||||||
addState(new TurretArmExtension(robot, robot.whiteArmBobbin, "BlueDuckAutonomous", "07_0"));
|
|
||||||
addState(new DriveState(robot,"BlueDuckAutonomous", "08_0"));
|
|
||||||
addState(new DriveState(robot, "BlueDuckAutonomous", "09_0"));
|
|
||||||
addState(new TurretOrbit(robot, robot.turretServoWhite, null, "BlueDuckAutonomous", "10_0"));
|
|
||||||
addState(new DriveState(robot, "BlueDuckAutonomous", "10_1"));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void loop() {
|
|
||||||
super.loop();
|
|
||||||
|
|
||||||
telemetry.addData("white arm extension", robot.whiteArmBobbin.getCurrentPosition());
|
|
||||||
telemetry.addData("White Riser Arm", robot.whiteArmRiser.getCurrentPosition());
|
|
||||||
telemetry.addData("white Turret Switch", robot.whiteMag.isPressed());
|
|
||||||
telemetry.addData("white Turret orbit Power", robot.turretServoWhite.getPower());
|
|
||||||
telemetry.addData("White Door Position", robot.whiteDispenser.getPosition());
|
|
||||||
telemetry.addLine();
|
|
||||||
|
|
||||||
telemetry.addData("Orange Riser Arm", robot.orangeArmRiser.getCurrentPosition());
|
|
||||||
telemetry.addData("orange arm extension", robot.orangeArmBobbin.getCurrentPosition());
|
|
||||||
telemetry.addData("orange Turret Switch", robot.orangeMag.isPressed());
|
|
||||||
telemetry.addData("orange Turret Orbit Power", robot.turretServoOrange.getPower());
|
|
||||||
telemetry.addData("Orange Door Position", robot.orangeDispenser.getPosition());
|
|
||||||
telemetry.addLine();
|
|
||||||
|
|
||||||
telemetry.addData("driveWarehouseLeft", robot.driveWarehouseLeft.getCurrentPosition());
|
|
||||||
telemetry.addData("driveWarehouseRight", robot.driveWarehouseRight.getCurrentPosition());
|
|
||||||
telemetry.addData("driveGoalLeft", robot.driveGoalLeft.getCurrentPosition());
|
|
||||||
telemetry.addData("driveGoalRight", robot.driveGoalRight.getCurrentPosition());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -18,20 +18,18 @@ public class BlueWarehouseEngine extends CyberarmEngine {
|
|||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
this.robot = new Robot(this);
|
this.robot = new Robot(this);
|
||||||
robot.resetEncoders();
|
|
||||||
|
|
||||||
addState(new TurretOrbit(robot, robot.turretServoOrange, robot.orangeMag, "BlueWarehouseAutonomous", "01_0"));
|
addState(new TurretOrbit(robot, robot.turretServoWhite, robot.whiteMag, "BlueWarehouseAutonomous", "01_0"));
|
||||||
addState(new TensorFlowState(robot, robot.orangeArmRiser, robot.orangeArmBobbin, "BlueWarehouseAutonomous", "01_1"));
|
addState(new TensorFlowState(robot, robot.whiteArmRiser, robot.whiteArmBobbin, "BlueWarehouseAutonomous", "01_1"));
|
||||||
// addState(new TurretArmExtension(robot, robot.orangeArmBobbin, "RedWarehouseAutonomous", "02_0"));
|
// addState(new TurretArmExtension(robot, robot.whiteArmBobbin, "BlueWarehouseAutonomous", "02_0"));
|
||||||
// addState(new TurretArmRiser(robot, robot.orangeArmRiser, "RedWarehouseAutonomous", "03_0_middle"));
|
// addState(new TurretArmRiser(robot, robot.whiteArmRiser, "BlueWarehouseAutonomous", "03_0_middle"));
|
||||||
// addState(new TurretArmExtension(robot, robot.orangeArmBobbin, "RedWarehouseAutonomous", "04_0"));
|
// addState(new TurretArmExtension(robot, robot.whiteArmBobbin, "BlueWarehouseAutonomous", "04_0_middle"));
|
||||||
addState(new CollectorToggle(robot, robot.collectorOrange, "BlueWarehouseAutonomous", "05_0"));
|
addState(new CollectorToggle(robot, robot.collectorWhite, "BlueWarehouseAutonomous", "05_0"));
|
||||||
addState(new CollectorToggle(robot, robot.collectorOrange, "BlueWarehouseAutonomous", "06_0"));
|
addState(new CollectorToggle(robot, robot.collectorWhite, "BlueWarehouseAutonomous", "06_0"));
|
||||||
addState(new TurretArmExtension(robot, robot.orangeArmBobbin, "BlueWarehouseAutonomous", "07_0"));
|
addState(new TurretArmExtension(robot, robot.whiteArmBobbin, "BlueWarehouseAutonomous", "07_0"));
|
||||||
addState(new DriveState(robot,"BlueWarehouseAutonomous", "08_0"));
|
addState(new DriveState(robot,"BlueWarehouseAutonomous", "08_0"));
|
||||||
addState(new DriveState(robot, "BlueWarehouseAutonomous", "09_0"));
|
addState(new DriveState(robot, "BlueWarehouseAutonomous", "09_0"));
|
||||||
addState(new TurretOrbit(robot, robot.turretServoOrange, null, "BlueWarehouseAutonomous", "10_0"));
|
addState(new DriveState(robot, "BlueWarehouseAutonomous", "10_0"));
|
||||||
addState(new DriveState(robot, "BlueWarehouseAutonomous", "10_1"));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
package org.timecrafters.FreightFrenzy.Competition.Autonomous.Engines;
|
|
||||||
|
|
||||||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
|
|
||||||
|
|
||||||
import org.cyberarm.engine.V2.CyberarmEngine;
|
|
||||||
import org.timecrafters.FreightFrenzy.Competition.Autonomous.States.CollectorToggle;
|
|
||||||
import org.timecrafters.FreightFrenzy.Competition.Autonomous.States.DriveState;
|
|
||||||
import org.timecrafters.FreightFrenzy.Competition.Autonomous.States.TensorFlowState;
|
|
||||||
import org.timecrafters.FreightFrenzy.Competition.Autonomous.States.TurretArmExtension;
|
|
||||||
import org.timecrafters.FreightFrenzy.Competition.Autonomous.States.TurretOrbit;
|
|
||||||
import org.timecrafters.FreightFrenzy.Competition.Common.Robot;
|
|
||||||
|
|
||||||
@Autonomous(name = "RedDuckAutonomous", group = "red")
|
|
||||||
|
|
||||||
public class RedDuckEngine extends CyberarmEngine {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setup() {
|
|
||||||
Robot robot = new Robot(this);
|
|
||||||
robot.resetEncoders();
|
|
||||||
|
|
||||||
addState(new TurretOrbit(robot, robot.turretServoOrange, robot.orangeMag, "RedDuckAutonomous", "01_0"));
|
|
||||||
addState(new TensorFlowState(robot, robot.orangeArmRiser, robot.orangeArmBobbin, "RedDuckAutonomous", "01_1"));
|
|
||||||
// addState(new TurretArmExtension(robot, robot.orangeArmBobbin, "RedWarehouseAutonomous", "02_0"));
|
|
||||||
// addState(new TurretArmRiser(robot, robot.orangeArmRiser, "RedWarehouseAutonomous", "03_0_middle"));
|
|
||||||
// addState(new TurretArmExtension(robot, robot.orangeArmBobbin, "RedWarehouseAutonomous", "04_0"));
|
|
||||||
addState(new CollectorToggle(robot, robot.collectorOrange, "RedDuckAutonomous", "05_0"));
|
|
||||||
addState(new CollectorToggle(robot, robot.collectorOrange, "RedDuckAutonomous", "06_0"));
|
|
||||||
addState(new TurretArmExtension(robot, robot.orangeArmBobbin, "RedDuckAutonomous", "07_0"));
|
|
||||||
addState(new DriveState(robot,"RedDuckAutonomous", "08_0"));
|
|
||||||
addState(new DriveState(robot, "RedDuckAutonomous", "09_0"));
|
|
||||||
addState(new TurretOrbit(robot, robot.turretServoOrange, null, "RedDuckAutonomous", "10_0"));
|
|
||||||
addState(new DriveState(robot, "RedDuckAutonomous", "10_1"));
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -18,7 +18,6 @@ public class RedWarehouseEngine extends CyberarmEngine {
|
|||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
this.robot = new Robot(this);
|
this.robot = new Robot(this);
|
||||||
robot.resetEncoders();
|
|
||||||
|
|
||||||
addState(new TurretOrbit(robot, robot.turretServoWhite, robot.whiteMag, "RedWarehouseAutonomous", "01_0"));
|
addState(new TurretOrbit(robot, robot.turretServoWhite, robot.whiteMag, "RedWarehouseAutonomous", "01_0"));
|
||||||
addState(new TensorFlowState(robot, robot.whiteArmRiser, robot.whiteArmBobbin, "RedWarehouseAutonomous", "01_1"));
|
addState(new TensorFlowState(robot, robot.whiteArmRiser, robot.whiteArmBobbin, "RedWarehouseAutonomous", "01_1"));
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class CollectorToggle extends CyberarmState {
|
|||||||
final static public int MODE_STOPPED = 0;
|
final static public int MODE_STOPPED = 0;
|
||||||
double time;
|
double time;
|
||||||
CRServo servo;
|
CRServo servo;
|
||||||
double power;
|
int power;
|
||||||
|
|
||||||
public CollectorToggle(Robot robot, CRServo servo, String groupName, String actionName) {
|
public CollectorToggle(Robot robot, CRServo servo, String groupName, String actionName) {
|
||||||
this.servo = servo;
|
this.servo = servo;
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ public class TensorFlowState extends CyberarmState {
|
|||||||
private double checkTime;
|
private double checkTime;
|
||||||
private int manualPath;
|
private int manualPath;
|
||||||
private int path = 0;
|
private int path = 0;
|
||||||
private double leftDuck;
|
|
||||||
private double middleDuck;
|
|
||||||
|
|
||||||
private String groupName;
|
private String groupName;
|
||||||
private DcMotor armRiser, armExtension;
|
private DcMotor armRiser, armExtension;
|
||||||
@@ -26,8 +24,6 @@ public class TensorFlowState extends CyberarmState {
|
|||||||
this.groupName = groupName;
|
this.groupName = groupName;
|
||||||
this.armRiser = armRiser;
|
this.armRiser = armRiser;
|
||||||
this.armExtension = armExtension;
|
this.armExtension = armExtension;
|
||||||
this.leftDuck = robot.configuration.variable(groupName, actionName, "leftDuck").value();
|
|
||||||
this.middleDuck = robot.configuration.variable(groupName, actionName, "middleDuck").value();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -39,7 +35,7 @@ public class TensorFlowState extends CyberarmState {
|
|||||||
@Override
|
@Override
|
||||||
public void exec() {
|
public void exec() {
|
||||||
recognitions = robot.tensorflowDetections();
|
recognitions = robot.tensorflowDetections();
|
||||||
|
//
|
||||||
if (runTime() < checkTime) {
|
if (runTime() < checkTime) {
|
||||||
if (manualPath != -1) {
|
if (manualPath != -1) {
|
||||||
|
|
||||||
@@ -47,10 +43,12 @@ public class TensorFlowState extends CyberarmState {
|
|||||||
if (recognitions.size() == 1) {
|
if (recognitions.size() == 1) {
|
||||||
Recognition recognition = recognitions.get(0);
|
Recognition recognition = recognitions.get(0);
|
||||||
|
|
||||||
if (recognition.getLeft() < leftDuck) {
|
if (recognition.getLabel().equals("duck")){
|
||||||
path = 0;
|
if (recognition.getLeft() < 320) {
|
||||||
} else {
|
path = 0;
|
||||||
path = 1;
|
} else {
|
||||||
|
path = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
path = 2;
|
path = 2;
|
||||||
@@ -72,7 +70,7 @@ public class TensorFlowState extends CyberarmState {
|
|||||||
addState(new TurretArmExtension(robot, armExtension, groupName, "04_0_top"));
|
addState(new TurretArmExtension(robot, armExtension, groupName, "04_0_top"));
|
||||||
}
|
}
|
||||||
|
|
||||||
setHasFinished(true);
|
setHasFinished(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,12 @@ public class TurretArmExtension extends CyberarmState {
|
|||||||
this.tolerance = robot.configuration.variable(groupName, actionName, "tolerance").value();
|
this.tolerance = robot.configuration.variable(groupName, actionName, "tolerance").value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void start() {
|
||||||
|
motor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
||||||
|
motor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exec() {
|
public void exec() {
|
||||||
if (motor.getCurrentPosition() < targetPosition - tolerance){
|
if (motor.getCurrentPosition() < targetPosition - tolerance){
|
||||||
@@ -34,9 +40,4 @@ public class TurretArmExtension extends CyberarmState {
|
|||||||
motor.setPower(0);
|
motor.setPower(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void telemetry() {
|
|
||||||
engine.telemetry.addData("targetPosition", targetPosition);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,12 @@ public class TurretArmRiser extends CyberarmState {
|
|||||||
this.tolerance = robot.configuration.variable(groupName, actionName, "tolerance").value();
|
this.tolerance = robot.configuration.variable(groupName, actionName, "tolerance").value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void start() {
|
||||||
|
motor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
||||||
|
motor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exec() {
|
public void exec() {
|
||||||
if (motor.getCurrentPosition() < targetPosition - tolerance){
|
if (motor.getCurrentPosition() < targetPosition - tolerance){
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class TurretOrbit extends CyberarmState {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exec() {
|
public void exec() {
|
||||||
if ((magnetSwitch != null && magnetSwitch.isPressed()) || runTime() > time ){
|
if (magnetSwitch.isPressed() || runTime() < time ){
|
||||||
servo.setPower(0);
|
servo.setPower(0);
|
||||||
setHasFinished(true);
|
setHasFinished(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -274,18 +274,6 @@ public class Robot {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetEncoders(){
|
|
||||||
orangeArmBobbin.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
|
||||||
whiteArmBobbin.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
|
||||||
orangeArmRiser.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
|
||||||
whiteArmRiser.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
|
||||||
|
|
||||||
orangeArmBobbin.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
|
|
||||||
whiteArmBobbin.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
|
|
||||||
orangeArmRiser.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
|
|
||||||
whiteArmRiser.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initTensorflow() {
|
private void initTensorflow() {
|
||||||
int tfodMonitorViewId = engine.hardwareMap.appContext.getResources().getIdentifier(
|
int tfodMonitorViewId = engine.hardwareMap.appContext.getResources().getIdentifier(
|
||||||
"tfodMonitorViewId", "id", engine.hardwareMap.appContext.getPackageName());
|
"tfodMonitorViewId", "id", engine.hardwareMap.appContext.getPackageName());
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class TeleOpState extends CyberarmState {
|
|||||||
robot.driveGoalRight.setPower(-engine.gamepad1.right_stick_y * maxDriveSpeed);
|
robot.driveGoalRight.setPower(-engine.gamepad1.right_stick_y * maxDriveSpeed);
|
||||||
|
|
||||||
// dispenser powered
|
// dispenser powered
|
||||||
if (engine.gamepad1.a){
|
if (engine.gamepad1.b){
|
||||||
robot.orangeDispenser.setPosition(0);
|
robot.orangeDispenser.setPosition(0);
|
||||||
}
|
}
|
||||||
// if not pressed dispenser off
|
// if not pressed dispenser off
|
||||||
@@ -86,14 +86,12 @@ public class TeleOpState extends CyberarmState {
|
|||||||
robot.orangeArmRiser.setPower(0);
|
robot.orangeArmRiser.setPower(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// button x pressed carousel wheel move, for blue side, if b pressed wheel spins for red side;
|
// button x pressed carousel wheel move.
|
||||||
|
|
||||||
if (engine.gamepad2.x){
|
if (engine.gamepad1.x){
|
||||||
robot.carouselWheel.setPower(1);
|
robot.carouselWheel.setPower(1);
|
||||||
}
|
}
|
||||||
else if (engine.gamepad2.b){
|
|
||||||
robot.carouselWheel.setPower(-1);
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
robot.carouselWheel.setPower(0);
|
robot.carouselWheel.setPower(0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user