Go to Post If I can make a comeback, so can you. - Warren Boudreau [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

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-01-2016, 23:59
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
GRIP - Vision Processing

I was just messing around with GRIP and it is a very powerful tool. Does anyone know how to use the data it outputs. I've never messed with the networks table at all which is where it seems to output the data. Any help would be awesome!
  #2   Spotlight this post!  
Unread 10-01-2016, 10:56
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: GRIP - Vision Processing

What language? i have messed around with network tables, specifically for vision actually...They are pretty simple to use...essentially if your robot is deciding if it should do ____ based on a value from a table it would look similar to this

Code:
table visiontable = NetworkTable.getTable("vision")
boolean shouldFire = visiontable.getvalue()
//rest of code
so while grip is powerful, its still in development...
  #3   Spotlight this post!  
Unread 10-01-2016, 11:01
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: GRIP - Vision Processing

Quote:
Originally Posted by tomy View Post
I was just messing around with GRIP and it is a very powerful tool. Does anyone know how to use the data it outputs. I've never messed with the networks table at all which is where it seems to output the data. Any help would be awesome!
The GRIP manual on Screensteps has an article for that:
http://wpilib.screenstepslive.com/s/...-networktables
  #4   Spotlight this post!  
Unread 10-01-2016, 14:41
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: GRIP - Vision Processing

Ok so that's how you access the data from grip but what can you do with that information?

Also would you have to have grip running on your computer with the driver station?
  #5   Spotlight this post!  
Unread 10-01-2016, 14:51
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: GRIP - Vision Processing

Since its java, it can be run anywhere! thats the beauty of it! It can run on your driverstaion, the rio or even a coprocessor, such an an odroid c1 (way better then raspi)
  #6   Spotlight this post!  
Unread 10-01-2016, 15:00
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: GRIP - Vision Processing

So I could take an ip camera from the robot and input that data into GRIP then output the data to the robot? If I had it running with the driver station. Also how do I use the information back
  #7   Spotlight this post!  
Unread 12-01-2016, 21:51
ThomasClark's Avatar
ThomasClark ThomasClark is offline
Registered User
FRC #0237
 
Join Date: Dec 2012
Location: Watertown, CT
Posts: 146
ThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud of
Re: GRIP - Vision Processing

Quote:
Originally Posted by tomy View Post
Also how do I use the information back
The C++ example on this page shows how to print the area and x/y coordinates of each target.

Assuming you're able to get this far, exactly how you use this data depends on your robot and your strategy. For example, if you're trying to like the robot up horizontally with the biggest target, you might do something like this. (This is a really oversimplified example, but hopefully it serves as a good starting point)

PHP Code:
const double CENTER_X 320.0;
const 
double TOLERANCE_X 20.0;

void AutoShoot() {
    while (
true) {
        
auto areas grip->GetNumberArray("myContoursReport/area"llvm::ArrayRef<double>()),
             
xs    grip->GetNumberArray("myContoursReport/x",    llvm::ArrayRef<double>());

        
// Pick whatever target has the biggest area
        
double targetArea = -1.0targetX 0.0;
        for (
int i 0areas.size(); i++) {
            if (
areas[i] > targetArea) {
                
targetArea areas[i];
                
targetX xs[i];
            }
        }
        
        
// If we didn't find a target, return control to the operator
        
if (targetArea 0.0) {
            return;
        }

        
// If we're too far to the left to shoot, move right.  If we're too far
        // to the right, move left.  If we're spot on, shoot and return.
        
if (targetX CENTER_X TOLERANCE_X) {
            
MoveRobotRight();
        } else if (
targetX CENTER_X TOLERANCE_X) {
            
MoveRobotLeft();
        } else {
            
ShootBoulder();
            return;
        }
    }

__________________
GRIP (Graphically Represented Image Processing) - rapidly develop computer vision algorithms for FRC

Last edited by ThomasClark : 12-01-2016 at 21:54.
  #8   Spotlight this post!  
Unread 14-01-2016, 21:02
hewittalec hewittalec is offline
Registered User
FRC #0058
 
Join Date: Jan 2016
Location: Portland, ME
Posts: 2
hewittalec is an unknown quantity at this point
Re: GRIP - Vision Processing

Hello. Just started using GRIP. Is it possible to run grip from my drivers station PC by getting the robot USB camera feed? If so how do I send the Network Table data back to the roboRio for my program?

Thanks
Closed Thread


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 22:10.

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