As our first goal for the season, we would like to get a camera feed to the driver’s station.
Does anybody know the sample code necessary to accomplish this task?
Thanks.
As our first goal for the season, we would like to get a camera feed to the driver’s station.
Does anybody know the sample code necessary to accomplish this task?
Thanks.
There are two methods I know work well. You can connect the Axis Camera via crossover cable to your cRio and from there you can use the AxisCamera class in the wpilibj to get the camera instance. Or you can take another approach and connect it to the DLink directly and get the camera data directly without going through the cRio. If you want to go into image processing going through the cRio would be a slower choice and may introduce lag if you demand to much of it. If you bring it to the classmate you have more processing speed to help you process your image and not “bog down” your Rio.
I know that you can view the source code of the diffrent classes so you would probably have to look at the source code of the AxisCamera class and modify it to acommodate the method that Derek012 suggest where you bypass the crio.
Is it possible to use a usb breakout board and connect it to the sidecar?
connect your computer to your ethernet bridge through a straight-through CAT5. connect the camera to the bridge with a crossover cable.
set your computer IP to 192.168.0.6
enter the camera through a web browser by typing 192.168.0.90 to make sure you can connect.
then use the Setup Axis Camera program.
keep IP as 192.168.0.90
make subnet 255.0.0.0
in your code:
inside public INSERT CLASS NAME HERE(){
AxisCamera camera = AxisCamera.getInstance();
}
once everything is saved, plug the camera into CRIO port 2.
change computer IP to 10.TE.AM.5
make sure your driverstation is updated, run the code in, and you should get feed.
a little gift from team 3171: Westhampton Beach Hurricanes
This procedure will not work as listed. The camera code in WPILibJ is defaulting to 10.xx.yy.11 for the camera. You can either use the Robot Radio option of the Camera tool and plug the camera into the robot radio or your first call to GetInstance should be:
AxisCamera camera = AxisCamera.getInstance(“192.168.0.90”);