Ozuru
10-02-2015, 11:10
Hello,
I'm currently having some issues with NetworkTables. I've created a standalone-application for vision processing and would like to send data to the RoboRIO. I keep getting an exception saying that the key is not defined/it can't access it -- I fear it is not being created and am unsure if I'm doing something wrong. Here's what I'm doing.
Vision Processing Application:
public static NetworkTable outputTable;
---
//main thread of program
public void run() {
NetworkTable.setClientMode();
NetworkTable.setIPAddress("10.25.59.2");
outputTable = NetworkTable.getTable("vision");
}
---
// semi-pseudocode, if it finds the tote it invokes that function with those parameters
if(foundTote) {
outputTable.putBoolean("found_tote", true);
}
Robot Code:
public static NetworkTable visionTable;
---
// robotInit in Robot.java
public void robotInit() {
visionTable = NetworkTable.getTable("vision");
}
---
// SmartDashboard syncer/setter function
public void sendSensorData() {
try{
SmartDashboard.putBoolean("Found Tote", visionTable.getBoolean("found_tote"));
} catch(Exception e) {System.out.println(e);}
}
I have a feeling that I may need to do something else but, due to the limited documentation, I cannot find out what I'm doing wrong. I'd love to hear your ideas.
Thanks.
I'm currently having some issues with NetworkTables. I've created a standalone-application for vision processing and would like to send data to the RoboRIO. I keep getting an exception saying that the key is not defined/it can't access it -- I fear it is not being created and am unsure if I'm doing something wrong. Here's what I'm doing.
Vision Processing Application:
public static NetworkTable outputTable;
---
//main thread of program
public void run() {
NetworkTable.setClientMode();
NetworkTable.setIPAddress("10.25.59.2");
outputTable = NetworkTable.getTable("vision");
}
---
// semi-pseudocode, if it finds the tote it invokes that function with those parameters
if(foundTote) {
outputTable.putBoolean("found_tote", true);
}
Robot Code:
public static NetworkTable visionTable;
---
// robotInit in Robot.java
public void robotInit() {
visionTable = NetworkTable.getTable("vision");
}
---
// SmartDashboard syncer/setter function
public void sendSensorData() {
try{
SmartDashboard.putBoolean("Found Tote", visionTable.getBoolean("found_tote"));
} catch(Exception e) {System.out.println(e);}
}
I have a feeling that I may need to do something else but, due to the limited documentation, I cannot find out what I'm doing wrong. I'd love to hear your ideas.
Thanks.