Camera not sending images for 7 seconds when enabled

Hello from team 1551. This year we are trying to do some simple vision stuff in autonomous to search for the hot goal. All we want to do is search for a hot goal, and then shoot the ball accordingly, so we hope to only have to run the loop once and not have to deal with a second image processor or anything like that. We are using the Wind River VisionSample2014 example because we are inexperienced with vision and a fairly small team. The only changes we have made to the example code is threshold values adjusted for our camera, and uncommenting the lines that save images to the cRIO. When we run the program, it spits out an error for around 5-7 seconds, and then runs normally. We assume the error is occurring because the camera is not outputting an image, because after the error stops, we can detect hot goals, and use the information to our advantage. We can always see the camera’s output in the driver station and in the browser, and only the code is incapable of reading the image for those few seconds. For testing purposes we set the code to stop until it gets an image, just to confirm that there is nothing running in the code that would cause the change, but the error still occurs.

Just for reference, here is the error that is popping up.

>>>>ERROR: status = -1074396154 (0xBFF60406) ImaqThreshold error: …in ComputeThreshold() in C:/WindRiver/workspace/WPILib/Vision/ColorImage.cpp at line 37

Thanks for any help you can offer

We tried using the default code that’s in Windriver but that didn’t seem to work out for me either.

I recommend you check out RoboRealm for your image processing. This year was the first year our team opted to try out image code and so far with all the experimentation, we found RoboRealm to be the best. It isn’t a complicated software to use and its very versatile in its uses. The serial key comes in the Kit of Parts.

Give RoboRealm a couple of days and you’ll be fine.

I don’t have much experience with the C++ camera code, but it sounds like the constructor for the camera is trying to communicate to the camera, and the operations are timing out. At one point LabVIEW did this, and the delay was actually that the code was trying to set properties and each had a one second timeout.

Anyway, you may try moving the camera code into your robot init or into disabled code. You can also look at it and see if the timeouts are exposed or if the property sets are really needed.

Greg McKaskle

Get the instance of the camera in robot init. That way it starts the connection when the robot turns on.