Package com.grt192.core

Examples of com.grt192.core.Command


    }

    public void changeDTPos(boolean state, int side) {
         if (state) {
            if (side == LEFT) {
                this.DTShifter1.enqueueCommand(new Command(DTShifter1.ON));
            } else {
                this.DTShifter2.enqueueCommand(new Command(DTShifter2.ON));
            }
        } else {
            if (side == LEFT) {
                this.DTShifter1.enqueueCommand(new Command(DTShifter1.OFF));
            } else {
                this.DTShifter2.enqueueCommand(new Command(DTShifter2.OFF));
            }
        }
    }
View Full Code Here


        return driveMode;
    }
   
    public void executeCommand(Command c) {

        Command c1 = this.dequeue();
        switch (driveMode) {
            case 0: {
                if(c1 == null)
                    c1 = c;
                driveTrain.tankDrive(c.getValue(), c1.getValue());
                //left.set(c.getValue());
                //right.set(c1.getValue());
                break;
            }
            case 1: {
                driveTrain.arcadeDrive(c.getValue(), c1.getValue(), false);
                break;
            }
            case 2: {
                driveTrain.arcadeDrive(c.getValue(), c1.getValue(), true);
                break;
            }
            case 3: {
                driveTrain.drive(c.getValue(), c1.getValue());
                break;
            }
        }
    }
View Full Code Here

        addActuator("bottom4", bottomJag4);
    }

    public void testTimedPorts() {
        System.out.println("Running 1");
        bottomJag1.enqueueCommand(new Command(1.0, WAIT_TIME, true));
        try {
            Thread.sleep(WAIT_TIME);
        } catch (Exception e) {
        }
        ;
        System.out.println("Running 2");
        bottomJag2.enqueueCommand(new Command(1.0, WAIT_TIME, true));
        try {
            Thread.sleep(WAIT_TIME);
        } catch (Exception e) {
        }

        System.out.println("Running 3");
        bottomJag3.enqueueCommand(new Command(1.0, WAIT_TIME, true));
        try {
            Thread.sleep(WAIT_TIME);
        } catch (Exception e) {
        }

        System.out.println("Running 4");
        bottomJag4.enqueueCommand(new Command(1.0, WAIT_TIME, true));
        try {
            Thread.sleep(WAIT_TIME);
        } catch (Exception e) {
        }

        System.out.println("Running t1");
        topJag1.enqueueCommand(new Command(1.0, WAIT_TIME, true));
        try {
            Thread.sleep(WAIT_TIME);
        } catch (Exception e) {
        }

        System.out.println("Running t2");
        topJag2.enqueueCommand(new Command(1.0, WAIT_TIME, true));
        try {
            Thread.sleep(WAIT_TIME);
        } catch (Exception e) {
        }

        System.out.println("Running t3");
        topJag3.enqueueCommand(new Command(1.0, WAIT_TIME, true));
        try {
            Thread.sleep(WAIT_TIME);
        } catch (Exception e) {
        }

        System.out.println("Running t4");
        topJag4.enqueueCommand(new Command(1.0, WAIT_TIME, true));
        try {
            Thread.sleep(WAIT_TIME);
        } catch (Exception e) {
        }

        System.out.println("Running t5");
        topJag5.enqueueCommand(new Command(1.0, WAIT_TIME, true));
        try {
            Thread.sleep(WAIT_TIME);
        } catch (Exception e) {
        }
    }
View Full Code Here

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

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

        return getSensor("RecGroundSwitch").getState("State") == Sensor.TRUE;
    }

    //controls motor speed
    private void setSpeed(double input){
        getActuator("RecMotorA").enqueueCommand(new Command(input));
        getActuator("RecMotorB").enqueueCommand(new Command(input));
    }
View Full Code Here

        speed = 0;
        MainRobot.getInstance().addGlobalListener(this);
    }

    public void setLeftSpeed(double input) {
        getActuator("LeftRollerMotor").enqueueCommand(new Command(-input));
    }
View Full Code Here

    public void setLeftSpeed(double input) {
        getActuator("LeftRollerMotor").enqueueCommand(new Command(-input));
    }

    public void setRightSpeed(double input) {
        getActuator("RightRollerMotor").enqueueCommand(new Command(input));
    }
View Full Code Here

    public void rightPush() {
        setRightSpeed(PUSH);
    }

    public void stopRightRoller() {
        getActuator("RightRollerMotor").enqueueCommand(new Command(speed/2.0, 200));
        setRightSpeed(STOP);
    }
View Full Code Here

        getActuator("RightRollerMotor").enqueueCommand(new Command(speed/2.0, 200));
        setRightSpeed(STOP);
    }

    public void stopLeftRoller() {
        getActuator("LeftRollerMotor").enqueueCommand(new Command(speed/2.0, 200));
        setLeftSpeed(STOP);
    }
View Full Code Here

    public void tankDrive(double leftValue, double rightValue) {
        tankDrive(leftValue, rightValue, 0);
    }

    public void tankDrive(double leftValue, double rightValue, int time) {
        Command c1 = new Command(-leftValue, time);
        Command c2 = new Command(-rightValue, time);
        getActuator("LeftJaguar1").enqueueCommand(c1);
        getActuator("LeftJaguar2").enqueueCommand(c1);
        getActuator("RightJaguar1").enqueueCommand(c2);
        getActuator("RightJaguar2").enqueueCommand(c2);
    }
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.