Examples of GRTBreakawayRobotBase


Examples of com.grt192.mechanism.breakaway.GRTBreakawayRobotBase

        addMechanism("DriverStation", ds);
    }

    public void act() {
        GRTDriverStation ds = (GRTDriverStation) getMechanism("DriverStation");
        GRTBreakawayRobotBase rb =
                (GRTBreakawayRobotBase) getMechanism("RobotBase");
        switch (driveMode) {
            case GRTBreakawayRobotBase.TANK_DRIVE:
                rb.tankDrive(ds.getYLeftJoystick(), ds.getYRightJoystick());
                break;
        }
    }
View Full Code Here

Examples of com.grt192.mechanism.breakaway.GRTBreakawayRobotBase

    GRTSwitch recoveryUpSwitch = new GRTSwitch(2, 50, "RecoveryUp");
    GRTSwitch recoveryGroundSwitch = new GRTSwitch(7, 50, "RecoveryDown");
    System.out.println("Switches Initialized");

    // Mechanisms
    robotbase = new GRTBreakawayRobotBase(leftDT1, leftDT2, rightDT1,
        rightDT2, batterySensor, gyro);
    driverStation = new GRTDriverStation(leftJoyStick, rightJoyStick,
        secondaryJoyStick);
    shooter = new KickerOmega(kicker, kickerSwitch);
    rollers = new Roller(roller1, roller2);
View Full Code Here

Examples of com.grt192.mechanism.breakaway.GRTBreakawayRobotBase

            posY = ZONE3STARTY;
        }

    }
    public void act() {
        GRTBreakawayRobotBase rb = (GRTBreakawayRobotBase) getMechanism("RobotBase");
        double angle = rb.getAngle();
        double leftDist = rb.getLeftDist();
        double rightDist = rb.getRightDist();

        count++;
        if (count <= TOTAL_WARM_UP_COUNT) {
            warmUpSum += angle - prevAngle;
            prevAngle = angle;
View Full Code Here

Examples of com.grt192.mechanism.breakaway.GRTBreakawayRobotBase

        GRTSwitch kickerSwitch = new GRTSwitch(5, 50, "KickLimit");
        GRTSwitch recoveryUpSwitch = new GRTSwitch(6, 50, "");
        GRTSwitch recoveryGroundSwitch = new GRTSwitch(7, 50, "");

        //Mechanisms
        robotbase = new GRTBreakawayRobotBase(leftDT1, leftDT2, rightDT1, rightDT2,
                ax1, gy1,
                leftEn, rightEn);
        driverStation = new GRTDriverStation(leftJoyStick,
                rightJoyStick,
                secondaryJoyStick);
View Full Code Here

Examples of com.grt192.mechanism.breakaway.GRTBreakawayRobotBase

       
    }

    public void act() {
        GRTDriverStation ds = (GRTDriverStation) getMechanism("DriverStation");
        GRTBreakawayRobotBase rb =
                (GRTBreakawayRobotBase) getMechanism("RobotBase");

        if (ds.getRightButton(9) && driveMode == GRTBreakawayRobotBase.TANK_DRIVE) {
            driveMode = GRTBreakawayRobotBase.CAR_DRIVE;
        } else if (ds.getRightButton(9) && driveMode == GRTBreakawayRobotBase.CAR_DRIVE){
            driveMode = GRTBreakawayRobotBase.TANK_DRIVE;
        }

        switch (driveMode) {
            case GRTBreakawayRobotBase.TANK_DRIVE:
                rb.tankDrive(ds.getYLeftJoystick(), -ds.getYRightJoystick());
                break;
            case GRTBreakawayRobotBase.CAR_DRIVE:
                rb.carDrive(ds.getXRightJoystick(),ds.getYRightJoystick(),
                        Math.abs(ds.getYRightJoystick()) < SPIN_THRESHOLD);
                break;
            case GRTBreakawayRobotBase.ONE_STICK_DRIVE:
                rb.oneStickDrive(
                        Util.distance(Util.roundValue(
                        ds.getYLeftJoystick()),
                        Util.roundValue(ds.getYRightJoystick())),
                        ((GRTJoystick) ds.getSensor("leftJoystick")).getState("JoystickAngle"));
                        driveMode = GRTBreakawayRobotBase.TANK_DRIVE;
View Full Code Here

Examples of com.grt192.mechanism.breakaway.GRTBreakawayRobotBase

        }


    }
    public void printData() {
        GRTBreakawayRobotBase rb =
                (GRTBreakawayRobotBase) getMechanism("RobotBase");
        System.out.println("gryo: " + rb.getGyroAngle());
        System.out.println("x feet: " + rb.getX() / 12.0);
        System.out.println("y feet: " + rb.getY() / 12.0);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.