![]() |
Grabbing Tilt Angle?
Ok so my question is this: How can we grab the tilt angle from the camera as a variable that we can use in the user_routines.c? Has anyone done this?
|
Re: Grabbing Tilt Angle?
Quote:
TILT_SERVO is probably what you are looking for. Just #include "tracking.h" in user_routines.c |
Re: Grabbing Tilt Angle?
if you're using the Kevin Watson code that places the tilt servo on PWM1, you can simply read the value of pwm01, but it has also been #defined as PAN_SERVO for more intuitive readings. In the file tracking.c, you'll see a section of the code that starts with a comment "// y-axis/tilt tracking code"
you can see how the tracking.c uses it. But at any rate, it won't really give you an angle, so much as the position of the servo which is a number between 0 and 255, looking that up to an angle is either some scary math which might not be consistent with anyone else's based on how you installed the servo horns onto the servos. I would recommend just echoing your tilt value to the console with a printf and moving the camera until you determine what PWM value represents the angle you want. |
Re: Grabbing Tilt Angle?
Quote:
-Kevin |
Re: Grabbing Tilt Angle?
due to the installation of the servo to the bracket, is there any guarantee that 0 degrees will actually be horizontal?
Quote:
|
Re: Grabbing Tilt Angle?
Quote:
|
Re: Grabbing Tilt Angle?
Are those tilt angles, by themselves, accurate enough to use for aiming on your particular bot? This is an interesting question to consider. To answer it you need to read the tracking code to see what it is really doing. Look for what "locked" really means. Then some math is needed to calculate accuracies.
To answer the question you will need the following info which is not documented in the source code. I found it after searching the forums.
|
Re: Grabbing Tilt Angle?
Quote:
|
| All times are GMT -5. The time now is 21:54. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi