We had been having much trouble with our robot's camera system as well, until we came to this thread.
This code worked perfectly in Java.
For testing purposes, we created a new
SimpleRobot subclass using the RobotTemplate default method. We imported the wpilibj package and the camera package. And this was what followed it.
Code:
public class RobotTemplate extends SimpleRobot
{
public RobotTemplate()
{
Timer.delay(8);
AxisCamera camera = AxisCamera.getInstance();
}
// The other default methods placed here.
}
To prevent waiting 8 seconds before your robot will run, the
AxisCamera camera = AxisCamera.getInstance(); line can be put in the
teleopInit() method of an
IterativeRobot subclass.
Hopes this helps!