|
|
|
| We win as a team. |
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 |
|
#2
|
|||
|
|||
|
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:
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 |
|
#3
|
||||
|
||||
|
Re: Vision processing loop is intermittent
Thank you, that is very helpful. We will look for an example on filtering the two best contours.
|
|
#4
|
||||
|
||||
|
Re: Vision processing loop is intermittent
Quote:
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|