ligerbots / Steamworks2017Robot

LigerBots robot code for FIRST Robotics Competition Steamworks
MIT License
2 stars 1 forks source link

NetworkTables double-initialization #1

Closed xeniarose closed 7 years ago

xeniarose commented 7 years ago

Error text:

18:35:04.313 ERROR: Could not instantiate robot org.ligerbots.steamworks.Robot!
WARNING: Robots don't quit!
Error at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:218): ERROR Unhandled exception instantiating robot org.ligerbots.steamworks.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:160), 
edu.wpi.first.wpilibj.RobotBase.<init>(RobotBase.java:63), 
edu.wpi.first.wpilibj.IterativeRobot.<init>(IterativeRobot.java:49), 
org.ligerbots.steamworks.Robot.<init>(Robot.java:23), 
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:216)] 

Solution: move subsystem constructors into robotInit() - and try not to initialize anything else before robotInit in the future.