Search in sources :

Example 1 with FollowerWheel

use of com.team2753.subsystems.FollowerWheel in project Relic_Main by TeamOverdrive.

the class TestFollowerWheel method runOpMode.

@Override
public void runOpMode() throws InterruptedException {
    Drive mDrive = new Drive();
    mDrive.init(this, true);
    mDrive.zeroSensors();
    FollowerWheel mFollow = new FollowerWheel();
    mFollow.init(this, false);
    FollowerDrive followerDrive = new FollowerDrive(mDrive, mFollow);
    telemetry.addData("Hello", "");
    telemetry.update();
    waitForStart();
    ElapsedTime t = new ElapsedTime();
    mDrive.setRunMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
    mDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.FLOAT);
    while (opModeIsActive()) {
        followerDrive.update();
        telemetry.addData("X", followerDrive.getX());
        telemetry.addData("Y", followerDrive.getY());
        telemetry.addData("Radius", followerDrive.radius());
        telemetry.addData("Angle", followerDrive.angle());
        telemetry.addData("Real Angle", mDrive.getGyroAngleRadians());
        telemetry.update();
    }
    mDrive.setLeftRightPower(0, 0);
    telemetry.addData("X", followerDrive.getX());
    telemetry.addData("Y", followerDrive.getY());
    telemetry.update();
    while (opModeIsActive()) Thread.yield();
}
Also used : FollowerDrive(com.team2753.splines.FollowerDrive) Drive(com.team2753.subsystems.Drive) FollowerDrive(com.team2753.splines.FollowerDrive) ElapsedTime(com.qualcomm.robotcore.util.ElapsedTime) FollowerWheel(com.team2753.subsystems.FollowerWheel)

Aggregations

ElapsedTime (com.qualcomm.robotcore.util.ElapsedTime)1 FollowerDrive (com.team2753.splines.FollowerDrive)1 Drive (com.team2753.subsystems.Drive)1 FollowerWheel (com.team2753.subsystems.FollowerWheel)1