Package ca.teamdave.carusorobot

Source Code of ca.teamdave.carusorobot.CarusoRobot

/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package ca.teamdave.carusorobot;


import ca.teamdave.caruso.AbstractRobot;
import ca.teamdave.caruso.Caruso;
import ca.teamdave.caruso.CarusoException;
import ca.teamdave.caruso.Controller;
import ca.teamdave.caruso.Machine;
import ca.teamdave.caruso.config.ConfigTable;
import com.test.simplecarusorobot.SimpleFRCBotPhysical;
import com.test.simplecarusorobot.SimpleFRCController;
import edu.wpi.first.wpilibj.IterativeRobot;

/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the IterativeRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class CarusoRobot extends IterativeRobot {

    private Caruso caruso;

    public CarusoRobot() {
        super();

        Machine machine = new Machine();
        Controller controller = new SimpleFRCController();
        AbstractRobot robot = new SimpleFRCBotPhysical();

        this.caruso = new Caruso(controller, machine, robot);
    }
    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    public void robotInit() {
        try {
            // TODO: this config object should be initialized properly here
            this.caruso.robotInit(new ConfigTable());
        } catch (CarusoException ex) {
            ex.printStackTrace();
            this.getWatchdog().kill();
        }

    }

    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() {
        try {
            this.caruso.periodicUpdate();
        } catch (CarusoException ex) {
            ex.printStackTrace();
            this.getWatchdog().kill();
        }
    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
        try {
            this.caruso.periodicUpdate();
        } catch (CarusoException ex) {
            ex.printStackTrace();
            this.getWatchdog().kill();
        }
    }

    public void disabledPeriodic() {
        try {
            this.caruso.periodicUpdate();
        } catch (CarusoException ex) {
            ex.printStackTrace();
            this.getWatchdog().kill();
        }
    }
   
}
TOP

Related Classes of ca.teamdave.carusorobot.CarusoRobot

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.