Go to Post The robots are the attracting force, the common interest that brings us all together - sanddrag [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 15-02-2014, 10:45
CarrotBlasphemy's Avatar
CarrotBlasphemy CarrotBlasphemy is offline
Registered User
FRC #4226
 
Join Date: Feb 2014
Rookie Year: 2012
Location: Albany, MN
Posts: 9
CarrotBlasphemy is an unknown quantity at this point
Vision code hangs cRIO

I'm using the basic sample code for detecting a hot goal and when I run it, it keeps printing out "Robot drive... Output not updated often enough" Is there a way to fix this to run the vision code but not hang? Also, in case this matters, I'm calling it from a separate class
  #2   Spotlight this post!  
Unread 15-02-2014, 10:49
mechanical_robot's Avatar
mechanical_robot mechanical_robot is offline
Registered User
no team
Team Role: Driver
 
Join Date: Jul 2013
Rookie Year: 2013
Location: United States
Posts: 92
mechanical_robot will become famous soon enough
Re: Vision code hangs cRIO

Quote:
Originally Posted by CarrotBlasphemy View Post
I'm using the basic sample code for detecting a hot goal and when I run it, it keeps printing out "Robot drive... Output not updated often enough" Is there a way to fix this to run the vision code but not hang? Also, in case this matters, I'm calling it from a separate class
May I ask how did you get the hot target example code working? I'm still trying to figure out how to get vision code to work.
  #3   Spotlight this post!  
Unread 15-02-2014, 10:54
CarrotBlasphemy's Avatar
CarrotBlasphemy CarrotBlasphemy is offline
Registered User
FRC #4226
 
Join Date: Feb 2014
Rookie Year: 2012
Location: Albany, MN
Posts: 9
CarrotBlasphemy is an unknown quantity at this point
I didn't do much, but so far I've only used the test images. But actually, I'm pretty sure I had to add something in there that printed out target.Hot. So I'm not sure why it's missed that section but I added it in and it seems to work
  #4   Spotlight this post!  
Unread 15-02-2014, 22:34
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,554
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Vision code hangs cRIO

Do you a wait statement in your vision loop of perhaps 100 or 150 ms so that it allows your other code to get a shot at the cRIO's processor? If not, then the cRIO is running the vision code as fast as it can, your cpu is at 100% utilization, and your other code isn't having a chance to run in a timely manner.
  #5   Spotlight this post!  
Unread 16-02-2014, 13:53
Randaline's Avatar
Randaline Randaline is offline
Registered User
AKA: Abby
FRC #0716 (The Who'sCTEKS)
Team Role: Programmer
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Connecticut
Posts: 12
Randaline is an unknown quantity at this point
Re: Vision code hangs cRIO

Quote:
Originally Posted by antimatter_john View Post
May I ask how did you get the hot target example code working? I'm still trying to figure out how to get vision code to work.
You're not alone our team's been using the example vision code and have gotten it working, but it takes five seconds or longer, no matter what we change. It's a problem considering the hot goals change within 5 seconds...
  #6   Spotlight this post!  
Unread 16-02-2014, 14:49
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
Re: Vision code hangs cRIO

Quote:
Originally Posted by Randaline View Post
You're not alone our team's been using the example vision code and have gotten it working, but it takes five seconds or longer, no matter what we change. It's a problem considering the hot goals change within 5 seconds...
We were running into the same problem, but think we've got it working. What language and camera are you using? We're using the m1011 and C++ and what we found is that you have to initialize the camera outside of the autonomous loop, else the camera won't begin the startup sequence until you enable autonomous. If you place
Code:
static AxisCamera *camera;
right after the #define's, and delete the other declaration thats right inside the autonomous loop, that should help a bit.

Also, to OP: try decreasing the fps. We found that 4 or 5 fps is more than enough, but it tries to default to something crazy like 30.
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
  #7   Spotlight this post!  
Unread 16-02-2014, 14:51
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
Re: Vision code hangs cRIO

CarrotBlasphemy - that has to do with your robotDrive instance is not getting motor values. Make sure that everywhere in the code, you're sending drive values. Or if your using custom drive code, then that would also throw an issue.
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
  #8   Spotlight this post!  
Unread 16-02-2014, 17:33
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,554
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Vision code hangs cRIO

It would also help if we knew what language you were using.
  #9   Spotlight this post!  
Unread 16-02-2014, 17:38
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: Vision code hangs cRIO

We found this too. We were using iterative robot. We did two things to make this easier on the crio. The first is to only call vision calls every n loops (we use 10). The second is not to use the area filter but rather a particle width filter:

cc.addCriteria(NIVision.MeasurementType.IMAQ_MT_BO UNDING_RECT_WIDTH, 8, 65535, false);

We were 100% at week zero at detecting hot correctly.
__________________
"Never let your schooling interfere with your education" -Mark Twain
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 02: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