Go to Post (Don't you hate it...) "when... no more buttons can fit onto your clothing at competitions?" - mcb [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-02-2006, 23:13
crossedheart's Avatar
crossedheart crossedheart is offline
Resident Female
AKA: Katherine
FRC #0753 (High Desert Droids)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Bend, Oregon
Posts: 2
crossedheart is an unknown quantity at this point
Send a message via AIM to crossedheart Send a message via MSN to crossedheart Send a message via Yahoo to crossedheart
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   Spotlight this post!  
Unread 08-02-2006, 23:39
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Grabbing Tilt Angle?

Quote:
Originally Posted by crossedheart
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?
If you are using the KOP gimbal then
TILT_SERVO is probably what you are looking for.
Just
#include "tracking.h"
in user_routines.c
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #3   Spotlight this post!  
Unread 08-02-2006, 23:41
sparkydp sparkydp is offline
Registered User
AKA: David Page
FRC #0435 (Robodogs)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2002
Location: Raleigh, NC
Posts: 32
sparkydp is on a distinguished road
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   Spotlight this post!  
Unread 09-02-2006, 00:58
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Grabbing Tilt Angle?

Quote:
Originally Posted by crossedheart
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?
There is a simple expression in terminal.c that will convert from PWM units to degrees. It's explained further here: http://www.chiefdelphi.com/forums/sh...41&postcount=3

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #5   Spotlight this post!  
Unread 09-02-2006, 01:11
sparkydp sparkydp is offline
Registered User
AKA: David Page
FRC #0435 (Robodogs)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2002
Location: Raleigh, NC
Posts: 32
sparkydp is on a distinguished road
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:
Originally Posted by Kevin Watson
There is a simple expression in terminal.c that will convert from PWM units to degrees. It's explained further here: http://www.chiefdelphi.com/forums/sh...41&postcount=3

-Kevin
  #6   Spotlight this post!  
Unread 09-02-2006, 01:35
Keith Watson Keith Watson is offline
Registered User
FRC #0957 (WATSON)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Wilsonville, OR
Posts: 112
Keith Watson is just really niceKeith Watson is just really niceKeith Watson is just really niceKeith Watson is just really nice
Re: Grabbing Tilt Angle?

Quote:
Originally Posted by sparkydp
due to the installation of the servo to the bracket, is there any guarantee that 0 degrees will actually be horizontal?
There is no guarantee, you should measure it. We measured our camera mount last weekend. Servo values of 127 (zero degrees) did not center the camera to the mount. There may also be a difference between your mount and your bot.
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
  #7   Spotlight this post!  
Unread 09-02-2006, 02:09
Keith Watson Keith Watson is offline
Registered User
FRC #0957 (WATSON)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Wilsonville, OR
Posts: 112
Keith Watson is just really niceKeith Watson is just really niceKeith Watson is just really niceKeith Watson is just really nice
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.
  • T_Packet_Data.mx = X pixel of the target centroid
  • T_Packet_Data.my = Y pixel of the target centroid
  • Horizontal camera field of view = 44 degreees (someone calculated this but I would verify it experimentally)
  • Vertical camera field of view = 34 degreees (someone calculated this but I would verify it experimentally)
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.

Last edited by Keith Watson : 09-02-2006 at 02:29.
  #8   Spotlight this post!  
Unread 09-02-2006, 03:08
Calvin Calvin is offline
Registered User
no team
 
Join Date: Feb 2005
Location: Portland OR
Posts: 105
Calvin has a spectacular aura aboutCalvin has a spectacular aura about
Re: Grabbing Tilt Angle?

Quote:
Originally Posted by Keith Watson
There is no guarantee, you should measure it. We measured our camera mount last weekend. Servo values of 127 (zero degrees) did not center the camera to the mount. There may also be a difference between your mount and your bot.
What we did was set both values to 127... than while the servos were on, adjusted the camera mount (those + thingys on the servos actually) to center both the TILT and PAN.
Closed Thread


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 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


All times are GMT -5. The time now is 00:36.

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