当前位置: 首页>>代码示例>>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;未经允许,请勿转载。