Go to Post Its easier to solve a problem when you have a positive attitude about it. - Arefin Bari [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 19-03-2012, 17:56
mjgard's Avatar
mjgard mjgard is offline
Michael
AKA: Michael Gard
FRC #2844 (Stampede Robotics)
Team Role: Teacher
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Laveen,AZ
Posts: 74
mjgard will become famous soon enough
Re: Vision Tracking Help

Would anyone mind posting some sample code for turret control. To begin I would be happy to just control the turret with the vision tracking, shooting distance would be a bonus. I have got all the vision processing working from the examples and can track the rectangles. I just need to know what to do with the output. It sounds like it isnt a lot of work, I just dont know where to start with it. We are going to have 2 limit switches on our turret so it doesnt try to do a 360, it could pull off a 360, but the wires would be a nightmare.
__________________
Michael
Stampede Robotics Mentor
FRC 2844

2012 Arizona Regional --Judges' Award
2012 Las Vegas Regional -- Regional Winners
2012 Las Vegas Regional-- Coopertition Award
2009 Arizona Regional -- Rookie All Star Award
Reply With Quote
  #2   Spotlight this post!  
Unread 19-03-2012, 19:32
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 Tracking Help

If you can track the rectangles, than you can find the x coordinate of the target you want to aim at. If your camera is mounted such that it turns with the turret, you need to establish what screen coordinate the turret actually is aiming at. Then you can find the difference between the desired coordinate and the tracked one, and use that to turn the turret and make the two values the same.

Do you understand that high-level description?
Reply With Quote
  #3   Spotlight this post!  
Unread 19-03-2012, 19:42
mjgard's Avatar
mjgard mjgard is offline
Michael
AKA: Michael Gard
FRC #2844 (Stampede Robotics)
Team Role: Teacher
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Laveen,AZ
Posts: 74
mjgard will become famous soon enough
Re: Vision Tracking Help

I think I understand this in words, but putting it into labview is the difficulty. I think you are saying if the camera is mounted center on the turret then your target might have an coordinate of (0, 5) and as you move the coordinate would change but we want the program and the turret to do everything in its power to keep the X-Coordinate at 0. The Y may change as you get closer or move further away, but the program is trying to keep the X the same to keep it centered on the turret.

Now making that a reality is where I am going to struggle.
__________________
Michael
Stampede Robotics Mentor
FRC 2844

2012 Arizona Regional --Judges' Award
2012 Las Vegas Regional -- Regional Winners
2012 Las Vegas Regional-- Coopertition Award
2009 Arizona Regional -- Rookie All Star Award
Reply With Quote
  #4   Spotlight this post!  
Unread 19-03-2012, 20:52
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,114
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: Vision Tracking Help

Try something similar to this.

You'll want to use the X coordinate from the camera as the process variable to a PID controller (since this will change with the rotation of the turret). Your setpoint should be the center of the image (where you want the target to appear). This can be found by dividing the X resolution of the image by two. Note that this also assumes that the camera is mounted exactly on the center of the shooter - you might have to tweak the setpoint to make it mesh with your system. You'll need to tune the PID constants in my snippet - since they're the default values. There are other threads around for help on PID gain tuning (just search for them).
Attached Thumbnails
Click image for larger version

Name:	auto aim.png
Views:	126
Size:	16.6 KB
ID:	12363  
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote
  #5   Spotlight this post!  
Unread 19-03-2012, 22:46
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,752
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 Tracking Help

If you are using the Target location from the LV example, it is a -1 to 1 coordinate with 0 in the center, not 80. If you are using a more raw version, width/2 would be the right target for the PID.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 20-03-2012, 20:16
yelk11 yelk11 is offline
Registered User
FRC #3414
 
Join Date: Jan 2012
Location: farmington
Posts: 27
yelk11 is an unknown quantity at this point
Re: Vision Tracking Help

how do you add another camera that is not an axis camera. mine is a trendnet tv-IP110/A
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 22:09.

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