View Single Post
  #2   Spotlight this post!  
Unread 30-11-2007, 21:35
Pat Fairbank's Avatar
Pat Fairbank Pat Fairbank is offline
Circuit Breaker
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2001
Location: San Jose, CA
Posts: 2,132
Pat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond repute
Send a message via MSN to Pat Fairbank
Re: help getting servo values from camera

Since the default code just uses PWMs 1 and 2 for the camera servos, you should be able to just read the values in directly from the pwm01 and pwm02 variables at any point in the loop after the Camera_Handler() function is called.

As for knowing if the camera is locked on, you can use the camera confidence value - the higher it is, the more sure the camera is that it is locked on to a target. There's a predefined threshold macro (its default value is 20), so you can just do something like this:
Code:
if (T_Packet_Data.confidence >= CONFIDENCE_THRESHOLD_DEFAULT)
{
  // locked on
}
else
{
  // searching
}
Edit: Alternately, you can call the Get_Tracking_State() function, which will return SEARCHING, TARGET_IN_VIEW, or CAMERA_ON_TARGET.

I've never used the camera menu, so unfortunately I can't help you with the last point.
__________________
Patrick Fairbank
Team 254 | Mentor (2012-)
Team 1503 | Mentor (2007-2011)
Team 296 | Alumnus (2001-2004) | Mentor (2005-2006)

patfairbank.com

Last edited by Pat Fairbank : 30-11-2007 at 21:39.