This project utilizes OpenCV and the Raspberry Pi to process image feeds to publish values to a network table.
NOTE: If you are building this on the pi, you may need to chmod -x gradlew.
- Run
gradlew buildon the command line. - Enable SSH on the pi (if it is not already)
- Configure the SSH remote in the
build.gradlefile to match the pi's IP. - Run
gradlew deploy.
If the project is on the pi, simply running gradlew run should do just fine. Otherwise...
cdinto the output directory, e.g.:cd output/.- If this is the first time you have deployed this to the pi, you may need to
chmod +x ./runCameraVision. - Run
./runCameraVision
- All network table values are stored in a sub table called
Vision. - You need some way to exit the program. Right now, a way to do it is to create a key in the
Visionnetwork table calledshutdown. Set this totrueto shut down the program.- The shutdown call has a 5-second grace period, perfectly enough time to finish up the work with the pi or even cancel the shutdown call.
- The HSL thresholds are editable. You can use the SFX Dashboard or edit the values directly from an Outline Viewer/Network Tables viewer. These values can be found under
/Vision/hslThreshold. They are:hueMin/hueMax: Hue thresholdsatMin/satMax: Saturation thresholdlumMin/lumMax: Luminance threshold
- This program uses two different USB cameras to find targets. One looks for the gear vision targets, the other finds the high goal targets. Each target is published into
/Vision/gearVisionor/Vision/highGoal, respectively. Every target's center coordinate, width, and height as perceived in the feed are published onto the sub tables.