Go to Post And I will most definitely never forget watching this bald, brown thin wisp of a human being charging up to us across the sidelines after the semifinals ended waving his hands and shouting "New Strategy!!!!!! New Strategy!!!!!!" as he rallied the troops for our Finals push. - Travis Hoffman [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 12-10-2016, 21:11
MikePerreman's Avatar
MikePerreman MikePerreman is offline
Registered User
FRC #0247
 
Join Date: Feb 2015
Location: Michigan
Posts: 33
MikePerreman is an unknown quantity at this point
network tables and the raspberry pi

well, the title is self explanatory, anyone know how to include the network tables, and more importantly, get them to work "properly"
__________________
Programmer - A creature known for converting Caffeine into Code.
Reply With Quote
  #2   Spotlight this post!  
Unread 12-10-2016, 21:35
Jchau Jchau is offline
1414 - Programmer | Engineer
FRC #1414 (iHOT Robotics)
Team Role: Programmer
 
Join Date: Jun 2016
Rookie Year: 2015
Location: Atlanta, GA
Posts: 5
Jchau is an unknown quantity at this point
Re: network tables and the raspberry pi

I am not sure if you have seen this yet: https://github.com/robotpy/pynetwork...master/samples.
It pretty much has everything you need to know to use the network tables on the raspberry pi, from installation to sample code.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-10-2016, 21:37
BenBernard BenBernard is offline
Registered User
FRC #5687 (The Outliers)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Portland, ME
Posts: 36
BenBernard is an unknown quantity at this point
Re: network tables and the raspberry pi

There are a few threads on the subject here, but if you just want code, please feel free to look at our 2016 pi-tracker in github: https://github.com/frc5687/pi-tracker.

Also included is the networktables jar file.

There's not much documentation on github, but the code itself should be fairly clear. You're also welcome to PM me with questions.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-10-2016, 21:40
BenBernard BenBernard is offline
Registered User
FRC #5687 (The Outliers)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Portland, ME
Posts: 36
BenBernard is an unknown quantity at this point
Re: network tables and the raspberry pi

I assumed java...but of course if you were looking for python, go with jchau's reply above!
Reply With Quote
  #5   Spotlight this post!  
Unread 12-10-2016, 21:49
Jchau Jchau is offline
1414 - Programmer | Engineer
FRC #1414 (iHOT Robotics)
Team Role: Programmer
 
Join Date: Jun 2016
Rookie Year: 2015
Location: Atlanta, GA
Posts: 5
Jchau is an unknown quantity at this point
Re: network tables and the raspberry pi

If you do choose to go with python, you can get more information about installation as well as the API reference here: http://pynetworktables.readthedocs.io/en/latest/.
Reply With Quote
  #6   Spotlight this post!  
Unread 13-10-2016, 06:15
MikePerreman's Avatar
MikePerreman MikePerreman is offline
Registered User
FRC #0247
 
Join Date: Feb 2015
Location: Michigan
Posts: 33
MikePerreman is an unknown quantity at this point
Re: network tables and the raspberry pi

alright, thanks for the quick info, ill give this a shot!
__________________
Programmer - A creature known for converting Caffeine into Code.
Reply With Quote
  #7   Spotlight this post!  
Unread 14-10-2016, 15:20
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: network tables and the raspberry pi

Python example: https://github.com/GarnetSquardon490...or_shutdown.py
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
  #8   Spotlight this post!  
Unread 19-10-2016, 20:03
bankst's Avatar
bankst bankst is offline
Registered User
FRC #0832 (OSCAR)
Team Role: Mentor
 
Join Date: Feb 2016
Rookie Year: 2012
Location: Roswell, GA
Posts: 9
bankst is an unknown quantity at this point
Re: network tables and the raspberry pi

Here's 832's brand new OpenCV code using python and pynetworktables:

https://github.com/oscarrobotics/VisionOnPi2016

If you're using the Pi for Vision Processing, you can also just copy the whole thing, as long as you follow the instructions in the README
Reply With Quote
  #9   Spotlight this post!  
Unread 12-12-2016, 11:52
kmckay's Avatar
kmckay kmckay is offline
Registered User
FRC #5401 (Fightin' Robotic Owls)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Bensalem, PA
Posts: 39
kmckay will become famous soon enough
Re: network tables and the raspberry pi

Quote:
Originally Posted by BenBernard View Post
There are a few threads on the subject here, but if you just want code, please feel free to look at our 2016 pi-tracker in github: https://github.com/frc5687/pi-tracker.

Also included is the networktables jar file.

There's not much documentation on github, but the code itself should be fairly clear. You're also welcome to PM me with questions.
I see its been updated to eliminate NT and use UDP, did the NT code work? Any landmines that you recall?
Reply With Quote
  #10   Spotlight this post!  
Unread 12-12-2016, 15:44
BenBernard BenBernard is offline
Registered User
FRC #5687 (The Outliers)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Portland, ME
Posts: 36
BenBernard is an unknown quantity at this point
Re: network tables and the raspberry pi

We encountered substantially more lag with NetworkTables than with straight UDP. Plus, we would occasionally see odd behavior in the NT version that may or may not have been caused by NT bugs. Values would change at unexpected times, etc. I think we were just pushing more data through NT than it was designed for, so rather than debug we switched to UDP and the problems went away.
Reply With Quote
  #11   Spotlight this post!  
Unread 12-12-2016, 15:47
kmckay's Avatar
kmckay kmckay is offline
Registered User
FRC #5401 (Fightin' Robotic Owls)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Bensalem, PA
Posts: 39
kmckay will become famous soon enough
Re: network tables and the raspberry pi

Quote:
Originally Posted by BenBernard View Post
We encountered substantially more lag with NetworkTables than with straight UDP. Plus, we would occasionally see odd behavior in the NT version that may or may not have been caused by NT bugs. Values would change at unexpected times, etc. I think we were just pushing more data through NT than it was designed for, so rather than debug we switched to UDP and the problems went away.
Do you have a good source of code for reading the UDP into a robot program?
Reply With Quote
  #12   Spotlight this post!  
Unread 12-12-2016, 17:30
BenBernard BenBernard is offline
Registered User
FRC #5687 (The Outliers)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Portland, ME
Posts: 36
BenBernard is an unknown quantity at this point
Re: network tables and the raspberry pi

Quote:
Originally Posted by kmckay View Post
Do you have a good source of code for reading the UDP into a robot program?
I'll let you judge whether it's "good" or not, but we do have both ends of the UDP communication in our github.

On the pi, we run pi-tracker and communicaton with the rio is through RobotProxy. RobotProxy starts a thread to listen for incoming UDP packets from the rio, and expose the incoming values. It also provides the Send method to send updates to the rio.

On the rio, the robot code uses the PiTrackerProxy exactly the same way: it starts a thread to listen for incoming packets from the pi while providing the collect method to send packets to the pi.

Note that the reason for this complicated mechanism was to more precisely correlate the timing of images to the position the robot was in when the picture was taken. For more on this, see Team 254's video and presentation.

We then compute a new "target" pose based on the image and pose when the image was taken, and use PID to get us there.
Reply With Quote
  #13   Spotlight this post!  
Unread 12-12-2016, 20:54
BrianAtlanta's Avatar
BrianAtlanta BrianAtlanta is offline
Registered User
FRC #1261
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2012
Location: United States
Posts: 67
BrianAtlanta has a spectacular aura aboutBrianAtlanta has a spectacular aura about
Re: network tables and the raspberry pi

The biggest drawback to NT, is the update frequency, the fastest you can configure them to update is 100ms. Does that hurt, depends on how you use it. Faster doesn't always mean better. But when you add in the delay of the co-processor to process the image, and include in the NT delay, it can quickly become a problem.

In our code, NT was fine, but UDP would have been better and reduced oscillation during targeting. But with NT we could fire in about 3s (turn and elevate), and hit 80-90%. We will look at UDP in the future, but NT are a good V1.0 option, just understand the limitations.
__________________
Reply With Quote
  #14   Spotlight this post!  
Unread 13-12-2016, 15:25
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 243
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: network tables and the raspberry pi

Quote:
Originally Posted by BrianAtlanta View Post
The biggest drawback to NT, is the update frequency, the fastest you can configure them to update is 100ms. Does that hurt, depends on how you use it.
This has been changed for 2017 to allow as fast as 10 ms update rate. https://github.com/wpilibsuite/ntcore/pull/89
__________________
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
Reply With Quote
  #15   Spotlight this post!  
Unread 13-12-2016, 22:27
BrianAtlanta's Avatar
BrianAtlanta BrianAtlanta is offline
Registered User
FRC #1261
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2012
Location: United States
Posts: 67
BrianAtlanta has a spectacular aura aboutBrianAtlanta has a spectacular aura about
Re: network tables and the raspberry pi

Cool, glad to see the option for less than 100ms. We'll have to test it out.
__________________
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 04:52.

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