Examples of GRTDriverStation


Examples of com.grt192.mechanism.GRTDriverStation

        addMechanism("RobotBase", rb);
        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.GRTDriverStation

    BenchFinaleController finaleController;
    BenchFinaleMechanism finaleMechanism;

    public MainRobot() {
        benchMechanism = new BenchDriveTrain(8, 10, 7, 9, true);
        GRTDriverStation ds = new GRTDriverStation(1, 2, 3);
        benchController = new BenchDriveController(ds, (BenchDriveTrain) benchMechanism);
        teleopControllers.addElement(benchController);

        kicker = new BenchKicker(2, 1, true);
        kickerController = new BenchKickerController(kicker, ds);
View Full Code Here

Examples of com.grt192.mechanism.GRTDriverStation

    public void setMode(int mode) {
        this.mode = mode;
    }

    public void act() {
        GRTDriverStation driverStation =
                ((GRTDriverStation) getMechanism("DriverStation"));
        //Reverse to match drivetrain direction
        double x = 0;
        double y = 0;
       
        switch(mode){
            case GRTDriveTrain.TANK_DRIVE:
                x = -1 * driverStation.getYLeftJoystick();
                y = -1 * driverStation.getYRightJoystick();
                ((GRTRobotBase) getMechanism("RobotBase")).tankDrive(x, y)
                break;
            case GRTDriveTrain.ARCADE_DRIVE:
                x = -1 * driverStation.getXRightJoystick();
                y = -1 * driverStation.getYRightJoystick();
                ((GRTRobotBase) getMechanism("RobotBase")).arcadeDrive(x, y);
                break;
            case GRTDriveTrain.ARCADE_SPIN_DRIVE:
                x = -1 * driverStation.getXRightJoystick();
                y = -1 * driverStation.getYRightJoystick();
                ((GRTRobotBase) getMechanism("RobotBase")).arcadeDrive(x, y, true);
                break;
        }
        System.out.println("Drive "+x+" , "+y);
       
View Full Code Here

Examples of com.grt192.mechanism.GRTDriverStation

    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);
    recovery = new Recovery(recovery1, recovery2, recoveryUpSwitch,
        recoveryGroundSwitch);
View Full Code Here

Examples of com.grt192.mechanism.GRTDriverStation

  // Global Controllers
  private DashBoardController dashboardController;

  public CannonBot() {
    driveTrain = new CBTankDriveTrain(2,4, 2);
    driverStation = new GRTDriverStation(1, 2, 3);
    compressor = new GRTCompressor(1, 1);
    cannon = new CBCannon(1, 2, 3, 4, compressor);
    arm = new CBArm(5, 6, compressor);
    target = new Target(new GRTTwoWaySolenoid(1,2));
   
View Full Code Here

Examples of com.grt192.mechanism.GRTDriverStation

       
    }

    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;
                break;

        }

        if (ds.getLeftButton(6)) {
            printingData = !printingData;
            System.out.println(printingData ? "printing" : "not pringing");
        }
        if (printingData) {
            printData();
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.