What code will receive an Mjpeg stream's data?

I am using the following program on the raspberry pi coprocessor and sending the processed data over a network switch with an Mjpeg stream. I also have a vision pipeline program that is not attached. What code would I write on the roborio in Robot.java to receive this Mjpeg server’s data? Also, is it more ideal to simply use network tables?Main.java (2.9 KB)

Are you talking about sending numbers or images? If you’re sending numbers, you should probably just use NetworkTables. It’s unclear to me why you would send images over to the RoboRIO for processing when the Pi is much faster for doing that.

Ok I wasn’t sure what this product was that it was sending. Let’s say I create a network table on the raspberry pis code called myTable and stored double X into it. How would I receive that double on the other end, on the roborio? Would I have to create a new network table in the roborio code?

You would create a NetworkTable variable in your code. The table itself is shared.
private NetworkTable table = NetworkTableInstance.getDefault().getTable(“YourTableName”);

Then you get the value with an entry
table.getEntry(“YourEntryKey”).getString(""); //or asNumber(0.0) …

Ohhhhh. Do I have to declare a port in the network switch for the network table like I did for the Mjpeg stream or does that not matter?

Network table is name only.


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