We win as a team.
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 02-02-2017, 20:10
rudun's Avatar
rudun rudun is offline
Registered User
FRC #0496 (Royals)
Team Role: Coach
 
Join Date: Jan 2009
Rookie Year: 2005
Location: Babylon
Posts: 48
rudun is an unknown quantity at this point
Vision processing loop is intermittent

We have tried our code and can get it to the peg lift, it jerks around a lil doing that, when adding in distance it takes almost 30s to go 10ft. We are trying to figure out why it is causing this lag, is it the math or the thread?

I have attached a gist of our code.

Gist
Reply With Quote
  #2   Spotlight this post!  
Unread 03-02-2017, 07:49
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 124
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: Vision processing loop is intermittent

I don't see any sleeps (like Timer.delay(0.025) in your autonomous while loop. This will cause your autonomous loop to chew up a lot of your CPU time that could be used for vision processing and there isn't much point in executing the same code thousands of times between frame updates.

It might also be helpful to put the following counts out to the dashboard during autonomous:
  • Number of frames processed.
  • Number of times two targets were found (resulting in power to the drive train).
  • Number of times less than two targets were found (stopping the drive train).
  • Number of times more than two targets were found (stopping the drive train).

Finally, it looks like if your vision filter picks up more than two targets, it will stop the robot. Instead, would it be worth looking for the two best targets should the filter pick up some noise ?

Good luck,
Paul
Reply With Quote
  #3   Spotlight this post!  
Unread 03-02-2017, 08:09
rudun's Avatar
rudun rudun is offline
Registered User
FRC #0496 (Royals)
Team Role: Coach
 
Join Date: Jan 2009
Rookie Year: 2005
Location: Babylon
Posts: 48
rudun is an unknown quantity at this point
Re: Vision processing loop is intermittent

Thank you, that is very helpful. We will look for an example on filtering the two best contours.
Reply With Quote
  #4   Spotlight this post!  
Unread 03-02-2017, 10:45
flemdogmillion's Avatar
flemdogmillion flemdogmillion is offline
Programmer, Builder, Driver...
FRC #3007
 
Join Date: Nov 2016
Rookie Year: 2015
Location: Minnesota
Posts: 180
flemdogmillion will become famous soon enoughflemdogmillion will become famous soon enough
Re: Vision processing loop is intermittent

Quote:
Originally Posted by rudun View Post
Thank you, that is very helpful. We will look for an example on filtering the two best contours.
First, find the 5 biggest particles. Then, make pairs so that no pair is duplicated or left out. Then, get left/top/right/bottom info about each item in a pair.
Use this info to calculate 5 different "scores" for each pair, then average the scores to get an overall score for each pair. Use the center and width/height of the pair with the highest overall score to do the rest of your processing (distance and direction).

Examples of "scores:"
Correctness of overall aspect ratio
particle height similarity
particle width similarity
particle height similarity to group height
particle width to overall width ratio
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
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 15:35.

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