Package com.grt192.mechanism.breakaway

Examples of com.grt192.mechanism.breakaway.GRTBreakawayRobotBase


//        GRTGyro gyro = new GRTGyro(7, 15, "BaseGyro");
        System.out.println("Switches Initialized");

        // Mechanisms
        robotbase = new RobotBase(leftDT1, leftDT2, rightDT1, rightDT2);
        driverStation = new DriverStation(primary, secondary);
        System.out.println("Mechanisms Initialized");

        // camera = new CameraAssembly();
        // System.out.println("Camera Initialized");
View Full Code Here


        // analog inputs
        InternetRPC rpc = new InternetRPC(180);
        rpc.start();
        BatterySensor s = new BatterySensor(10);
        s.start();
        VoltageMessenger messenger = new VoltageMessenger(rpc, 23, s);
//        GRTPotentiometer batterySensor = new GRTPotentiometer(1, 50,
//                "batteryVoltage");
//        batterySensor.start();
//        GRTGyro gyro = new GRTGyro(7, 15, "BaseGyro");
        System.out.println("Switches Initialized");
View Full Code Here

        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

    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

            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

        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

       
    }

    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

        }


    }
    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

//        batterySensor.start();
//        GRTGyro gyro = new GRTGyro(7, 15, "BaseGyro");
        System.out.println("Switches Initialized");

        // Mechanisms
        robotbase = new RobotBase(leftDT1, leftDT2, rightDT1, rightDT2);
        driverStation = new DriverStation(primary, secondary);
        System.out.println("Mechanisms Initialized");

        // camera = new CameraAssembly();
        // System.out.println("Camera Initialized");
View Full Code Here

        master = MASTER_DEFAULT_STATE;
        auto = AUTO_DEFAULT_STATE;
    }

    public void initMechanism(){
        om = new HHLEDMechanism();
        addMechanism(MECHANISM_ID, om);
    }
View Full Code Here

TOP

Related Classes of com.grt192.mechanism.breakaway.GRTBreakawayRobotBase

Copyright © 2018 www.massapicom. 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.