mirror of
https://github.com/TimeCrafters/FTC_2022
synced 2025-12-15 14:22:34 +00:00
Tested Arm Motor and Collector Wrist, added Rack Risers.
This commit is contained in:
@@ -9,7 +9,8 @@ import org.cyberarm.engine.V2.CyberarmEngine;
|
||||
|
||||
public class PrototypeBot1 {
|
||||
|
||||
private CyberarmEngine engine;
|
||||
public Servo RackRiserLeft, RackRiserRight;
|
||||
private final CyberarmEngine engine;
|
||||
|
||||
public DcMotor frontLeftDrive, frontRightDrive, backLeftDrive, backRightDrive, armMotor;
|
||||
|
||||
@@ -36,6 +37,8 @@ public class PrototypeBot1 {
|
||||
collectorLeft = engine.hardwareMap.crservo.get("collector left");
|
||||
collectorRight = engine.hardwareMap.crservo.get("collector right");
|
||||
collectorWrist = engine.hardwareMap.servo.get("collector wrist");
|
||||
RackRiserLeft = engine.hardwareMap.servo.get("RackRiserLeft");
|
||||
RackRiserRight = engine.hardwareMap.servo.get("RackRiserRight");
|
||||
|
||||
//motors direction and encoders
|
||||
frontLeftDrive.setDirection(DcMotorSimple.Direction.FORWARD);
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.qualcomm.robotcore.hardware.DcMotor;
|
||||
import org.cyberarm.engine.V2.CyberarmState;
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PrototypeTeleOPState extends CyberarmState {
|
||||
|
||||
@@ -16,6 +17,7 @@ public class PrototypeTeleOPState extends CyberarmState {
|
||||
private double drivePower = 1;
|
||||
private boolean UpDPad;
|
||||
private int armTargetPosition = 0, armCollectPosition = 125, armDeliverPosition = 400;
|
||||
private double collectorRiserPosition;
|
||||
|
||||
public PrototypeTeleOPState(PrototypeBot1 robot) {
|
||||
this.robot = robot;
|
||||
@@ -26,6 +28,7 @@ public class PrototypeTeleOPState extends CyberarmState {
|
||||
engine.telemetry.addData("Arm Power", robot.armMotor.getPower());
|
||||
engine.telemetry.addData("Arm Target Position", robot.armMotor.getTargetPosition());
|
||||
engine.telemetry.addData("Arm Current Position", robot.armMotor.getCurrentPosition());
|
||||
engine.telemetry.addData("Wrist Current Position", robot.collectorWrist.getPosition());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,7 +118,7 @@ public class PrototypeTeleOPState extends CyberarmState {
|
||||
|
||||
if (engine.gamepad2.dpad_left) {
|
||||
|
||||
robot.collectorWrist.setPosition(0.2);
|
||||
robot.collectorWrist.setPosition(0.4);
|
||||
|
||||
}
|
||||
|
||||
@@ -164,5 +167,19 @@ public class PrototypeTeleOPState extends CyberarmState {
|
||||
|
||||
robot.armMotor.setTargetPosition(armTargetPosition);
|
||||
|
||||
if (engine.gamepad1.a) {
|
||||
|
||||
robot.RackRiserLeft.setPosition(0);
|
||||
robot.RackRiserRight.setPosition(1);
|
||||
|
||||
}
|
||||
|
||||
if (engine.gamepad1.x) {
|
||||
|
||||
robot.RackRiserLeft.setPosition(0.5);
|
||||
robot.RackRiserRight.setPosition(1-.5);
|
||||
// .5's are originally .13's.
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user