本文整理匯總了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();
}