mirror of
https://github.com/TimeCrafters/CenterStage
synced 2025-12-15 16:52:35 +00:00
worked on righting the sequence states for the servos
This commit is contained in:
@@ -7,8 +7,6 @@ import dev.cyberarm.engine.V2.CyberarmState;
|
||||
public class AutoStateSample extends CyberarmState {
|
||||
|
||||
private final boolean stateDisabled;
|
||||
private double newX;
|
||||
private double newY;
|
||||
PrototypeRobot robot;
|
||||
public AutoStateSample(PrototypeRobot robot, String groupName, String actionName) {
|
||||
this.robot = robot;
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package org.timecrafters.CenterStage.Autonomous.States;
|
||||
|
||||
import org.timecrafters.CenterStage.Common.PrototypeRobot;
|
||||
|
||||
import dev.cyberarm.engine.V2.CyberarmState;
|
||||
|
||||
public class DepositorArmPosState extends CyberarmState {
|
||||
|
||||
private final boolean stateDisabled;
|
||||
PrototypeRobot robot;
|
||||
|
||||
public DepositorArmPosState(PrototypeRobot robot, String groupName, String actionName) {
|
||||
this.robot = robot;
|
||||
this.stateDisabled = !robot.configuration.action(groupName, actionName).enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
//add variables that need to be reinitillized
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exec() {
|
||||
if (robot.armPosition == 0) { // transfer mode
|
||||
if (robot.oldArmPosititon == 0){
|
||||
setHasFinished(true);
|
||||
} else if (robot.oldArmPosititon == 1){
|
||||
robot.depositorElbow.setPosition(robot.ELBOW_COLLECT);
|
||||
} else if (robot.oldArmPosititon == 2){
|
||||
|
||||
}
|
||||
// } else if (robot.armPosition == 1) { // drive mode
|
||||
// if (robot.oldArmPosititon == 1){
|
||||
// setHasFinished(true);
|
||||
// } else if (robot.oldArmPosititon == 0){
|
||||
//
|
||||
// } else if (robot.oldArmPosititon == 2){
|
||||
//
|
||||
// }
|
||||
// } else if (robot.armPosition == 2) { // deposit mode
|
||||
// if (robot.oldArmPosititon == 2){
|
||||
// setHasFinished(true);
|
||||
// } else if (robot.oldArmPosititon == 0){
|
||||
//
|
||||
// } else if (robot.oldArmPosititon == 1){
|
||||
//
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,10 @@ import org.timecrafters.TimeCraftersConfigurationTool.library.TimeCraftersConfig
|
||||
import dev.cyberarm.engine.V2.CyberarmEngine;
|
||||
|
||||
public class PrototypeRobot extends Robot {
|
||||
|
||||
public int armPosition = 0;
|
||||
|
||||
public int oldArmPosititon;
|
||||
public double servoWaitTime;
|
||||
public double servoSecPerDeg = 0.14/60;
|
||||
public float ELBOW_COLLECT;
|
||||
|
||||
Reference in New Issue
Block a user