Go to Post Does this mean it's too late to ask for a flux capacitor? - Peter Matteson [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-01-2017, 20:35
legts legts is online now
Autonomous Queen
FRC #2399 (The Fighting Unicorns)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Ohio
Posts: 78
legts is an unknown quantity at this point
Basic NetworkTables Assistance Requested

Hello! My team is trying to do vision code for the first time, and I'm attempting to set up NetworkTables to be able to send information from a Raspberry Pi 3 to the driver's station. My eventual goal is to get an image from a camera connected to the Pi, do some image processing stuff on it, and send that feed back to the driver's station. My questions basically boil down to "how do I write code for NetworkTables so that I can get this to stream a camera feed back to the driver's station " but I'll ask some more specific stuff.

1. How do the devices transmit information? (Raspberry Pi talks to the roboRIO which talks to the driver's station?)

2. How do I set up the communication between the devices? Right now I've been trying to get the Pi to send data directly to the driver's station without involving the roboRIO, is that the best way to go about this?

3. Do I need to use GRIP in order to use NetworkTables? The only information I could find about it on screenstepslive involved using GRIP, and I'm not sure if GRIP is required to use NetworkTables.

4.What do I need to write on the Pi to get NetworkTables functioning?

Also, if anyone has any links to NetworkTables documentation or other information about it then that would be great as I'm pretty much flying blind here.

Thanks!
__________________
Programming Captain on team 2399 for the 2016 season.
Programmer on team 2399 The Fighting Unicorns since 2014!
Engineering Inspiration Award GPR 2015
Semi-finalist Buckeye 2015 (thanks 4269 and 1987!)
Reply With Quote
  #2   Spotlight this post!  
Unread 26-01-2017, 22:26
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Basic NetworkTables Assistance Requested

Quote:
Originally Posted by legts View Post
Hello! My team is trying to do vision code for the first time, and I'm attempting to set up NetworkTables to be able to send information from a Raspberry Pi 3 to the driver's station. My eventual goal is to get an image from a camera connected to the Pi, do some image processing stuff on it, and send that feed back to the driver's station. My questions basically boil down to "how do I write code for NetworkTables so that I can get this to stream a camera feed back to the driver's station " but I'll ask some more specific stuff.

1. How do the devices transmit information? (Raspberry Pi talks to the roboRIO which talks to the driver's station?)

2. How do I set up the communication between the devices? Right now I've been trying to get the Pi to send data directly to the driver's station without involving the roboRIO, is that the best way to go about this?

3. Do I need to use GRIP in order to use NetworkTables? The only information I could find about it on screenstepslive involved using GRIP, and I'm not sure if GRIP is required to use NetworkTables.

4.What do I need to write on the Pi to get NetworkTables functioning?

Also, if anyone has any links to NetworkTables documentation or other information about it then that would be great as I'm pretty much flying blind here.

Thanks!
That build system you linked will actually automatically stream the image over the network. The stream it produces can be found by going to
Code:
http://raspberrypi.local:1185/
(note raspberrypi.local can be replaced with whatever the IP address of the pi is.) That system also automatically includes NetworkTables, and even includes the proper setup to have it connect to the roboRIO.

The right way for network tables to be set up is to have the roboRIO as the server, and everything else as a client. The build system is already set up as a client, and so do both SmartDashboard and the LV dashboard.

To get access to put things on the Dashboard, you need a NetworkTable object, pointing to the SmartDashboard table. To do this, use the following code.

Code:
NetworkTable sdTable = NetworkTable.getTable("SmartDashboard");
That will get you access to the table. From there, you can use the same methods you would use on the SmartDashboard class on the robot (putNumber, putString, getNumber, etc) on that object to send and receive data. This will be sent to the roboRIO, which will then send all data to all other clients, such as the dashboard.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
Reply With Quote
  #3   Spotlight this post!  
Unread 28-01-2017, 14:00
legts legts is online now
Autonomous Queen
FRC #2399 (The Fighting Unicorns)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Ohio
Posts: 78
legts is an unknown quantity at this point
Re: Basic NetworkTables Assistance Requested

Thanks for the information! This makes things a lot clearer, I just have a few more questions.

1. How do I set up the roboRIO as the server?

2. Do I need to give the Pi a static IP address so the stream always goes to the same IP on the SmartDashboard?

3. Is there anything other than setting up the roboRIO as the server, creating a NetworkTables object, and possibly setting up a static IP address that I would need to do to get the program that I linked to earlier to work?

Thanks again!
__________________
Programming Captain on team 2399 for the 2016 season.
Programmer on team 2399 The Fighting Unicorns since 2014!
Engineering Inspiration Award GPR 2015
Semi-finalist Buckeye 2015 (thanks 4269 and 1987!)
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 13:16.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi