當前位置: 首頁>>代碼示例>>Java>>正文


Java NetworkTable.setClientMode方法代碼示例

本文整理匯總了Java中edu.wpi.first.wpilibj.networktables.NetworkTable.setClientMode方法的典型用法代碼示例。如果您正苦於以下問題:Java NetworkTable.setClientMode方法的具體用法?Java NetworkTable.setClientMode怎麽用?Java NetworkTable.setClientMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在edu.wpi.first.wpilibj.networktables.NetworkTable的用法示例。


在下文中一共展示了NetworkTable.setClientMode方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {
    NetworkTable.setClientMode();
    InetAddress address = InetAddress.getByName("roborio-1458-frc.local");
    NetworkTable.setIPAddress(address.getHostAddress());

    NetworkTable SmartDashboard = NetworkTable.getTable("SmartDashboard");

    Scanner s = new Scanner(System.in);

    //SmartDashboard.putNumber("TestValueJetson", 42);

    while(true) {
        if(s.hasNextInt()) {
            SmartDashboard.putNumber("TestValueJetson", s.nextInt());
        }
    }
}
 
開發者ID:FRC1458,項目名稱:turtleshell,代碼行數:18,代碼來源:Main.java

示例2: run

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
@SuppressWarnings("resource")
public static String run() {

	NetworkTable.setClientMode();
	NetworkTable.setIPAddress("10.17.97.1");
	NetworkTable networktable = NetworkTable.getTable("Network Table");

	double time = networktable.getNumber("Time", -1);
	double left = networktable.getNumber("Left", -1);
	double right = networktable.getNumber("Right", -1);

	return time +","+left+","+right;

}
 
開發者ID:ASL-Robotics,項目名稱:1797-2017,代碼行數:15,代碼來源:AccelerationLog.java

示例3: VisionNetworkTable

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public VisionNetworkTable() {
	NetworkTable.setClientMode();
	NetworkTable.setTeam(1294);
	nt = NetworkTable.getTable("vision");
	
	
	// send version information
	VersionInformation vi = new VersionInformation();
	nt.putString("version", vi.getVersion());
	nt.putString("author", vi.getAuthor());	
}
 
開發者ID:FRC-1294,項目名稱:frc2016vision,代碼行數:12,代碼來源:VisionNetworkTable.java

示例4: NetworkTablesInterface

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public NetworkTablesInterface() {
    NetworkTable.setClientMode();
    NetworkTable.setIPAddress(IPAddress);
    table = NetworkTable.getTable("datatable");
    hud = new ArduHUD();
    hud.initialize();
}
 
開發者ID:hatsunearu,項目名稱:OneDegreeNorth-NetworkTablesHUD,代碼行數:8,代碼來源:NetworkTablesInterface.java

示例5: run

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public void run() {
    // Load OpenCV native library
    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

    // Initialize NetworkTables
    if (!debug) {
        NetworkTable.setClientMode();
        NetworkTable.setIPAddress("10.3.16.2");
        table = NetworkTable.getTable("visionData");
    }

    // Setup the GUI
    setupGUI();

    if (debug) {
        processSampleImages();
        //while (true) {
        //    processSampleImage("sample_images/image1.jpg");
        //}
    } else {
        // Open the camera feed
        camera = new VideoCapture(kCameraAddress);

        // Process images from the camera
        processCameraFeed();
    }
}
 
開發者ID:LuNaTeCs-316,項目名稱:LuNaCV,代碼行數:28,代碼來源:LuNaCV.java

示例6: NTManager

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
@Inject
NTManager() {
  // We may have another instance of this method lying around
  NetworkTable.shutdown();

  // Redirect NetworkTables log messages to our own log files.  This gets rid of console spam,
  // and it also lets
  // us grep through NetworkTables messages just like any other messages.
  NetworkTablesJNI.setLogger((level, file, line, msg) -> {
    String filename = new File(file).getName();
    logger.log(ntLogLevels.get(level), String.format("NetworkTables: %s:%d %s", filename, line,
        msg));
  }, 0);

  NetworkTable.setClientMode();

  // When in headless mode, start and stop the pipeline based on the "GRIP/run" key.  This
  // allows robot programs
  // to control GRIP without actually restarting the process.
  NetworkTable.getTable("GRIP").addTableListener("run", (source, key, value, isNew) -> {
    if (gripMode == GripMode.HEADLESS) {
      if (!(value instanceof Boolean)) {
        logger.warning("NetworkTables value GRIP/run should be a boolean!");
        return;
      }

      if ((Boolean) value) {
        if (!pipelineRunner.isRunning()) {
          logger.info("Starting GRIP from NetworkTables");
          pipelineRunner.startAsync();
        }
      } else if (pipelineRunner.isRunning()) {
        logger.info("Stopping GRIP from NetworkTables");
        pipelineRunner.stopAsync();

      }
    }
  }, true);

  NetworkTable.shutdown();
}
 
開發者ID:WPIRoboticsProjects,項目名稱:GRIP,代碼行數:42,代碼來源:NTManager.java


注:本文中的edu.wpi.first.wpilibj.networktables.NetworkTable.setClientMode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。