Go to Post Our job as mentors isn't to teach them how to make a robot...It's to teach them that there is value in technology and being among the people who create it. - Andy A. [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 17-11-2016, 16:16
j_pham j_pham is offline
Registered User
FRC #4914
 
Join Date: Jan 2015
Location: Canada
Posts: 1
j_pham is an unknown quantity at this point
Using GRIP on Raspberry Pi

My team recently discovered vision so I'm just playing around. So if I use a Pi as a co-processor, I have several questions

1) what is a network table (yes, I don't know lol) and how do I read the network table openCV processes?
2) how I feed this data back to the roboRIO to center our drive train?

If you have github repos for Pi processing, I'd love to read them. Thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 17-11-2016, 19:54
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 296
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Using GRIP on Raspberry Pi

NetworkTables is a library for synchronizing variables over multiple machines in a network. It allows you to read what you publish from the RIO on your driver station, but it also allows the RIO to read values from another network device, and so can your driver station.
The RIO is the server. So, both the Pi and the driver station connect to the RIO. However, using NetworkTables is mostly the same regardless of whether you are on the client or the server. You can read values on the rio that the Pi publishes using something like this
Code:
NetworkTable gripTable = NetworkTable.getTable("path/to/grip/table");
double someValue = gripTable.getNumber("numberVariableName", defaultValue)
//Or getString, getBoolean, etc
You can read the documentation on Screensteps for more info on NetworkTables.

To center
- With a gyroscope: calculate the angle to the target and turn by that amount. If your camera is nice, use a simple pinhole camera model. If not, you're kind of screwed because the distortion correction functions of OpenCV aren't in GRIP last time I checked
- Without a gyroscope: turn until the target is centered. This will be much slower than if you had a gyro because the feedback is slower
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org

Last edited by euhlmann : 17-11-2016 at 19:57.
Reply With Quote
  #3   Spotlight this post!  
Unread 21-11-2016, 13:08
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: Using GRIP on Raspberry Pi

Hi! I'm working to try and implement this:
https://github.com/WPIRoboticsProjec...Raspberry-Pi-2

I'm using a Pi 3, and the Pi camera. So far I'm successfully able to stream the camera to GRIP on the PC, but when I start GRIP on the Pi, I get an error.

Working in another thread about the error
https://www.chiefdelphi.com/forums/s...d.php?t=151892
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 09:32.

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