mirror of
https://github.com/TimeCrafters/CenterStage
synced 2025-12-15 08:42:35 +00:00
Needs testing, feel good about this one ¯\_(ツ)_/¯
This commit is contained in:
@@ -9,18 +9,18 @@ import org.timecrafters.CenterStage.Autonomous.States.SodiPizzaAutoTurnState;
|
||||
import org.timecrafters.CenterStage.Autonomous.States.SodiPizzaWheelTest;
|
||||
|
||||
import dev.cyberarm.engine.V2.CyberarmEngine;
|
||||
import dev.cyberarm.engine.V2.CyberarmState;
|
||||
|
||||
@Autonomous(name = "Sodi's Pizza Box Bot Auto", group = "")
|
||||
public class SodiPizzaAutoRedRightEngine extends CyberarmEngine {
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
|
||||
addState(new SodiPizzaAutoFirstDriveState());
|
||||
addState(new SodiPizzaAutoTurnState());
|
||||
if (blackboardGetInt("readyToTurn") == 0) {
|
||||
addTask(new SodiPizzaAutoFirstDriveState());
|
||||
}
|
||||
|
||||
// addState(new SodiPizzaAutoSecDriveState());
|
||||
|
||||
// addState(new SodiPizzaAutoArmState());
|
||||
// addState(new SodiPizzaWheelTest());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,12 @@ public class SodiPizzaAutoTurnState extends CyberarmState {
|
||||
private double targetRot;
|
||||
private double currentRot;
|
||||
private double neededRot = targetRot - currentRot;
|
||||
|
||||
private double rightTurnCW = robot.imu.getRobotYawPitchRollAngles().getYaw(AngleUnit.DEGREES) + 90;
|
||||
private double rightTurnCCW = robot.imu.getRobotYawPitchRollAngles().getYaw(AngleUnit.DEGREES) - 90;
|
||||
private double backTurnCW = robot.imu.getRobotYawPitchRollAngles().getYaw(AngleUnit.DEGREES) + 180;
|
||||
private double backTurnCCW = robot.imu.getRobotYawPitchRollAngles().getYaw(AngleUnit.DEGREES) - 180;
|
||||
|
||||
/** Rot = rotation **/
|
||||
|
||||
public SodiPizzaAutoTurnState() {
|
||||
|
||||
@@ -70,5 +70,7 @@ public class SodiPizzaMinibotObject extends Robot {
|
||||
gripper = engine.hardwareMap.servo.get("gripper");
|
||||
|
||||
//readyToTurn
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user