Go to Post I've heard of mentors who keep talking until they are blue in the face, but this is my first time actually seeing one. - Richard Wallace [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 26-12-2014, 09:33
FantasticNinjas FantasticNinjas is offline
Registered User
FRC #3205
 
Join Date: Dec 2014
Location: Concord, Massachusetts
Posts: 4
FantasticNinjas is an unknown quantity at this point
Post FRC Computer Vision Code

For the past couple weeks I have been working on creating a system for recognizing FRC hot targets and determining distance to them. This is a work in progress, and any feedback / suggestions people have would be much appreciated.

GitHub Repository

Reply With Quote
  #2   Spotlight this post!  
Unread 28-12-2014, 03:56
Djur's Avatar
Djur Djur is offline
WPILib
AKA: Sam Carlberg
no team
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Massachusetts
Posts: 182
Djur will become famous soon enough
Re: FRC Computer Vision Code

Are you planning on using OpenCV? Right now it looks like you're writing everything from scratch and that's going to take a very long time to do.
__________________
WPILib dev (RobotBuilder, SmartDashboard, GRIP)
Reply With Quote
  #3   Spotlight this post!  
Unread 28-12-2014, 14:06
FantasticNinjas FantasticNinjas is offline
Registered User
FRC #3205
 
Join Date: Dec 2014
Location: Concord, Massachusetts
Posts: 4
FantasticNinjas is an unknown quantity at this point
Re: FRC Computer Vision Code

I have already figured the whole thing out, I am just implementing what I already have planned on paper at this point. Also, I looked at the code for openCV, and while it is a very powerful framework, using it for this would be a performance nightmare. The first version of this actually used openCV. I spent over a week optimizing it, but it still ran slow. OpenCV is an truck; I need a sedan.
Reply With Quote
  #4   Spotlight this post!  
Unread 28-12-2014, 19:14
Djur's Avatar
Djur Djur is offline
WPILib
AKA: Sam Carlberg
no team
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Massachusetts
Posts: 182
Djur will become famous soon enough
Re: FRC Computer Vision Code

Are you planning to run this code on the roboRIO or the driver station? I know OpenCV got built for the roboRIO but I'm not sure if it was ever benchmarked.

OpenCV should run fine on a decent driver station (so no classmate). I got it working last year at about 30 fps on a crappy three year old Alienware laptop.
__________________
WPILib dev (RobotBuilder, SmartDashboard, GRIP)
Reply With Quote
  #5   Spotlight this post!  
Unread 28-12-2014, 22:39
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: FRC Computer Vision Code

Quote:
Originally Posted by Djur View Post
I know OpenCV got built for the roboRIO
OpenCV has been around since June of 2000 and was initially developed in Russia...
__________________
"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
  #6   Spotlight this post!  
Unread 29-12-2014, 11:07
FantasticNinjas FantasticNinjas is offline
Registered User
FRC #3205
 
Join Date: Dec 2014
Location: Concord, Massachusetts
Posts: 4
FantasticNinjas is an unknown quantity at this point
Re: FRC Computer Vision Code

Quote:
Originally Posted by Djur View Post
Are you planning to run this code on the roboRIO or the driver station?
We're planning on running it on the roboRIO. A major reason we are doing this in the first place is for the autonomous portion, during which communication with the driver station is prohibited.

Quote:
Originally Posted by Djur View Post
I got it working last year at about 30 fps on a crappy three year old Alienware laptop.
Crappy Alienware laptop? My team's drive station is a 2009 white macbook with a core 2 duo processor and 2gb ram. Oh, and to control the robot it needs to be running windows in a VM . I would not be surprised if running the vision code on the roboRIO would be faster anyway (I'm only mostly joking).
Reply With Quote
  #7   Spotlight this post!  
Unread 29-12-2014, 12:03
cgmv123's Avatar
cgmv123 cgmv123 is offline
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,082
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Re: FRC Computer Vision Code

Quote:
Originally Posted by FantasticNinjas View Post
the autonomous portion, during which communication with the driver station is prohibited.
This doesn't happen. The robot is always has communication with the driver station.
__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)

Reply With Quote
  #8   Spotlight this post!  
