Autonomous has been wrote to acsend and descend the arms, and camera has been commented out

This commit is contained in:
SpencerPiha
2022-10-22 15:45:17 -05:00
parent e04b3cb2f2
commit 5027b085c9
4 changed files with 11 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
package org.timecrafters.Autonomous.Engines;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.hardware.DcMotor;
import org.cyberarm.engine.V2.CyberarmEngine;
import org.timecrafters.Autonomous.States.CollectorState;

View File

@@ -11,19 +11,16 @@ public class DriverState extends CyberarmState {
this.traveledDistance = robot.configuration.variable(groupName, actionName, "traveledDistance").value();
}
private float RobotRotation;
private double drivePower;
private int RobotPosition,RobotStartingPosition,traveledDistance;
private int traveledDistance;
@Override
public void exec() {
if (RobotPosition - RobotStartingPosition < traveledDistance){
drivePower = 1;
robot.backLeftDrive.setPower(drivePower);
if (robot.frontRightDrive.getCurrentPosition() < traveledDistance){
robot.backLeftDrive.setPower(drivePower * 0.5);
robot.backRightDrive.setPower(drivePower);
robot.frontLeftDrive.setPower(drivePower);
robot.frontLeftDrive.setPower(drivePower * 0.5);
robot.frontRightDrive.setPower(drivePower);
} else {
robot.backLeftDrive.setPower(0);

View File

@@ -21,7 +21,7 @@ public class RotationState extends CyberarmState {
RobotRotation = robot.imu.getAngularOrientation().firstAngle;
if (RobotRotation - 3 <= targetRotation || RobotRotation + 3 <= targetRotation) {
if (RobotRotation <= targetRotation -3 || RobotRotation >= targetRotation + 3) {
robot.backLeftDrive.setPower(-drivePower);
robot.backRightDrive.setPower(drivePower);
robot.frontLeftDrive.setPower(-drivePower);