Sending Raspberry Pi info to Driver's Station

Hey everyone, I am the sole programmer working on this on my team and so I would really appreciate whatever help I can get with this - currently I have my raspberry pi hooked up via Ethernet cable to the router that the roborio is also hooked up to via Ethernet cable, and my driver’s station is connected to the network of course. On the raspberry pi is a program that starts up a USB Camera connected to the pi and processes the image. I know it successfully connects to the radio and starts up the camera when I boot the program (from the log file) but how do I access the image on my driver’s station. I have read some things about network tables…could someone enlighten me? Thanks so much! :slight_smile:

Also, in case this helps, it is the java project provided here: http://first.wpi.edu/FRC/roborio/coprocessors/JavaGradle.zip

I followed these steps: https://wpilib.screenstepslive.com/s/4485/m/24194/l/687863-off-board-vision-processing-in-java

Look into Network Tables. They should do what you need, there are plenty of threads about it on CD.

https://www.chiefdelphi.com/forums/showthread.php?t=151862&highlight=Network+tables

Ok, will do! Gotta say, was starting to feel a bit hopeless after spending hours figuring out how the pi worked (never used it before) and then hitting this wall, so I appreciate the direction.

Assuming this will be your competition configuration, you will want to put a switch/hub on your robot so that you can easily tether to your robot during competitions.

I suggest figuring out a way to send the picture directly from the Pi to your DS. Minimize what you have to do through your RoboRio.

This might be helpful

You can also put an IP camera on your robot that connects to the DS.

That example already serves a stream of both the input image and the cv image. The input image streams on port 1185, and can be accessed by any web browser by going to

http://YOUR.IP.ADDRESS.HERE:1185

. The cv image can be accessed at

http://YOUR.IP.ADDRESS.HERE:1186

In addition, once you have done your cv processing, the example already links to networktables, so all network tables functionality is already there, initialized, and working. All you would need to do is call

NetworkTable table = NetworkTable.getTable("SmartDashboard");

and you would have a table object that would send data straight to smart dashboard that you could use on your robot.

By your ip address do you mean the ip of the team network (directs to the system configuration page without the port). If so, when I put in the address with the port 1185 or 1186 it was unable to connect. On the raspberry pi the log file was:

NT: client: CONNECTED to server [ip address of team 1512 router] port 1735 

Nevermind! When I used the address “raspberrypi.local:1185” it worked! Thanks so much for your help!

Sorry about the second thread - I’m pretty new to chief delphi so I didn’t know the etiquette concerning threads. Anyway, would you happen to know the location for the network table documentation for Java? Also, could anyone explain to me what would be the client side and what would be the server side? With the example that I installed on my raspberry pi, it is currently set as the client side, however I am thinking that it should be the server side and the driver’s station client so that I can use the address “raspberrypi.local” to connect to it from the driver’s station.

Update: Sam Carlberg found the documentation. It is here: http://first.wpi.edu/FRC/roborio/release/docs/java/edu/wpi/first/wpilibj/networktables/NetworkTable.html
If anyone is interested.

That is exactly what I was about to link you to. There is probably a getNumberArray(key) method in there you will want to use.

For FRC, the roborio is usually the server. All versions of wpilib and LabVIEW set the robot up this way. You can then have many clients hooked up, for instance both a dashboard and a pi. All the data will be synced through the sever, so both clients will see the same data. So anything other then the Rio should be hooked up to the Rio as a client.

For the record, there was some more discussion on this topic in this thread on the controls forum