/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ca.teamdave.carusoshades;
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 ca.teamdave.caruso.logger.Logger;
import com.test.linearrobot.LinearRobotController;
import com.test.linearrobot.LrNames;
import com.test.simplecarusorobot.LinearRobotSimulated;
import com.test.simplecarusorobot.LiveGraphLogger;
import com.test.simplecarusorobot.SimpleFRCBotSimulated;
import com.test.simplecarusorobot.SimpleFRCController;
import com.test.simplecarusorobot.StdoutLogger;
/**
*
* @author leigh
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws CarusoException {
Logger logger = new LiveGraphLogger("/home/leigh/.myDat", "/home/leigh/LiveGraph.1.14.Application.bin/LiveGraph.1.14.Application.bin.jar");
Machine machine = new Machine(logger);
Controller controller = new LinearRobotController();
AbstractRobot robot = new LinearRobotSimulated();
Caruso caruso = new Caruso(controller, machine, robot);
caruso.robotInit(createConfig());
// run some frames
for (int i = 0; i < 280; i++) {
caruso.periodicUpdate();
}
}
private static ConfigTable createConfig() throws CarusoException {
ConfigTable res = new ConfigTable();
// This would normally be loaded from a text file in flash
res.setDouble(LrNames.CYCLE_TIME, 0.05);
res.setDouble(LrNames.PID_P, 5.0);
res.setDouble(LrNames.PID_I, 0.0);
res.setDouble(LrNames.PID_D, 0.0);
res.setDouble(LrNames.PID_EPS, 0.01);
res.setDouble(LrNames.D_FF, 1.0);
res.setDouble(LrNames.A_FF, 1.0);
res.setDouble(LrNames.V_FF, 0.5);
res.setDouble(LrNames.ACCEL_MAX, 0.25);
res.setDouble(LrNames.DECCEL_MAX, 0.5);
res.setDouble(LrNames.SPEED_MAX, 1.0);
return res;
}
}