Go to Post Wow. Just wow. Never did I think the mentor built robot debate would make it on to a tv show. - ASD20 [more]
Home
Go Back   Chief Delphi > Technical > Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 24-01-2017, 10:24
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: Raspberry Pi as Coprocessor

That example is 4 years old. All you have to do on the pi:

Code:
NetworkTable.setClientMode();
NetworkTable.setTeamNumber(1512);
ITable visionTable = NetworkTable.getTable("vision");
That'll set up the pi and a table specifically for vision. If you launch OutlineViewer from Eclipse (WPILib > Launch OutlineViewer), you'll be able to see the values update in realtime.

Then to publish the results from the vision processing

Code:
visionTable.putBoolean("Have target", haveTarget);
visionTable.putNumber("Angle to target", angleToTarget);
...

In your robot program, you'd also declare a table for vision just like we did on the pi. To read the values the pi is publishing, use the corresponding 'get' methods

Code:
haveTarget = visionTable.getBoolean("Have target", false); // default to false
targetAngle = visionTable.getNumber("Angle to target", 0); // default to 0
...
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote
 


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 11:44.

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