Skip to content

Vision processing code for the 2020 FRC season Infinite Recharge

Notifications You must be signed in to change notification settings

CrevolutionRoboticsProgramming/Vision2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vision2020

Crevolution's vision program for 2020

Overview

This is a vision processing program created for the 2020 FRC game, Infinite Recharge. It can identify the game's vision target and send its horizontal offset to a connected roboRIO via UDP. Additionally, it is entirely configurable using the CrevoDashboard JavaFX GUI.

Requirements

Hardware requirements include:

Software requirements include:

Installing

This assumes you have a Raspberry Pi already up and running. If you don't, I would recommend following this tutorial. Don't forget to enable the Raspberry Pi Camera Module in raspiconfig.

Please make sure all software prerequisites are installed before continuing.

  1. Open a new terminal
  2. Install git (sudo apt install git)
  3. Run cd ~/
  4. Run git clone https://github.com/CrevolutionRoboticsProgramming/Vision2020
  5. Run cd Vision2020
  6. Run cmake .
  7. Run make
  8. To run the program, run ./run.sh

If you would like to run the program on startup, follow these steps:

  1. Open a new terminal
  2. Run sudo nano /etc/rc.local
  3. Before exit 0, add a new line with the contents cd ~/Vision2020 && ./run.sh &
  4. Press Ctrl + O to write your changes
  5. Press Ctrl + X to exit

Usage

Once ran, the program requires no user input. It includes a custom configuration protocol for storing and updating program-wide values like HSV thresholds and video formatting which can be accessed via our CrevoDashboard JavaFX GUI.

Once the program identifies a vision target, it calculates its vertical and horizontal offset from the center of the target, ranging from -0.5 to 0.5, and streams it via UDP with the labelling "Y OFFSET:" or "X OFFSET:" respectively to the roboRIO. The stream can be received with the UDPHandler class included in CrevoLib.

The video stream can be received from index.html in any web browser.

Additional Acknowledgements

The MJPEGWriter.cpp and MJPEGWriter.hpp files come from JPery's MJPEGWriter and are used for transmitting the video stream. They have been altered to fit the needs of the project.

About

Vision processing code for the 2020 FRC season Infinite Recharge

Resources

Stars

Watchers

Forks