Go to Post I got to meet Andy Baker, and Grady, and I saw Andy Brockway. Is that like an Andy Triple Play or something?? ;) - Ian Curtis [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 05-02-2009, 19:30
Wicked Wicked is offline
Registered User
FRC #0354 (G-House Pirates)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: New York
Posts: 46
Wicked is an unknown quantity at this point
Post Camera tracking and following

Our team is trying to get our robot to follow a vision target. We used the Two Color Servo Example VI to track the target with the camera. Now we want to make the robot itself follow the target, but we have absolutely no idea how to do this. Any examples or help will be greatly appreciated.
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2009, 20:46
airnate airnate is offline
Registered User
FRC #0236 (Techno Ticks)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: southeastern CT
Posts: 93
airnate is a jewel in the roughairnate is a jewel in the roughairnate is a jewel in the rough
Re: Camera tracking and following

For starters we'll assume your camera is pointed straight ahead. So the first thing you'll want to know is if the target is to the left or right of center. The target coordinates come out of the Two Color Servo Example VI and give you X and Y in the image. The X will be the target's horizontal position and the Y will be the vertical position. Note that the origin in most image processing applications is at the top left of the image so the positive Y direction is downward.

You will then need to know the size (resolution) of the image that you are using. Let's assume your image size is 640x480 (I think this is the full size image that the camera can return, but you can specify smaller ones for faster frame rates). If the X value of target position is 320, then the target is straight ahead. If the X is less than 320, then the target is to the left. If the X is greater than 320, then the target is the right.

If you are using arcade steering in the Basic Robot Main.vi (I believe this is the out of the box default), then the X Axis Value of the Arcade Drive.vi will tell the robot whether to head left or right. So a simplistic approach might be to wire a 1 into the X Axis Value of the Arcade Drive.vi to go right and a -1 to go left. However, this will likely be too chaotic and you should reduce the magnitude of the X Axis Value as the target gets closer to center.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-02-2009, 16:16
Quarkster Quarkster is offline
Registered User
FRC #2729
 
Join Date: Jan 2009
Location: New Jersey
Posts: 4
Quarkster is an unknown quantity at this point
Re: Camera tracking and following

The camera has a 54 degree horizontal field of view. You can use this to get an angle offset. It your camera can move independantly of the chassis, you can use an encoder or potentiometer to get an additional angle.

That, combined with stadiometric rangefinding, can allow you to setup a polar coordinate system. If you keep track of previous ranges and angles, you can get relative velocity and acceleration.
Reply With Quote
  #4   Spotlight this post!  
Unread 15-02-2009, 15:45
Chris1228 Chris1228 is offline
Registered User
FRC #1228
 
Join Date: Sep 2007
Location: Rahway, NJ
Posts: 22
Chris1228 will become famous soon enough
Re: Camera tracking and following

Can someone post example code of how to use the arcade drive or tank drive to follow the color? i'm very lost. i'm a visual learner
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Camera Tracking Tanner NI LabVIEW 5 01-02-2009 11:28
Camera locked in "tracking", but not tracking geeknerd99 Programming 1 18-02-2007 22:47
Using kevin's code for driving and camera tracking razzoc Programming 3 18-02-2007 08:50
camera jerks and does not lock on when tracking kirkio Programming 2 10-02-2006 23:43
Light and Line Following Sensors jeffmorris FIRST Tech Challenge 1 15-12-2005 21:57


All times are GMT -5. The time now is 08:31.

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