Sending Video From Pi 3 to Driver Station

I Joined FRC at the start of the year and became the sole developer of the team.

I’m messing around with the code to learn.

How can I send video from a Pi 3 to driver station.

Excellent!

Have you had a chance to check out some of the docs?

Vision with WPILibPi — FIRST Robotics Competition documentation has some good info on using Raspberry Pi’s and cameras.

2 Likes

I honestly thought for a second you wanted to send video to a Nintendo ds lol
I have no valuable input here. good luck

2 Likes

soooo you’ll have to get very creative.

3 Likes

Http GET request for every frame as a JPEG!!!

the sad thing is i actually kinda want to try to make this now lmao

2 Likes

Sounds like Motion JPEG - Wikipedia.

1 Like

Hmm looks cool. I think the worst part of my “suggestion” is the use of HTTP GET requests to pull every frame.

We use this programmed in Java. Essentially the same code runs on roboRIO 2.0 or RPi 4+ which I think is compatible with the 3 for the WPILibPi. The RPi versions of libraries are a little behind the roboRIO libraries so a couple of statements are in different packages. This code is for a USB camera on the RPi or roboRIO. This code maxes out the roboRIO CPU and the RPi coasts along.

We display the video on the ShuffleBoard, SmartDashBoard, or Chrome browser. The code is using the WPILib camera server and OpenCV so just connect to the URL any way you want to.

If you want to save on the RPi jpg files of the camera stream, look at some past years’ RPi code. 2022 didn’t have that option.

1 Like

Having Troble with NetworkTables

Can I use something like this:

//On RoboRio
cameraserver.addserver(http://http://wpilibpi.local/, port)

Your string isn’t formed exactly right but yes that is one option in the CameraServer class. You do have to use it appropriately.

Also, my team has the best connections - minimal disconnections - using static IP addressing. You can see many recommend that method instead of nice names.

Okay!

Photonvision is also an option; it’s open-source and pretty much plug-and-play (no need to write code for the rpi).

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.