Unread 29-12-2014, 12:49
FantasticNinjas FantasticNinjas is offline
Registered User
FRC #3205
 
Join Date: Dec 2014
Location: Concord, Massachusetts
Posts: 4
FantasticNinjas is an unknown quantity at this point
Re: FRC Computer Vision Code

Quote:
Originally Posted by cgmv123 View Post
This doesn't happen. The robot is always has communication with the driver station.
You're right. This is my first year being part of FRC, so I only know what the rest of my team has told me. I could have been confused or they could have been confused, but either way, thanks for the information.

At this point I'm not entirely sure whether we will be doing the vision processing on the drive station or the roboRIO. The roboRIO has a slower processor, but sending an image from the camera to the roboRIO, then to the modem, and then to the drive station sounds like a lot of latency.
Reply With Quote
  #9   Spotlight this post!  
Unread 29-12-2014, 16:50
nickmcski nickmcski is offline
Registered User
AKA: Nicholas McCurry
FRC #1482 (Grandin Ghosts)
Team Role: Alumni
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Canada
Posts: 112
nickmcski has a spectacular aura aboutnickmcski has a spectacular aura aboutnickmcski has a spectacular aura about
Re: FRC Computer Vision Code

Quote:
Originally Posted by FantasticNinjas View Post


You're right. This is my first year being part of FRC, so I only know what the rest of my team has told me. I could have been confused or they could have been confused, but either way, thanks for the information.

At this point I'm not entirely sure whether we will be doing the vision processing on the drive station or the roboRIO. The roboRIO has a slower processor, but sending an image from the camera to the roboRIO, then to the modem, and then to the drive station sounds like a lot of latency.
We tried this last year and with the right settings it worked OK, the problem is the FTA had to talk to us because we were exceeding our bandwidth limit since the image we were sending was too high resolutions.

The other problem we had was we didn't account for the diamond plating on the driver station so the reflection from the LED ring was tricking our vision tracking software into thinking it was a target.
Reply With Quote
  #10   Spotlight this post!  
Unread 29-12-2014, 19:11
Djur's Avatar
Djur Djur is offline
WPILib
AKA: Sam Carlberg
no team
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Massachusetts
Posts: 182
Djur will become famous soon enough
Re: FRC Computer Vision Code

Quote:
Originally Posted by faust1706 View Post
OpenCV has been around since June of 2000 and was initially developed in Russia...
The OpenCV codebase was compiled to run on the roboRIO. I'm not saying that it was created for the roboRIO.

Quote:
Originally Posted by FantasticNinjas View Post
Crappy Alienware laptop? My team's drive station is a 2009 white macbook with a core 2 duo processor and 2gb ram. Oh, and to control the robot it needs to be running windows in a VM . I would not be surprised if running the vision code on the roboRIO would be faster anyway (I'm only mostly joking).
You don't have to run your vision stuff in the VM. OS X can still connect to the robot and you can run your java app there, although I still wouldn't expect it to process images at any more than 15 fps because of the Duo (for comparison, my laptop was running an i5-2537M). 15 fps should be fine if you don't try to use it to shoot or aim when the robot's going full speed.

Quote:
Originally Posted by nickmcski View Post
The other problem we had was we didn't account for the diamond plating on the driver station so the reflection from the LED ring was tricking our vision tracking software into thinking it was a target.
If that happens, your code should ignore "targets" smaller than some threshold. Then you'd only be processing the real targets.
__________________
WPILib dev (RobotBuilder, SmartDashboard, GRIP)
Reply With Quote
  #11   Spotlight this post!  
Unread 06-01-2015, 14:00
Cmxu Cmxu is offline
Registered User
FRC #3205
 
Join Date: Jan 2015
Location: Concord MA
Posts: 1
Cmxu is an unknown quantity at this point
Re: FRC Computer Vision Code

Sorry for taking up everyone's time, but the communication on this team has been rather poor coming into this season. First of all, we are running our vision code on the computer and I am not worried about processing power or speed. Second of all, we will be using openCV for our vision processing. After reading your code, I'm not sure it's right for the job. In the past, we have had bandwidth issues with our camera, and I think that somehow got miscommunicated to our newer members.
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 18:11.

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