Package com.grt192.core

Examples of com.grt192.core.Command


     * @param rightValue
     */
    public void tankDrive(double leftValue, double rightValue) {
        ((GRTDriveTrain) getActuator("DriveTrain")).setDriveMode(
                GRTDriveTrain.TANK_DRIVE);
        Command c1 = new Command(leftValue, 0);
        Command c2 = new Command(rightValue, 0);
        getActuator("DriveTrain").enqueueCommands(new Command[]{c1, c2});
    }
View Full Code Here


                    GRTDriveTrain.ARCADE_SPIN_DRIVE);
        } else {
            ((GRTDriveTrain) getActuator("DriveTrain")).setDriveMode(
                    GRTDriveTrain.ARCADE_DRIVE);
        }
        Command c1 = new Command(x, 0);
        Command c2 = new Command(y, 0);
        getActuator("DriveTrain").enqueueCommands(new Command[]{c1, c2});
    }
View Full Code Here

        masterLED.start();
        autoLED.start();

        System.out.println("Turning on LEDs");
        //read default states from the Controller
        masterLED.enqueueCommand(new Command
                (HHLEDController.MASTER_DEFAULT_STATE? GRTLED.TURN_ON: GRTLED.TURN_OFF));
        autoLED.enqueueCommand(new Command
                (HHLEDController.AUTO_DEFAULT_STATE? GRTLED.TURN_ON: GRTLED.TURN_OFF));
    }
View Full Code Here

//        }
//    }

    public void setMasterLED(boolean on) {
        if (on) {
            masterLED.enqueueCommand(new Command(GRTLED.TURN_ON));
        } else {
            masterLED.enqueueCommand(new Command(GRTLED.TURN_OFF));
        }
    }
View Full Code Here

            masterLED.enqueueCommand(new Command(GRTLED.TURN_OFF));
        }
    }
    public void setAutoLED(boolean on) {
        if (on) {
            autoLED.enqueueCommand(new Command(GRTLED.TURN_ON));
        } else {
            autoLED.enqueueCommand(new Command(GRTLED.TURN_OFF));
        }
    }
View Full Code Here

    }

    public void tankDrive(double leftValue, double rightValue) {
        // the negative sign is for making it so that the joystick isn't flipped
        if (!automatedDrive) {
            Command c1 = new Command(leftValue, 0);
            Command c2 = new Command(rightValue, 0);
            getActuator("LeftJaguar1").enqueueCommand(c1);
            getActuator("LeftJaguar2").enqueueCommand(c1);
            getActuator("RightJaguar1").enqueueCommand(c2);
            getActuator("RightJaguar2").enqueueCommand(c2);
        }
View Full Code Here

    }
   
    public void oneStickDrive(double magnitude, double angle) { //point turn
        if (!automatedDrive) {
            double turnAngle = turn(angle, getAngle());
            Command c1;
            Command c2;

            double positiveSpeed = S_C_BASE_VALUE + (1 - S_C_BASE_VALUE) * magnitude;
            double negativeSpeed = S_C_BASE_VALUE + (1 - S_C_BASE_VALUE) * magnitude;

            if (turnAngle > 0) {
                c1 = new Command(positiveSpeed, 0);
                c2 = new Command(negativeSpeed, 0);
            } else {
                if (turnAngle < 0) {
                    c1 = new Command(negativeSpeed, 0);
                    c2 = new Command(positiveSpeed, 0);
                } else {
                    c1 = new Command(0, 0);
                    c2 = new Command(0, 0);
                }
            }

            getActuator("LeftJaguar1").enqueueCommand(c1);
            getActuator("LeftJaguar2").enqueueCommand(c1);
View Full Code Here

        }
    }

    public void overTheBump() {
        automatedDrive = true;
        Command c1 = new Command(1, 0);
        Command c2 = new Command(1, 0);
        getActuator("LeftJaguar1").enqueueCommand(c1);
        getActuator("LeftJaguar2").enqueueCommand(c1);
        getActuator("RightJaguar1").enqueueCommand(c2);
        getActuator("RightJaguar2").enqueueCommand(c2);
        try {
            Thread.sleep(1000);
        } catch (InterruptedException ex) {
            ex.printStackTrace();
        }
        if (automatedDrive) {
            Command c3 = new Command(1, 0);
            Command c4 = new Command(1, 0);
            getActuator("LeftJaguar1").enqueueCommand(c3);
            getActuator("LeftJaguar2").enqueueCommand(c3);
            getActuator("RightJaguar1").enqueueCommand(c4);
            getActuator("RightJaguar2").enqueueCommand(c4);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            }
        }
        if (automatedDrive) {
            Command c3 = new Command(1, 0);
            Command c4 = new Command(1, 0);
            getActuator("LeftJaguar1").enqueueCommand(c3);
            getActuator("LeftJaguar2").enqueueCommand(c3);
            getActuator("RightJaguar1").enqueueCommand(c4);
            getActuator("RightJaguar2").enqueueCommand(c4);
            try {
View Full Code Here

    public boolean hitSwitch() {
        return getSensor("LimitSwitch").getState("State") == Sensor.TRUE;
    }

    public void setSpeed(double speed) {
        getActuator("Motor").enqueueCommand(new Command(speed));
    }
View Full Code Here

        getActuator("Motor").enqueueCommand(new Command(speed));
    }

    public void turnServo(double angle) {
        if (0 <= angle && angle <= 180) {
            getActuator("Servo").enqueueCommand(new Command(angle));
        }
    }
View Full Code Here

TOP

Related Classes of com.grt192.core.Command

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.