Go to Post Nothing motivates people to join like the promise of a trip to far-away lands of regional/championship competition during school days :) - Joe G. [more]
Home
Go Back   Chief Delphi > Technical > Programming
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
  #1   Spotlight this post!  
Unread 02-02-2012, 15:58
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Lightbulb Calculating Angle to Target

So after getting some rudimentary rectangle detection working, I've found some big drawbacks in the "simple" way of turning one direction or the other until facing the center of the target rectangle. The big problem is (at least for our test robot) it takes a significant amount of power to the motors to start moving, and once you get moving, your moving quite fast and tend to overshoot the target; leading to the robot swinging wildly back and forth.

So what I'd like to do is determine the angle the robot needs to turn from the each image, and monitor a gyroscope to determine when to slow down and stop (using periodic, low framerate, images to update the angle to target).

To do this, we'll need to no the angle between our current and desired facing; eventually I came up with an idea I'd like to field here:

The camera has a fixed field of view; regardless of your distance from the target, the left edge of the image is a fixed number of degrees from the center, so it should be possible to determine the needed rotation by:
[r](deg_delta) = [x](pixel_delta) * [a](pixels/deg)

I do understand the edges of the image are a bit fish-eyed (or perhaps the whole thing) so it may not be quite this simple, but should be easy enough to measure.


What does CD think... is this a good approach, or is there a better way of doing this that I'm overlooking?
 


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 23:40.

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