mirror of
https://github.com/TimeCrafters/CenterStage
synced 2025-12-15 16:52:35 +00:00
Minibot Yelow V2 code should now compile
This commit is contained in:
@@ -15,9 +15,6 @@ import dev.cyberarm.engine.V2.CyberarmEngine;
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
this.robot = new MiniYellowTeleOPv2();
|
||||
this.robot.setup();
|
||||
|
||||
addState(new MiniYellowTeleOPv2(robot));
|
||||
addState(new MiniYellowTeleOPv2());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,8 @@ import org.timecrafters.TimeCraftersConfigurationTool.library.TimeCraftersConfig
|
||||
import dev.cyberarm.engine.V2.CyberarmEngine;
|
||||
import dev.cyberarm.engine.V2.CyberarmState;
|
||||
|
||||
public class MiniYellowTeleOPv2 extends Robot {
|
||||
public class MiniYellowTeleOPv2 extends CyberarmState {
|
||||
|
||||
private final MiniYellowTeleOPv2 robot;
|
||||
public HardwareMap hardwareMap;
|
||||
public MotorEx flDrive, frDrive, blDrive, brDrive;
|
||||
public IMU imu;
|
||||
@@ -24,58 +23,52 @@ public class MiniYellowTeleOPv2 extends Robot {
|
||||
private float lStickY, transitPercent;
|
||||
|
||||
public TimeCraftersConfiguration configuration;
|
||||
|
||||
public MiniYellowTeleOPv2(MiniYellowTeleOPv2 robot) {}
|
||||
|
||||
@Override
|
||||
public void init () {
|
||||
public void init() {
|
||||
this.hardwareMap = CyberarmEngine.instance.hardwareMap;
|
||||
CyberarmEngine engine = CyberarmEngine.instance;
|
||||
|
||||
this.hardwareMap = CyberarmEngine.instance.hardwareMap;
|
||||
CyberarmEngine engine = CyberarmEngine.instance;
|
||||
|
||||
configuration = new TimeCraftersConfiguration("Minibot Yellow");
|
||||
configuration = new TimeCraftersConfiguration("Minibot Yellow");
|
||||
|
||||
|
||||
imu = engine.hardwareMap.get(IMU.class, "imu");
|
||||
imu = engine.hardwareMap.get(IMU.class, "imu");
|
||||
|
||||
IMU.Parameters parameters = new IMU.Parameters(
|
||||
new RevHubOrientationOnRobot(
|
||||
RevHubOrientationOnRobot.LogoFacingDirection.LEFT,
|
||||
RevHubOrientationOnRobot.UsbFacingDirection.UP));
|
||||
IMU.Parameters parameters = new IMU.Parameters(
|
||||
new RevHubOrientationOnRobot(
|
||||
RevHubOrientationOnRobot.LogoFacingDirection.LEFT,
|
||||
RevHubOrientationOnRobot.UsbFacingDirection.UP));
|
||||
|
||||
imu.initialize(parameters);
|
||||
imu.resetYaw();
|
||||
imu.initialize(parameters);
|
||||
imu.resetYaw();
|
||||
|
||||
//Motors
|
||||
frDrive = new MotorEx(hardwareMap, "FrontRight");
|
||||
flDrive = new MotorEx(hardwareMap, "FrontLeft");
|
||||
brDrive = new MotorEx(hardwareMap, "BackRight");
|
||||
blDrive = new MotorEx(hardwareMap, "BackLeft");
|
||||
//Motors
|
||||
frDrive = new MotorEx(hardwareMap, "FrontRight");
|
||||
flDrive = new MotorEx(hardwareMap, "FrontLeft");
|
||||
brDrive = new MotorEx(hardwareMap, "BackRight");
|
||||
blDrive = new MotorEx(hardwareMap, "BackLeft");
|
||||
|
||||
flDrive.motor.setDirection(DcMotorSimple.Direction.FORWARD);
|
||||
frDrive.motor.setDirection(DcMotorSimple.Direction.FORWARD);
|
||||
blDrive.motor.setDirection(DcMotorSimple.Direction.FORWARD);
|
||||
brDrive.motor.setDirection(DcMotorSimple.Direction.FORWARD);
|
||||
flDrive.motor.setDirection(DcMotorSimple.Direction.FORWARD);
|
||||
frDrive.motor.setDirection(DcMotorSimple.Direction.FORWARD);
|
||||
blDrive.motor.setDirection(DcMotorSimple.Direction.FORWARD);
|
||||
brDrive.motor.setDirection(DcMotorSimple.Direction.FORWARD);
|
||||
|
||||
flDrive.motor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
||||
frDrive.motor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
||||
blDrive.motor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
||||
brDrive.motor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
||||
flDrive.motor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
||||
frDrive.motor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
||||
blDrive.motor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
||||
brDrive.motor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
||||
|
||||
flDrive.motor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||
frDrive.motor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||
blDrive.motor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||
brDrive.motor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||
flDrive.motor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||
frDrive.motor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||
blDrive.motor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||
brDrive.motor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exec () {
|
||||
|
||||
|
||||
transitPercent = -engine.gamepad1.left_stick_y * 100;
|
||||
flPower = lStickY / 100;
|
||||
robot.flDrive.motor.setPower(flPower);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exec () {
|
||||
transitPercent = -engine.gamepad1.left_stick_y * 100;
|
||||
flPower = lStickY / 100;
|
||||
flDrive.motor.setPower(flPower);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user