We have been trying to use Network tables to grab variables from RoboRealm and use them in our robot program. We keep encountering an error whenever we even remotely use the NetworkTables class in our code.
Code:
ERROR Unhandled exception instantiating robot org.usfirst.frc.team4959.robot.Robot java.lang.IllegalStateException: Network tables has already been initialized at [edu.wpi.first.wpilibj.networktables.NetworkTable.checkInit(NetworkTable.java:31), edu.wpi.first.wpilibj.networktables.NetworkTable.setPersistentFilename(NetworkTable.java:123), edu.wpi.first.wpilibj.RobotBase.<init>(RobotBase.java:63), edu.wpi.first.wpilibj.IterativeRobot.<init>(IterativeRobot.java:57), org.usfirst.frc.team4959.robot.Robot.<init>(Robot.java:26), sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method), sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62), sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45), java.lang.reflect.Constructor.newInstance(Constructor.java:408), java.lang.Class.newInstance(Class.java:433), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:204)]
We believe due to the error that somehow the Network Table we are trying to create has already been created,but have no idea on how to use it in our code.
It is possible we are misusing RoboRealm as this is our first year using the software. We followed the basic tutorial and used the basic vision tracking file provided by RoboRealm. From there we have added our axis camera and successfully gotten feed into RoboRealm. After all the functions provided by the file made by RoboRealm we have created a network table to send variables though and selected the variables we want to send into the network.
If you need any more information on our code just ask. You can find our git hub
here
We have not been able to find any other fix from our research on the internet (like 6th page of Google deep) so if anyone has an idea as to what to do or what we are doing wrong please help. Thank you!