Package com.grt192.controller.breakaway.teleop

Source Code of com.grt192.controller.breakaway.teleop.BreakawayTeleopDriveController

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.grt192.controller.breakaway.teleop;

import com.grt192.core.StepController;
import com.grt192.mechanism.breakaway.GRTBreakawayRobotBase;
import com.grt192.mechanism.GRTDriverStation;
import com.grt192.sensor.GRTJoystick;
import com.grt192.utils.Util;

/**
*
* @author Bonan, James, Ryo
*/
public class BreakawayTeleopDriveController extends StepController {

    public static final double SPIN_THRESHOLD = .1;
    private int driveMode = GRTBreakawayRobotBase.TANK_DRIVE;

    public BreakawayTeleopDriveController(GRTBreakawayRobotBase rb, GRTDriverStation ds) {
        super();
        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;
        }
    }

}
TOP

Related Classes of com.grt192.controller.breakaway.teleop.BreakawayTeleopDriveController

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.