View Single Post
  #4   Spotlight this post!  
Unread 15-01-2005, 08:54
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Camera Range Finding

cam.tilt_servo is the variable for your "tilt_position" and will return your tilt servo position as a value from 0 to 255.

FYI, camera_track_update in camera.c has a pretty good breakdown on what useful values you can read from the camera in tracking mode.

Code:
int camera_track_update(void)
{
  int i;

  if(wait_for_data()==0) return 0;
 
  if(cam_uart_buffer[0]=='T' && cam_index_ptr>=9)
    {
	  cam.x=cam_uart_buffer[1];
	  cam.y=cam_uart_buffer[2];
	  cam.x1=cam_uart_buffer[3];
	  cam.y1=cam_uart_buffer[4];
	  cam.x2=cam_uart_buffer[5];
	  cam.y2=cam_uart_buffer[6];
	  cam.size=cam_uart_buffer[7];
	  cam.conf=cam_uart_buffer[8];
	  if(cam_index_ptr>9)
		{
		  cam.pan_servo=cam_uart_buffer[9];
		  cam.tilt_servo=cam_uart_buffer[10];
		}
	  reset_rx_buffer();
	  return 1;
    }
  // Bad data in buffer
  reset_rx_buffer();
  return 0;
}
Good luck!

-SlimBoJones...

Last edited by Mr. Lim : 15-01-2005 at 08:58. Reason: originally didn't provide much info