Hello. I am attempting to use networkTables on the robot. Unfortunately, I am getting the same error over and over:
java.lang.IllegalStateException: Network tables has already been initialized.
Does anyone know why this may be happpening.
I strip the code down to the barebones.
The code is below:
public class RobotTemplate extends IterativeRobot {
NetworkTable table;
public void robotInit() {
NetworkTable.setServerMode();
NetworkTable.setIPAddress("10.6.96.2");
table = NetworkTable.getTable("XYTable");
}
public void autonomousPeriodic() {
}
public void teleopPeriodic() {
table.putNumber("X", 3);
table.putNumber("Y", 4);
}
public void testPeriodic() {
}
}