Go to Post I was very concerned about this thread. Then I realized you were talking about a computer. - Taylor [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 03-02-2014, 13:29
idoshamir idoshamir is offline
Registered User
FRC #5038
 
Join Date: Jan 2014
Location: Israel
Posts: 18
idoshamir is an unknown quantity at this point
Vision Target Detections makes cRIO code slow

Hello,

We are a rookie team trying to implement the target detection of the goals.
We want to use it both on the auto part and the teleop part.

We took the code from the example and implemented it (pretty much copy-paste) to the vision VI.

We are happy with the results - but the cRIO is immediately getting to 100% cpu and the robot responds very bad on the teleop part.
We couldn't fix the problem ourselves so we made the image processing part on only when triggered - but we would like to know are we doing something wrong and can we do better?

We are using a 320x240 resolution and got to 20% compression (tested 10% and it didn't matter). FPS doesn't seem to matter much too. We also added a 100ms delay to the image processing loop - not much change.

Thanks for any advise!
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2014, 09:23
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: Vision Target Detections makes cRIO code slow

The cRio is not a very powerful processor, so running all your robot code AND all this Vision at the same time is a big tax on CPU.

I reccomend putting all your vision code in the Dashboard and just sending back whatever values you need for Auto and Teleop. Read the dashboard values in Periodic Tasks and write the values to Globals, this way it's almost the same as having your Vision in the project vi, but without all the CPU usage!
__________________
Per Audacia Ad Astra
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2014, 10:23
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,372
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Vision Target Detections makes cRIO code slow

It is possible to use the cRio for image processing successfully, but it takes a bit of adjusting.

1) Minimize the resolution to only what is necessary for good target detection.
320X240 seems to work well.
2) Use compression to reduce image size, but not too much as to over reduce image quality.
30%-50% has worked well
3) Choose the lowest possible frame rate that allows good robot response.
15 FPS for the camera and limiting the vision processing loop to once every 100ms has worked well and is a good starting point.

As mentioned earlier, the cRio isn't the most powerful vision processor, but it is sufficient if you are willing to make a few compromises.

If compromise isn't an option, vision processing on your DS is your quickest solution because you already have the hardware and code to set it up.

The alternatives to DS processing is an on-board co-processor like the BeagleBone, O-Droid, PCDuino and RPi.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Reply With Quote
  #4   Spotlight this post!  
Unread 04-02-2014, 11:24
idoshamir idoshamir is offline
Registered User
FRC #5038
 
Join Date: Jan 2014
Location: Israel
Posts: 18
idoshamir is an unknown quantity at this point
Re: Vision Target Detections makes cRIO code slow

Hello! Thank you very much - we actually thought of using the Dashboard code just a little before your replies and started working on it!

We managed quite alright but we have a few problems/questions:
a. The distance computed in the Dashboard code is different than the distance in the robot code - although the code is the same! We think it is has something to do with the Get Image / Dashboard Image VIs but we do know how to change and compare between them.
It is very strange. Can you think of why this happens?

b. We are using DS Write and DS Read to communicate between the DS and the cRIO - is this the way to do this and will work the the ports blocked during the game etc?

Thank you for your help.
Reply With Quote
  #5   Spotlight this post!  
Unread 04-02-2014, 13:36
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Vision Target Detections makes cRIO code slow

The distance calculation assumes a specific field of view of the camera. If you connect a different model camera than the software is expecting, the numbers could be different.

Running the vision processing only when necessary is a good idea.

Smart Dashboard communication uses a TCP port that is open on the competition network.
Reply With Quote
  #6   Spotlight this post!  
Unread 05-02-2014, 09:05
idoshamir idoshamir is offline
Registered User
FRC #5038
 
Join Date: Jan 2014
Location: Israel
Posts: 18
idoshamir is an unknown quantity at this point
Re: Vision Target Detections makes cRIO code slow

The camera type was the problem! So easy and it works!
Thank you very much.
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 20:54.

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