Previously, our team used PhotonVision to track AprilTags for pose estimation. This worked great, but eventually we realized we had a high demand for efficiency, speed, and accuracy during competitions which PhotonVision sometimes lacked. To improve autonomous, teleop, and every aspect of our game within, we developed CubVision.
Northstar is 6328's AprilTag tracking system using OpenCV's ArUco module and NT4. This code is provided for reference, but 6328 doesn't have the capacity to assist other teams in using it for custom setups. Please check out PhotonVision or Limelight as community-supported alternatives.
CubVision is a private fork of Northstar used by Team 1701 as the software for our vision coprocessors.
CubVision is meant to be a continuously-developed AprilTag tracking system for the future FRC games. During its introduction in 2024, we used OrangePi 5's as our coprocessors. They provided great results at high speeds. However, it can natively run on any machine which supports python to simulate and test robot or vision code.
| Machine | Performance | OpenCV Build Time |
|---|---|---|
| OrangePi 5 | 90fps @ 8ms | > 35 minutes |
| M1 Air | 120fps @ 3ms | ~ 20 minutes |
STOP: If you are unaware of what you're doing, or what you're running, get someone who does to help you. The build and installation of the required OpenCV build requires careful attention.
NOTE: A pre-packaged and built OpenCV is located in the Releases page on this repository. Head there and download if you don't want to rebuild OpenCV (which takes awhile).
Ensure Docker is installed
For MacOS, Linux ONLY
- If you need to rebuild OpenCV, head to the
dockerdirectory in the repository - run
sh build_opencv.sh. This will build and copy thecvpackage and the OpenCV shared libraries inlibto thedockerdirectory. - Use the commented
scpcommands located at the bottom of thebuild_opencv.shto copy the directories over to a remote machine.
Windows
I have not tried Windows, but Docker does support it. You can run the image and get OpenCV built with ease, but the shell script may not work on command lines that are ported to Windows (like Git Bash). Advance ONLY if you know what you're doing!
-
Open and edit the
launch_cubvision.shscript to match the commands forCubVisionfor a specific coprocessor (e.g. running the front-right camera) BEFORE copying to your coprocessor. -
Run the
copy_cubvision.shshell script from your host machine in the CubVision directory. This will copy the necessary files over. -
Run the
setup_cubvision.shshell script directly on the coprocessor after you edit thelaunch_cubvision.shscript. This should point the coprocessor to execute thelaunch_cubvision.shscript on startup This may require a WiFi connection to install pip packages. Should the package installation hang, try adding an extra resource forntcorelike thispython3 -m pip install --extra-index-url=https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2024/simple robotpy.