Go to Post Don’t forget the purpose of Chiefdelphi. It is to keep the community connected and to help each other out. Moderators have been working days and nights to keep this forum going years after years. Let’s keep this place professional. - Arefin Bari [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 13-01-2015, 19:15
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Thumbs up Vision Tracking Solution

I am proud to announce Team 3019's Vision tracking in java!

I have found that the libraries from First are too unreliable or do not even work and have researched a solution to tracking a yellow tote with or without the retro-reflective tape with green led ring-light. The solution I created runs on the driver-station computer meaning it will not interfere with the RobotRio's processing power but should take up more bandwidth.

I commented the code to describe my methodology and tried to make it as readable as possible. The program does not have a graphical user interface (gui) as it is the bare bones vision tracking without distance or any information based purely based on location of it relative to the point (0,0).

If you are going to use it all I ask is to give credit where credit is due.

Cheers!

Github Link
Reply With Quote
  #2   Spotlight this post!  
Unread 13-01-2015, 22:30
Ozuru's Avatar
Ozuru Ozuru is offline
It's always the programmer's fault.
no team
 
Join Date: May 2013
Rookie Year: 2010
Location: Earth
Posts: 268
Ozuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to behold
Re: Vision Tracking Solution

Interesting solution, nice work on it. It's very sleek and simple.
Reply With Quote
  #3   Spotlight this post!  
Unread 13-01-2015, 23:46
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: Vision Tracking Solution

Good job! It takes a lot of work to do just this, believe it or not.

If you want to take it one step further, you can figure out the angle the camera(robot) needs to move to make the center of the object the center of the image.

Simply solve this proportion

Image width/Fov_x= distance from the center of the image/degrees

be careful though, the origin of the image in opencv is the top left, so you have to do a linear remapping of the point so the origin is the center of the screen!

proof of concept: In 2013 we used this x rotation value to line up with the 3 pt goal autonomously using a pid as shown slightly in this video: http://youtu.be/VhE10dNBxXs?t=27s

Those micro adjustments were not done by our driver, but rather by simply pushing a button on the controller to line up.

This is just food for thought. Take it as you will. (You can also calculate distance to your target if your camera height and angle stay constant, that involves y rotation )
__________________
"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
  #4   Spotlight this post!  
Unread 16-01-2015, 19:59
aaronjeline aaronjeline is offline
Aaron
FRC #1719 (Umbrella Corporation)
Team Role: Programmer
 
Join Date: Nov 2013
Rookie Year: 2013
Location: Baltimore
Posts: 18
aaronjeline is an unknown quantity at this point
Re: Vision Tracking Solution

Hey, sorry for being a tad scrubby, but where is the OpenCV Library you are using?
Reply With Quote
  #5   Spotlight this post!  
Unread 17-01-2015, 01:04
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Vision Tracking Solution

It is openCV 2.4.10 downloadable here
Reply With Quote
  #6   Spotlight this post!  
Unread 17-01-2015, 15:13
aaronjeline aaronjeline is offline
Aaron
FRC #1719 (Umbrella Corporation)
Team Role: Programmer
 
Join Date: Nov 2013
Rookie Year: 2013
Location: Baltimore
Posts: 18
aaronjeline is an unknown quantity at this point
Re: Vision Tracking Solution

Continuing in my eternal scrubiness, I got the library working fine, but I keep getting an error on
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
NATIVE_LIBRARY_NAME cannot be resolved or is not a field

Any ideas? All the imports are working, and code referencing objects/fields in the library aren't throwing any errors.
I'd appreciate any help I could get.

Last edited by aaronjeline : 17-01-2015 at 15:15. Reason: I accidentally a word
Reply With Quote
  #7   Spotlight this post!  
Unread 17-01-2015, 18:54
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Vision Tracking Solution

for version 2.4.10 the string value is "opencv_java2410"
Reply With Quote
  #8   Spotlight this post!  
Unread 18-01-2015, 15:37
gegozi gegozi is offline
Registered User
no team
 
Join Date: Apr 2014
Rookie Year: 2012
Location: Bellaire, TX
Posts: 46
gegozi is an unknown quantity at this point
Re: Vision Tracking Solution

Hello,
I am wondering if other FRC teams are allowed to copy this code.
Thanks.
Reply With Quote
  #9   Spotlight this post!  
Unread 18-01-2015, 16:00
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Vision Tracking Solution

Quote:
Originally Posted by gegozi View Post
Hello,
I am wondering if other FRC teams are allowed to copy this code.
Thanks.
of course! Just give credit to my team(3019) that's all I ask!
Reply With Quote
  #10   Spotlight this post!  
Unread 20-01-2015, 22:51
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Vision Tracking Solution

Updated! fixed a big memory leak!
Reply With Quote
  #11   Spotlight this post!  
Unread 07-02-2015, 09:31
popcorn107 popcorn107 is offline
Registered User
FRC #2386
 
Join Date: Feb 2015
Location: Canada
Posts: 4
popcorn107 is an unknown quantity at this point
Re: Vision Tracking Solution

At the moment we are trying to get our robot to center itself with the bin by rotating (later on by strafing as well). How might we go about getting the center of the bin from your program? First time trying to implement Vision and am having some troubles fully understanding.
Reply With Quote
  #12   Spotlight this post!  
Unread 07-02-2015, 15:32
WillNess's Avatar
WillNess WillNess is offline
Programmer
AKA: Will Ness
FRC #4944 (The Hi Fives)
Team Role: Programmer
 
Join Date: Apr 2014
Rookie Year: 2014
Location: United States
Posts: 90
WillNess is just really niceWillNess is just really niceWillNess is just really niceWillNess is just really nice
Re: Vision Tracking Solution

The import for opencv "highgui" is not working, like it can't find it. Any help would be appreciated.
__________________

Outreach Lead // Lead Programmer // Junior

2014 FRC:
Rookie Allstar, Highest Rookie Seed & Semifinalist @ Utah
Rookie Allstar, Highest Rookie Seed & Semifinalist @ Colorado
2015 FRC:
Creativity In Engineering & Semifinalist @ Arizona West
Reply With Quote
  #13   Spotlight this post!  
Unread 07-02-2015, 23:21
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Vision Tracking Solution

This solution uses opencv 2.4.10 not 3.0
Reply With Quote
  #14   Spotlight this post!  
Unread 08-02-2015, 18:44
WillNess's Avatar
WillNess WillNess is offline
Programmer
AKA: Will Ness
FRC #4944 (The Hi Fives)
Team Role: Programmer
 
Join Date: Apr 2014
Rookie Year: 2014
Location: United States
Posts: 90
WillNess is just really niceWillNess is just really niceWillNess is just really niceWillNess is just really nice
Re: Vision Tracking Solution

Thanks I believed that worked. But when we're creating java classes on roborio, we get errors. We have installed the libraries for OpenCV.
__________________

Outreach Lead // Lead Programmer // Junior

2014 FRC:
Rookie Allstar, Highest Rookie Seed & Semifinalist @ Utah
Rookie Allstar, Highest Rookie Seed & Semifinalist @ Colorado
2015 FRC:
Creativity In Engineering & Semifinalist @ Arizona West
Reply With Quote
  #15   Spotlight this post!  
Unread 08-02-2015, 21:38
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Vision Tracking Solution

It's meant to be run on the driverstation laptop not the actual robot
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 13:03.

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