예제 #1
0
  public void robotInit() {
    log("RobotInit called. Initializing NetworkTabes...");
    try {
      NetworkTable.setIPAddress("10.36.99.2");
      NetworkTable.setServerMode();
      NetworkTable.setTeam(3699);
      NetworkTable.initialize();

    } catch (Exception be) {
      error("Error in robotInit: \n " + be.getMessage(), 0);
      error("Reocourrence Test! You shouldnt see this!", 0);
    }
    log("Init SmartDashboard...");
    this.server = NetworkTable.getTable("SmartDashboard");

    log("" + this.server.containsKey("/SmartDashboard/"));
    log("" + this.server.containsKey("/SmartDashboard/FPS"));
    log("" + NetworkTable.DEFAULT_PORT);
    this.server.putString("_PREINIT0", "_PREINIT::0");
    this.server.putString("_PREINIT1", "_PREINIT::1");
    this.server.putString("_PREINIT2", "_PREINIT::2");

    /*LiveWindow.addActuator("Elevator", "Elevator Intake", Elevator_intake);
    LiveWindow.addActuator("Elevator", "Elevator Gearbox", Elevator_motor);
    LiveWindow.addActuator("Elevator", "Elevator Outtake", Elevator_outtake);
    LiveWindow.addActuator("Intake", "Intake", Elevator_motor);*/

    log("Disabling RobotDrive Saftey... :D");
    robotdrive.setSafetyEnabled(false);

    // autoChooser = new SendableChooser();
    // autoChooser.addDefault("Default 3 Discs", this.auto_shoot);
    // SmartDashboard.putData("Autonomous mode chooser",autoChooser);

  }
예제 #2
0
 public static void setPort(int port) {
   if (_port == port) return;
   _port = port;
   try {
     NetworkTable.shutdown();
   } catch (IllegalStateException ex) {
   }
   NetworkTable.setPort(port);
   NetworkTable.initialize();
 }
예제 #3
0
 public static void setHost(String host) {
   if (host != "") {
     // Use the given host
   } else if (_usemDNS) {
     host = "roboRIO-" + _team + "-frc.local";
   } else {
     host = "10." + (_team / 100) + "." + (_team % 100) + ".2";
   }
   if (_host.equals(host)) return;
   _host = host;
   System.out.println("Host: " + host);
   try {
     NetworkTable.shutdown();
   } catch (IllegalStateException ex) {
   }
   NetworkTable.setIPAddress(host);
   NetworkTable.setNetworkIdentity(identity);
   NetworkTable.initialize();
 }