|
Re: Using a Raspberry Pi for camera tracking
We were going to use a raspberry pi for vision tracking this year, but our robot couldn't really aim, so it was pointless for us. We did still get it working before ship, though.
On a hardware level, we powered it by splicing the usb cable it comes with to a spare 12v-5v power converter we had. We installed the Arch linux distribution for ARM, and sent the data back over FRC's own NetworkTables.
Basically, we used the python bindings for OpenCV, and we just loaded the MJPEG file with opencv.VideoCapture("http://10.18.84.11/mjpg/video.mjpg"). Then we did some math (we actually found our position by using the angles of elevation to all the goals we could see to find distances, and then "triangulating" ourselves)
Lessons learned:
Keep a spare SD card, with everything you need installed. Our raspberry pi inexplicably stopped working at some point, and needed a reinstall, which we wouldn't have been able to do at a regional.
Do everything in one language, don't mix and match python and java.
Figure out if we actually need vision tracking before we build it. (hopefully not a problem for you)
All in all, we won't be using it next year. I think we'll put the classmate on the robot, so it has an external battery.
|