WPILib FRCVision Raspberry Pi image 2019.3.1 Update

I’m pleased to announce the availability of the 2019.3.1 update release of FRCVision, an off-the-shelf Raspberry Pi 3 image for FRC use, brought to you by WPILib! This is an update to the 2019.2.1 and kickoff releases.

TLDR: the 2019.3.1 release can be downloaded from GitHub.

Due to the significant OpenCV optimizations in this release, it is highly recommended that you upgrade if you are doing image processing (e.g. with the unofficial Chicken Vision application).

If you want to help other teams, bring a spare Raspberry Pi 2 or 3 to your event along with some cheap USB cameras and some Micro SD cards pre-imaged with FRCVision… we want everyone to be able to see during the sandstorm!

What’s Changed In This Release (since 2019.2.1)

Web dashboard

  • NetworkTable-selectable switched cameras can now be added. The NetworkTable key can be customized per switchable camera, and the read value can be either a numeric index or the string name of the camera.
  • Improved feedback for file uploads
  • The FRCVision release version is now shown
  • The script for Python applications now explicitly runs python3, avoiding the need for a shebang line


  • OpenCV performance is significantly improved, operations like RGB to HSV conversion are ~10x faster
  • OpenCV is now compiled with many more options enabled, including OpenBLAS and libgtk
  • gstreamer is bundled, along with OpenCV support for gstreamer
  • WPILib has been updated to 2019.3.2 and robotpy-cscore to 2019.1.0
  • libpixy2 (both C++ and Python) is now bundled
  • Sources for everything are included in /usr/src
  • pkg-config files for wpilibc et al are now installed
  • Both dynamic and static libraries are included in the image

Built-in streaming application

  • Implements the NetworkTable-selectable switched camera support


Note: Benefiting from these changes requires downloading the updated example .zip and merging your code changes into it.

  • All examples now implement the NetworkTable-selectable switched camera support
  • [C++] A working Windows make.exe is now bundled
  • [Python] example now uses UTF-8 encoding when opening frc.json
  • [Python] example docstrings have been corrected
  • [C++] Makefile is now more easily extensible
  • All examples now include the FIRST BSD license in .zip

Thank you for releasing the virtual camera feature so quickly!

Is there already an example or introductory documentation on how to use the NT-selectable camera feature from the rio side somewhere? Thanks again!

No, we didn’t have time to add docs for that. It’s the same as writing any other NetworkTables value, e.g. something like this…

// assumes you used "/PiSwitch" as the NT key on the Pi
NetworkTableEntry cameraSelect = NetworkTableInstance.getDefault().getEntry("/PiSwitch");
if (joy1.getTrigger()) {
  cameraSelect.setDouble(0);  // or setString("My Pi Camera Name")
if (joy2.getTrigger()) {

Perfect. Thanks.

I can’t figure out why compression doesn’t seem to work as expected. I tried on this new image as well as the first release. Regardless of what # I set in the default stream compression (there are two boxes for compression, I put “45” or “75” in both) on the Pi web interface, I can’t get the image to go under 2 Mbps. Changing the compression on shuffleboard also doesn’t seem to change anything.

Do you see the image becoming more pixelated? What resolution are you running? What model of camera? I’ve tested this locally and it definitely changes the bandwidth utilization.

It does not appear to be getting too pixelated. I’m not sure if its compressing it a little, but just not much.

I can reduce resolution and frame rate successfully though. I am using 320x240 on two cameras and 240x240 on the other.

We have two types of cameras:

On a side note, there are two boxes on the default stream section for compression, what is the difference between them? (I think they are labeled “compression” and “default compression”?). Also, I assume they are expecting a number between 0 (no compression) and 100 ( max compression), correct?

Compression would be better labeled quality; 100 is the least compression. 0 is the most.

The difference between compression and default compression is described in the two corresponding functions in MjpegServer: http://first.wpi.edu/FRC/roborio/release/docs/java/edu/wpi/cscore/MjpegServer.html#setDefaultCompression(int)

1 Like

Maybe I was just moving the needle the wrong direction. I’ll try it with lower numbers today.

With the new network switched camera function - I see how to add a new network switched camera, but I don’t see how I link to multiple real cameras (to switch between). Where does that occur in the web interface? I assume somewhere it needs to know what real camera feed to use as the networked switched camera based on a network tables value.

I thought about having something like that, but decided it was simply easier to just have every switched camera have access to every real camera. The selector works as either a number index (starting with 0) into the list of all real cameras (so 0 is the first camera, 1 is the second, etc), or as a string with the name of the desired camera (as entered in the web interface).

What table name is it expecting? I can’t recall if this is something set in the Pi switched camera setup?


inst = NetworkTableInstance.getDefault();
table = inst.getTable("???");
cameraSelect = table.getEntry("/PiSwitch");

@PullJosh we may want to take a look at this and reflash both Pis.

NetworkTables is a flat namespace like a Unix directory tree; tables are directories/subdirectories. The NT key put into the Pi is an absolute path to the key. So “/PiSwitch” there means table of “/“ and key of “PiSwitch”, “/MyTable/Switch” would be table of “MyTable”, key “Switch”, etc.

That being said, you don’t have to use getTable() at all. NetworkTableInstance has a getEntry() function as well that essentially takes an absolute path. So you can simply call inst.getEntry(“/PiSwitch”) to get the right entry if you put “/PiSwitch” in as the key in the Pi web dashboard.

1 Like

Do we need to do anything to disable wifi/bluetooth on the Pi to be compliant at the competitions, or are they automatically disabled just by running the Pi image?

The FRCVision image disables both WiFi and Bluetooth so it’s competition legal out of the box.

1 Like

I continue to get some unreliable behavior out of the FRCVision image (newest).

Sometimes a camera will show as connected, but when I open the stream it shows only it’s settings and never produces the image stream

Sometime everything is working great, and then if I disable the robot suddenly all the streams stop and the Pi won’t respond until I power cycle it.

Anyone else seeing this? I’m suspicious of a power issue - I’m running the Pi off the voltage regulator module (5V 2A).


I can’t seem to build code. The build folder is missing from the example code folder for Java. How do I build the code for the raspberry pi?

As stated in the README.txt, you have to run “.\gradlew build” from the command line with JAVA_HOME set to an appropriate JDK11 install. This will compile your code and in the process create the build folder and .jar file within it.

The NetworkTable-selectable switched cameras work great! Thanks for adding this feature!

1 Like