Fix ordering between CameraServer.getInstance and UsbCamera creation (#69)

If the CameraServer instance is started after the UsbCamer is created, it
never gets the source created event to actually build the NetworkTable table.
This commit is contained in:
Peter Johnson
2019-01-13 21:23:44 -08:00
committed by GitHub
parent 64b9491e15
commit 08163c0681
4 changed files with 4 additions and 4 deletions
@@ -134,8 +134,8 @@ def readConfig():
"""Start running the camera."""
def startCamera(config):
print("Starting camera '{}' on {}".format(config.name, config.path))
camera = UsbCamera(config.name, config.path)
inst = CameraServer.getInstance()
camera = UsbCamera(config.name, config.path)
server = inst.startAutomaticCapture(camera=camera, return_server=True)
camera.setConfigJson(json.dumps(config.config))