Vision software for processing retroreflective tape on a Raspberry Pi 3 using Java utilizing Pi4J and V4L4J communicating over UDP for the FIRST Robotics Competition (FRC).
Everything under moe.js/ and src/ belong to MOE with only slight modifications from us.
See this README by MOE for specifics on what the code features and how the image processing works.
- Raspberry Pi 3 Model B/B+ running Raspbian Stretch and Java 8 (via
sudo apt-get update
thensudo apt-get install -y openjdk-8-jdk
) - Internet Connection for the Pi (initially, for
install_dependencies.sh
and the first./gradlew build
) - USB Camera (tested with Microsoft LifeCam HD-3000)
- Green LED Halo (tested with 60mm)
- MOSFET to control the LED Halo
- 3M Scotchlite Reflective Tape 8830
On the Pi, run the install dependencies shell script file via ./install_dependencies.sh
. This will install WiringPi to control the Pi's GPIO pins (e.g., the LED Halo) and V4L4J to control the camera.
If you are on the pi, you can use ./gradlew run
to run the code directly. You can also run ./gradlew build
to run a build. When doing this, the output files will be placed into output/
. From there, you can run the shell script via chmod +x runMoePi
then ./runMoePi
, this will start MoePi with the default configuration values. To see what values you can change/pass in, run java -Djava.library.path=. -jar MoePi-all.jar --help
within output/
.
When running the code in the output/
folder via ./runMoePi
after building the project via ./gradlew build
, you can visit http://your-pi's-ip-address:5800
in a web browser to view the camera feed from the Pi.
For MoePi to run on boot, it must be built under /home/pi/MoePi
with the built output/
directory via ./gradlew build
(unless you create your own service file and configure it for systemctl yourself). You can then use the script service_manager.sh
:
./service_manager.sh argument
install - installs MoePi service and enables start on boot
start - starts MoePi via systemctl (service must be installed)
stop - stops MoePi via systemctl (service must be installed)
enable - enables MoePi to start on boot (service must be installed)
disable - disables MoePi from starting on boot (service must be installed)
uninstall - completely removes MoePi service from systemctl
Run ./gradlew eclipse