Go to Post Congratulations to team 341, your work is nothing short of what I want to do when I grow up. - kjolana1124 [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 28-04-2015, 15:01
Caboose's Avatar
Caboose Caboose is offline
Programmer - LabVIEW, C++, C#, Java
AKA: James Parks
FRC #0900 (Zebracorns)
Team Role: Alumni
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Seattle, WA
Posts: 72
Caboose has a spectacular aura aboutCaboose has a spectacular aura about
Smile 900's 2015 Robot Code

Hey all,

With the championship now over, we at 900 are doing the yearly tradition of opening our repos to the public. Included is our LabVIEW Swerve Drive and Arm control, our dashboard, and the vision code we used this year on our on board Jetson TK1 to detect the green bins during auton. We will be releasing a few whitepapers in the following month(s) about the systems our robot used this year.

Feel free to ask us questions about our code here (If you have questions about champs and Einstein go here).

Links to GitHub:
Robot Code
Dashboard Code
Vision Code
As of April 28th this code has not been cleaned up.
__________________
navX Labview Library

"Robots are aluminum shavings, held together by zip-ties."

myManga
Reply With Quote
  #2   Spotlight this post!  
Unread 28-04-2015, 17:22
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Re: 900's 2015 Robot Code

I think I talked to you Saturday about your system. Really cool work. You said something that was really odd to me: you were getting ~15-20 fps. It didn't seem right, and looking at your code I now know why (or have a very good guess).

You are using 2 namespaces that have identical functions, such as erode, dilate, and threshold, cv and cv::gpu.

I'll use the function generateThreshold as a running example. You are passing in Mats, not GpuMat. Meaning when you call cvtColor on ImageIn, it will use the cpu based cvtColor. Same goes for threshold, split, erode and dilate.

There isn't a gpu equivalent of findcontours that I am aware of. There are gpu edge detectors such as sobel and laplacian, however.

Once again, excellent work. This took me a little while to figure out. I'd love to see what the fps is with these changes. Also, if you want to stick to object recognition through training, look into cudNN.
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."
Reply With Quote
  #3   Spotlight this post!  
Unread 29-04-2015, 11:37
Caboose's Avatar
Caboose Caboose is offline
Programmer - LabVIEW, C++, C#, Java
AKA: James Parks
FRC #0900 (Zebracorns)
Team Role: Alumni
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Seattle, WA
Posts: 72
Caboose has a spectacular aura aboutCaboose has a spectacular aura about
Re: 900's 2015 Robot Code

Quote:
Originally Posted by faust1706 View Post
I think I talked to you Saturday about your system. Really cool work. You said something that was really odd to me: you were getting ~15-20 fps. It didn't seem right, and looking at your code I now know why (or have a very good guess).

You are using 2 namespaces that have identical functions, such as erode, dilate, and threshold, cv and cv::gpu.

I'll use the function generateThreshold as a running example. You are passing in Mats, not GpuMat. Meaning when you call cvtColor on ImageIn, it will use the cpu based cvtColor. Same goes for threshold, split, erode and dilate.

There isn't a gpu equivalent of findcontours that I am aware of. There are gpu edge detectors such as sobel and laplacian, however.

Once again, excellent work. This took me a little while to figure out. I'd love to see what the fps is with these changes. Also, if you want to stick to object recognition through training, look into cudNN.
Thanks for the feedback. I'll have the students work on this after our break and when they have caught-up on last weeks homework.
__________________
navX Labview Library

"Robots are aluminum shavings, held together by zip-ties."

myManga
Reply With Quote
  #4   Spotlight this post!  
Unread 29-04-2015, 12:17
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 122
aeastet is an unknown quantity at this point
Re: 900's 2015 Robot Code

I looked through your code. I did not see that you guys used vision this year. The code that you had on github was a C++ library. Do you have a way to integrate the c++ library?
Reply With Quote
  #5   Spotlight this post!  
Unread 29-04-2015, 15:25
nstephenh nstephenh is offline
Registered User
FRC #0900
 
Join Date: Oct 2013
Location: North Carolina
Posts: 20
nstephenh is on a distinguished road
Re: 900's 2015 Robot Code

Quote:
Originally Posted by aeastet View Post
I looked through your code. I did not see that you guys used vision this year. The code that you had on github was a C++ library. Do you have a way to integrate the c++ library?
Our vision system runs on a nVidia Jetson. The Jetson writes values to networktables and the roborio reads them in order for our robot to align with bins in our two bin automonous, which you can see here: https://www.youtube.com/watch?v=WqHk50xX1_A. This vision system was in the works throught the entire season, but was not used at NC Regional or Palmetto Regional. In fact, I think we only used it sucessfully in 2 or 3 matches at St. Louis.
Reply With Quote
  #6   Spotlight this post!  
Unread 30-04-2015, 11:26
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 122
aeastet is an unknown quantity at this point
Re: 900's 2015 Robot Code

I posted our code (Team 107). If you have time take a look through it and let me know what you think. We had a very successful year. We have a three tote auto and we could pretty much change our auton with very short notice. We were 12 for 12 at worlds and about 98% for the rest of the year.

Here is a link

https://www.youtube.com/watch?v=snNPSlW0AhQ

Last edited by aeastet : 30-04-2015 at 11:33.
Reply With Quote
  #7   Spotlight this post!  
Unread 09-05-2015, 12:58
KJaget's Avatar
KJaget KJaget is offline
Zebravision Labs
FRC #0900
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2015
Location: Cary, NC
Posts: 44
KJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud of
Re: 900's 2015 Robot Code

Quote:
Originally Posted by faust1706 View Post
I think I talked to you Saturday about your system. Really cool work. You said something that was really odd to me: you were getting ~15-20 fps. It didn't seem right, and looking at your code I now know why (or have a very good guess).

You are using 2 namespaces that have identical functions, such as erode, dilate, and threshold, cv and cv::gpu.

I'll use the function generateThreshold as a running example. You are passing in Mats, not GpuMat. Meaning when you call cvtColor on ImageIn, it will use the cpu based cvtColor. Same goes for threshold, split, erode and dilate.

There isn't a gpu equivalent of findcontours that I am aware of. There are gpu edge detectors such as sobel and laplacian, however.
Sorry for the slow response, just saw this.

The short version of the answer is that you've managed to find dead code. The functions you list were written up and tested on the CPU and we found they didn't improve our detection accuracy, so we scrapped them. They're still in the code but they aren't used.

The detection code we do use is cascadeDetect(). There's a GPU and CPU version - we use the GPU version if a GPU is detected at startup (see the top of main()) and if not we fallback to a CPU. This lets us run the code on a normal laptop for testing and then only have to debug the GPU specific stuff on a Jetson.

When we switched from Haar to LBP cascades I did expect a decent performance bump based on what I'd read. The training speed did increase dramatically but the runtime performance didn't change too much. But after some quick testing, we saw similar performance with the bare-bones OpenCV cascade demo code. My guess is that Haar is either more GPU friendly or just not as well optimized. I'd be happy to find a simple fix if one if out there, though.
Reply With Quote
  #8   Spotlight this post!  
Unread 09-05-2015, 15:23
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Re: 900's 2015 Robot Code

Correct me if I'm wrong, but you only used the gpu for the cascade classifier it seems.
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."
Reply With Quote
  #9   Spotlight this post!  
Unread 09-05-2015, 16:46
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: 900's 2015 Robot Code

I was looking through your code and saw you have a lot of In Place Element Structures. What are these for?
Reply With Quote
  #10   Spotlight this post!  
Unread 09-05-2015, 18:02
KJaget's Avatar
KJaget KJaget is offline
Zebravision Labs
FRC #0900
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2015
Location: Cary, NC
Posts: 44
KJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud ofKJaget has much to be proud of
Re: 900's 2015 Robot Code

Quote:
Originally Posted by faust1706 View Post
Correct me if I'm wrong, but you only used the gpu for the cascade classifier it seems.
The conversion to grayscale and histogram equalize are also done on the GPU. But yeah, running the cascade classifier is all the vision stuff the code is doing so there's not much else to offload to the GPU. There's minor fiddling with rects in some of the modes we run in, but it probably isn't worth it to upload and download just for that.

Last edited by KJaget : 09-05-2015 at 18:06.
Reply With Quote
  #11   Spotlight this post!  
Unread 11-05-2015, 10:17
nstephenh nstephenh is offline
Registered User
FRC #0900
 
Join Date: Oct 2013
Location: North Carolina
Posts: 20
nstephenh is on a distinguished road
Re: 900's 2015 Robot Code

Quote:
Originally Posted by kgzak View Post
I was looking through your code and saw you have a lot of In Place Element Structures. What are these for?
Mostly just keeping things grouped together so autocleanup doesn't separate them.
Reply With Quote
  #12   Spotlight this post!  
Unread 11-05-2015, 10:42
prometheusLKR prometheusLKR is offline
Registered User
FRC #0900
 
Join Date: Jan 2014
Location: Raleigh
Posts: 3
prometheusLKR is an unknown quantity at this point
Re: 900's 2015 Robot Code

Quote:
Originally Posted by kgzak View Post
I was looking through your code and saw you have a lot of In Place Element Structures. What are these for?
We just use them as an organizational structure to make the code easier to read.
Reply With Quote
  #13   Spotlight this post!  
Unread 28-05-2015, 20:21
ForeverAlon ForeverAlon is offline
Registered User
AKA: Alon Greyber
FRC #0900 (Zebracorns)
Team Role: Programmer
 
Join Date: May 2015
Rookie Year: 2013
Location: Durham NC
Posts: 10
ForeverAlon will become famous soon enoughForeverAlon will become famous soon enough
Re: 900's 2015 Robot Code

Here is a link to team 900's vision whitepaper: http://www.chiefdelphi.com/forums/sh....php?p=1484741
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 06:53.

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