Go to Post If there are no top tier teams, then who do we look up to for inspiration? - artdutra04 [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 20-05-2016, 09:51
s5511's Avatar
s5511 s5511 is offline
Registered User
FRC #5511
 
Join Date: Jan 2016
Location: Cary, NC
Posts: 58
s5511 is an unknown quantity at this point
Vision Summer Project

Our team is going to try to develop a vision solution over the summer. We currently have an Nvidia Jetson TK1, Rasberry Pi, and Nexus 5 all available for us to use for this purpose. We also have LabVIEW robot code and a turret with an SRX encoder on our robot that would use the vision programming to aim at the high goal.

Which method of vision processing would you all recommend for us to try out during the summer? What are the disadvantages/advantages to the methods you all have used this past season?

Thanks!
__________________


NC Rookie All Star, Rookie Highest Seed 2015
NC THOR Winner 2015
NC Guilford County Winner and Creativity Award 2016
Reply With Quote
  #2   Spotlight this post!  
Unread 20-05-2016, 10:01
marshall's Avatar
marshall marshall is offline
My pants are louder than yours.
FRC #0900 (The Zebracorns)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2003
Location: North Carolina
Posts: 1,282
marshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond repute
Re: Vision Summer Project

Quote:
Originally Posted by s5511 View Post
Our team is going to try to develop a vision solution over the summer. We currently have an Nvidia Jetson TK1, Rasberry Pi, and Nexus 5 all available for us to use for this purpose. We also have LabVIEW robot code and a turret with an SRX encoder on our robot that would use the vision programming to aim at the high goal.

Which method of vision processing would you all recommend for us to try out during the summer? What are the disadvantages/advantages to the methods you all have used this past season?

Thanks!
I would suggest you use the resources you have available at the Team 900 Home for Displaced Robotics Teams. We're happy to help.

The specific solution doesn't matter until you set some goals first for what you are aiming to do. No, those weren't puns. You need to set more parameters such as "we want to be able to aim/shoot/fire in X seconds with Y accuracy". Then you begin to build a solution around that.
__________________
"La mejor salsa del mundo es la hambre" - Miguel de Cervantes
"The future is unwritten" - Joe Strummer
"Simplify, then add lightness" - Colin Chapman
Reply With Quote
  #3   Spotlight this post!  
Unread 20-05-2016, 10:28
Hitchhiker 42's Avatar
Hitchhiker 42 Hitchhiker 42 is offline
Roboter
AKA: Mark Lavrentyev
FRC #4557 (FullMetal Falcons)
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: Cromwell, CT
Posts: 501
Hitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to beholdHitchhiker 42 is a splendid one to behold
Re: Vision Summer Project

I have met success with doing processing on the dashboard using the NI Vision Assistant Programming. Certainly, this isn't the best, but IMO it's a great starting step before going on to optimize everything more.
__________________



2016 - NE District Championship Entrepreneurship Award
2016 - Hartford District Industrial Design Award
2016 - Waterbury District Engineering Inspiration Award
Reply With Quote
  #4   Spotlight this post!  
Unread 20-05-2016, 11:30
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 349
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Vision Summer Project

Quote:
Originally Posted by marshall View Post
You need to set more parameters such as "we want to be able to aim/shoot/fire in X seconds with Y accuracy". Then you begin to build a solution around that.
I disagree. You don't build a solution around shooting in 5 seconds by learning that you can aim in 2 seconds and then sleeping the other 3. You just shoot as fast as possible and as accurately as possible. It's hard to predict what these levels will be until you try it.

We built vision this year around NI vision and vision assistant. Vision assistant (and grip as well) are great places to start because you can visualize processing steps. The disadvantage of NI vision is its lack of documentation. We had issues with overlays, scaling, and undocumented error codes that we still haven't figured out.

OpenCV may be a bit more complicated, but it's got a large community around it that can help you if you encounter problems.

Good luck developing vision!
Reply With Quote
  #5   Spotlight this post!  
Unread 20-05-2016, 11:49
RobotMonkey RobotMonkey is offline
Registered User
FRC #1413
 
Join Date: Jan 2015
Location: United States
Posts: 7
RobotMonkey is an unknown quantity at this point
Re: Vision Summer Project

I would use your jetson along with python and opencv. You could get the bulk of it done in a couple days, even if you don't much about it. Make sure you turn off auto white balance on the camera, and set the exposure low to avoid washed out images. Superbrightleds.com sells some appropriate 12v green led ring lights.

The actual details of the implementation can be pretty much taken right from this ball tracking tutorial. It does most all of the same things you'll want to do.
http://www.pyimagesearch.com/2015/09...g-with-opencv/

HSV convert, threshold on bright green, maybe a dilate or two, find contours, pick the largest contour, find bounding box, find offset from the center of the bounding box to some aim point, send offset to roborio for aiming correction. UDP sockets preferred, or network tables if you have to.

Using the above tutorial and OpenCV documentation, I had something which could track the tape in about a day. That is coming from somebody with no python or opencv background too.
Reply With Quote
  #6   Spotlight this post!  
Unread 20-05-2016, 17:11
vScourge's Avatar
vScourge vScourge is offline
Videogame Developer
AKA: Adam Pletcher
FRC #4096 (Ctrl-Z)
Team Role: Coach
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Champaign, IL
Posts: 39
vScourge is on a distinguished road
Re: Vision Summer Project

Quote:
Originally Posted by RobotMonkey View Post
I would use your jetson along with python and opencv.
Is there a build of OpenCV that fully utilizes the Jetson's GPU? If there still isn't, I'm not sure why a Jetson would be preferable over the smaller, easier-to-power RPi2.

I would be glad to be mistaken, however, since we have a Jetson TK1 collecting dust.
Reply With Quote
  #7   Spotlight this post!  
Unread 20-05-2016, 17:46
AlexanderTheOK AlexanderTheOK is offline
Guy
no team
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Los Angeles
Posts: 146
AlexanderTheOK is just really niceAlexanderTheOK is just really niceAlexanderTheOK is just really niceAlexanderTheOK is just really nice
Re: Vision Summer Project

Quote:
Originally Posted by vScourge View Post
Is there a build of OpenCV that fully utilizes the Jetson's GPU? If there still isn't, I'm not sure why a Jetson would be preferable over the smaller, easier-to-power RPi2.

I would be glad to be mistaken, however, since we have a Jetson TK1 collecting dust.
While I believe there's an opencv package called OpenCV4Tegra, the whole point of using a CUDA card on the jetson was that many vision processing libraries (especially opencv) already have cuda implementations.
Reply With Quote
  #8   Spotlight this post!  
Unread 20-05-2016, 18:51
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Vision Summer Project

Quote:
Originally Posted by s5511 View Post
Our team is going to try to develop a vision solution over the summer. We currently have an Nvidia Jetson TK1, Rasberry Pi, and Nexus 5 all available for us to use for this purpose. We also have LabVIEW robot code and a turret with an SRX encoder on our robot that would use the vision programming to aim at the high goal.

Which method of vision processing would you all recommend for us to try out during the summer? What are the disadvantages/advantages to the methods you all have used this past season?

Thanks!
I made this post a while ago there is a lot of useful information there.

I found it easiest to do it in python with OpenCV. A few key links are:

Team 1648 Python Vision Code - That gave me a good guide line. Lines 150 - 193

Installing python and openCV on raspberry

Open Cv Tutorials

If you want the code I am using just PM me.
Reply With Quote
  #9   Spotlight this post!  
Unread 20-05-2016, 22:04
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: Vision Summer Project

Quote:
Originally Posted by vScourge View Post
Is there a build of OpenCV that fully utilizes the Jetson's GPU? If there still isn't, I'm not sure why a Jetson would be preferable over the smaller, easier-to-power RPi2.

I would be glad to be mistaken, however, since we have a Jetson TK1 collecting dust.
I'm not sure what you mean by "fully utilizes," but if you install the CUDA libraries on the Jetson and then compile OpenCV with CUDA support enabled, you can write a vision program that uses the GPU. AFAIK, there are no wrappers available for the GPU functions in Python, so that part would have to be written in C++.

I used this approach this year, writing most of our vision code in Java with a small JNI library in C++ doing some processing on the GPU. This significantly helped with performance, boosting our framerate from around 20 FPS to 30 FPS (it would have gone higher but was limited by the camera).

There is also the OpenCV4Tegra library, which includes some CPU optimizations for the Jetson (NEON, SIMD, multithreading), and I believe it also includes CUDA support.

Also, powering the Jetson TK1 (I've heard the TX1 is more sensitive) is not very hard. We used this regulator and have had no problems with it all season.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists

Last edited by Ben Wolsieffer : 20-05-2016 at 22:08.
Reply With Quote
  #10   Spotlight this post!  
Unread 21-05-2016, 08:49
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Vision Summer Project

If anyone has questions or issues with NI Vision or Vision Assistant, please post about it. There is quite a bit of documentation about the functions for all languages and conceptual as well, but you have to open up the chm files.

Also, one of the things I'll be messing with is the OpenCV utilities that they recently released. It allows for image translation so that you can use both NIVision and OpenCV in the same program -- but I think it only has a few functions wrapped and it'll be fun to see which ones are helpful in FRC situations.

Greg McKaskle
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 02:07.

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