Go to Post If your robot can't play at least two matches on one battery, your mechanical design and/or driver strategy needs some rethinking. - Al Skierkiewicz [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 21:35.

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