mirror of
https://github.com/TimeCrafters/FTC_2022
synced 2025-12-15 15:32:35 +00:00
camera servo sate added
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package org.timecrafters.Autonomous.States;
|
||||
|
||||
import org.cyberarm.engine.V2.CyberarmState;
|
||||
import org.timecrafters.testing.states.PhoenixBot1;
|
||||
|
||||
public class ServoCameraRotate extends CyberarmState {
|
||||
private final boolean stateDisabled;
|
||||
PhoenixBot1 robot;
|
||||
private double ServoPosition;
|
||||
|
||||
public ServoCameraRotate(PhoenixBot1 robot, String groupName, String actionName) {
|
||||
this.stateDisabled = !robot.configuration.action(groupName, actionName).enabled;
|
||||
this.robot = robot;
|
||||
this.ServoPosition = robot.configuration.variable(groupName, actionName, "ServoPosition").value();
|
||||
|
||||
}
|
||||
@Override
|
||||
public void exec() {
|
||||
if (stateDisabled) {
|
||||
setHasFinished(true);
|
||||
} else {
|
||||
robot.CameraServo.setPosition(ServoPosition);
|
||||
setHasFinished(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user