Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Yet another Camera thread... (http://www.chiefdelphi.com/forums/showthread.php?t=72944)

Pancake 25-01-2009 20:52

Yet another Camera thread...
 
1 Attachment(s)
For the past few days / week, I've been trying to get the camera code to work. This code I have made is a variation of the sample code provided. As an FYI, the Target.h and Target.cpp is a copy and paste from the sample code.

The code *seems* to recognize a target... when it sees pink above green (or was it green above pink?), the servos slow down significantly and then once the target is out of sight, it keeps on moving at a normal speed.

Help is appreciated,
Thanks.

EDIT: Seems like "Track.h" needs to go after "TrackAPI.h". Still, there's likely something wrong w/ the code.

Mike Mahar 26-01-2009 08:00

Re: Yet another Camera thread...
 
The most likely case of this problem is that the sign of the horizontal direction is backward. When the two color demo sees the target it tries to step slowly until it is in the target is in the center. If the step value is backward it actually moves away from the target. Once the target is out of the image, the normal panning, which is faster, will kick in.

Pancake 26-01-2009 11:42

Re: Yet another Camera thread...
 
Do you mean changing:
Code:

incrementV = verticalDestination - verticalPosition;
to
Code:

incrementV = verticalPosition - verticalDestination;
Now I wish I read the comments :(
Code:

// TODO: Check to see if this needs to be reversed
// you may need to reverse this based on your vertical servo installation



All times are GMT -5. The time now is 02:58.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi