本文整理汇总了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());
}
}
}
示例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;
}
示例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());
}
示例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();
}
示例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();
}
}
示例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();
}