Go to Post We should also remember the fact that the FIRST Manual is not supposed to be enterpreted with lawyer speak. If so you could make it say many things. - Anthony [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 22-01-2017, 23:30
ryan.mitchell ryan.mitchell is offline
Registered User
FRC #1512 (Big Red)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: Middletown, Delaware
Posts: 14
ryan.mitchell is an unknown quantity at this point
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!

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

I followed these steps: https://wpilib.screenstepslive.com/s...essing-in-java
Reply With Quote
  #2   Spotlight this post!  
Unread 22-01-2017, 23:43
Skyehawk's Avatar
Skyehawk Skyehawk is offline
Nuts N' Bolts
AKA: Skye Leake
FRC #0876 (Thunder Robotics)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2011
Location: Northwood, ND
Posts: 271
Skyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to all
Re: Sending Raspberry Pi info to Driver's Station

Quote:
Originally Posted by ryan.mitchell View Post
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!

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

I followed these steps: https://wpilib.screenstepslive.com/s...essing-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/s...Network+tables
__________________
My time in FIRST has made me a better person, frankly I don't know where I'd be without it.



2011 Lake Superior Regional Champs (Thanks 2512 & 3747)
2015 Central Illinois Regional Engineering Inspiration Award recipients
2016 Central Illinois Regional Champs (Thanks 2481 & 2220)
Reply With Quote
  #3   Spotlight this post!  
Unread 22-01-2017, 23:59
ryan.mitchell ryan.mitchell is offline
Registered User
FRC #1512 (Big Red)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: Middletown, Delaware
Posts: 14
ryan.mitchell is an unknown quantity at this point
Re: Sending Raspberry Pi info to Driver's Station

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.
Reply With Quote
  #4   Spotlight this post!  
Unread 23-01-2017, 06:29
rich2202 rich2202 is offline
Registered User
FRC #2202 (BEAST Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Wisconsin
Posts: 1,275
rich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond repute
Re: Sending Raspberry Pi info to Driver's Station

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
http://raspberrypi.stackexchange.com...y-pi-to-laptop

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

Reply With Quote
  #5   Spotlight this post!  
Unread 23-01-2017, 10:22
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: Sending Raspberry Pi info to Driver's Station

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
Code:
http://YOUR.IP.ADDRESS.HERE:1185
. The cv image can be accessed at
Code:
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
Code:
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.
__________________
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
  #6   Spotlight this post!  
Unread 23-01-2017, 11:25
ryan.mitchell ryan.mitchell is offline
Registered User
FRC #1512 (Big Red)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: Middletown, Delaware
Posts: 14
ryan.mitchell is an unknown quantity at this point
Re: Sending Raspberry Pi info to Driver's Station

Quote:
Originally Posted by Thad House View Post
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
Code:
http://YOUR.IP.ADDRESS.HERE:1185
. The cv image can be accessed at
Code:
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
Code:
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:
Code:
NT: client: CONNECTED to server [ip address of team 1512 router] port 1735
Reply With Quote
  #7   Spotlight this post!  
Unread 23-01-2017, 11:37
ryan.mitchell ryan.mitchell is offline
Registered User
FRC #1512 (Big Red)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: Middletown, Delaware
Posts: 14
ryan.mitchell is an unknown quantity at this point
Re: Sending Raspberry Pi info to Driver's Station

Nevermind! When I used the address "raspberrypi.local:1185" it worked! Thanks so much for your help!
Reply With Quote
  #8   Spotlight this post!  
Unread 24-01-2017, 09:53
ryan.mitchell ryan.mitchell is offline
Registered User
FRC #1512 (Big Red)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: Middletown, Delaware
Posts: 14
ryan.mitchell is an unknown quantity at this point
Re: Sending Raspberry Pi info to Driver's Station

Quote:
Originally Posted by Skyehawk View Post
Look into Network Tables. They should do what you need, there are plenty of threads about it on CD.

https://www.chiefdelphi.com/forums/s...Network+tables
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.
Reply With Quote
  #9   Spotlight this post!  
Unread 24-01-2017, 10:01
ryan.mitchell ryan.mitchell is offline
Registered User
FRC #1512 (Big Red)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: Middletown, Delaware
Posts: 14
ryan.mitchell is an unknown quantity at this point
Re: Sending Raspberry Pi info to Driver's Station

Quote:
Originally Posted by ryan.mitchell View Post
Anyway, would you happen to know the location for the network table documentation for Java?
Update: Sam Carlberg found the documentation. It is here: http://first.wpi.edu/FRC/roborio/rel...workTable.html
If anyone is interested.
Reply With Quote
  #10   Spotlight this post!  
Unread 24-01-2017, 10:04
Skyehawk's Avatar
Skyehawk Skyehawk is offline
Nuts N' Bolts
AKA: Skye Leake
FRC #0876 (Thunder Robotics)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2011
Location: Northwood, ND
Posts: 271
Skyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to allSkyehawk is a name known to all
Re: Sending Raspberry Pi info to Driver's Station

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.
__________________
My time in FIRST has made me a better person, frankly I don't know where I'd be without it.



2011 Lake Superior Regional Champs (Thanks 2512 & 3747)
2015 Central Illinois Regional Engineering Inspiration Award recipients
2016 Central Illinois Regional Champs (Thanks 2481 & 2220)
Reply With Quote
  #11   Spotlight this post!  
Unread 24-01-2017, 11:18
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: Sending Raspberry Pi info to Driver's Station

Quote:
Originally Posted by ryan.mitchell View Post
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.
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.
__________________
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
  #12   Spotlight this post!  
Unread 24-01-2017, 11:41
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP, WPILib. 2084 alum
FRC #2084
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2009
Location: MA
Posts: 151
SamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to behold
Re: Sending Raspberry Pi info to Driver's Station

For the record, there was some more discussion on this topic in this thread on the controls forum
__________________
WPILib
GRIP, RobotBuilder
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 15:34.

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