Go to Post Hall of Fame FIRST Team 254 has arguably helped more teams become good than any other team in FIRST. I don't think they need a lecture on helping their opponents. - Karthik [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 18-03-2006, 18:40
Roger Roger is offline
Registered User
FRC #1153
 
Join Date: Jan 2006
Rookie Year: 1900
Location: Walpole MA
Posts: 685
Roger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond reputeRoger has a reputation beyond repute
T_Packet_Data.mx vs PAN_SERVO

After scratching our collective heads over getting our turret to point AT the light instead of 20-degrees or so off, we dug into code with some printf's, and searched here to find some sort of answer. We have been using the .mx number for a pan angle, but in Kevin's code where the camera reports out the T_Packet_Data stuff, we find that it's using PAN_SERVO for the number (and converting it to degrees). There was also this tidbit from "Moving robot while tracking with camera questions..." (which I think I can manage to show at http://www.chiefdelphi.com/forums/sh...ad.php?t=42993 -- yes! I did it!) with this answer:

Quote:
The tracking code automatically moves the servos to get the target in the center of the camera's field of view. The variables that the camera gives you are T_Packet_Data.mx, T_Packet_Data.my, T_Packet_Data.x1, T_Packet_Data.x2, T_Packet_Data.y1, T_Packet_Data.y2, T_Packet_Data.pixels, T_Packet_Data.confidence. mx and my are the coordinates of the center mass of the target. x1, y1, x2, and y2 are the coordinates for the bounding rectangle of the target. pixels is the blob size, and confidence relates to how close the actual target color is to the pre-programmed target color. The servo positions are accessed via PWM. You can use the constants PAN_SERVO and TILT_SERVO to get the positions.
Once we used PAN_SERVO, the skies brightened, the clouds parted, angels sang, and most importantly the camera and the turret both agree where the green light should be. Say it's ain't so, Kevin, that all this time I should use PAN_SERVO instead of T_Packet_Data.mx to find the pan angle!

For the record, we are using the Bells and Whistles version of camera of Feb 20th.

Roger.
who somehow managed to code urls, quoting and bolding for the first time! Better than them angels singing!
 


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 03:14.

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