Using the LifeCam-3000, we are attempting to send a feed to the SmartDashboard. To do this, we grab from it using the IMAQdx methods of com.ni.vision.NIVision. We also need to alter the exposure of the camera, so added the line:
(new USBCamera("cam0")).setExposureManual(20);
The issue is that using both on the same camera leads to the following error:
ERROR Unhandled exception: VisionException [com.ni.vision.VisionException: IMAQdxError: -1074360310: Camera is already in use.] at
[com.ni.vision.NIVision._IMAQdxOpenCamera(Native Method),
com.ni.vision.NIVision.IMAQdxOpenCamera(NIVision.java:30334),
edu.wpi.first.wpilibj.vision.USBCamera.openCamera(USBCamera.java:72),
edu.wpi.first.wpilibj.vision.USBCamera.<init>(USBCamera.java:63),
org.usfirst.frc.team1719.robot.Robot.robotInit(Robot.java:78),
edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:72),
edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:241)]
WARNING: Robots don't quit!
There is no way that we found to use the IMAQdx session to change the exposure, so we ask here for aid.
Usually when we get the “Robots don’t quit” error, it is because we are initializing one sensor in more than one place. If that’s not it, then we got nothing.
That’s exactly what the problem is. We are trying to figure out a way to either convert an IMAQdx session ID to a USBCamera object or to set the exposure directly from the IMAQdx session ID.
After you make the cam0, make a new line and call the method to set the exposure there. Try messing around with higher and lower values to see what happens. Other then that, I’m not really sure what else there is I can do without seeing your code.