|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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
|
||||
|
||||
|
Re: Vision code hangs cRIO
Quote:
|
|
#3
|
||||
|
||||
|
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
|
||||
|
||||
|
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
|
||||
|
||||
|
Re: Vision code hangs cRIO
Quote:
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
|
|||
|
|||
|
Re: Vision code hangs cRIO
Quote:
Code:
static AxisCamera *camera; 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. |
|
#7
|
|||
|
|||
|
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.
|
|
#8
|
||||
|
||||
|
Re: Vision code hangs cRIO
It would also help if we knew what language you were using.
|
|
#9
|
||||
|
||||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|