|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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?
Last edited by crossedheart : 08-02-2006 at 23:16. Reason: tilt not pan |
|
#2
|
|||||
|
|||||
|
Re: Grabbing Tilt Angle?
Quote:
TILT_SERVO is probably what you are looking for. Just #include "tracking.h" in user_routines.c |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
||||
|
||||
|
Re: Grabbing Tilt Angle?
Quote:
-Kevin |
|
#5
|
|||
|
|||
|
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:
|
|
#6
|
|||
|
|||
|
Re: Grabbing Tilt Angle?
Quote:
|
|
#7
|
|||
|
|||
|
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.
Last edited by Keith Watson : 09-02-2006 at 02:29. |
|
#8
|
|||
|
|||
|
Re: Grabbing Tilt Angle?
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Camera angle - interesting question | TEAM1949 | Programming | 3 | 08-02-2006 22:20 |
| Nerf ball starting at 12m/s 45 degree angle ending at 8ft 6in w/ air resistance | Ethulin | Technical Discussion | 39 | 14-01-2006 19:04 |
| Viewing Angle of Camera | Joe Johnson | Technical Discussion | 10 | 14-01-2005 14:11 |
| Calc. Triangle Angle or Side Based on Ellipses? | indieFan | Math and Science | 1 | 07-06-2004 21:25 |
| PBASIC ARCTAN function | Greg Ross | Programming | 14 | 11-05-2003 12:28 |