View Single Post
  #6   Spotlight this post!  
Unread 24-12-2006, 19:01
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Programming for CMUCam

Quote:
Originally Posted by teh_pwnerer795 View Post
How would i do that? ..
In user_routines.c in Kevin Watson's "bells and whistles" version of his camera code (which you are probably using if you are calling Servo_Track()) there is this code:
Code:
	// This function reads data placed in the T_Packet_Data
	// structure by the Camera_Handler() function and if new
	// tracking data is available, attempts to keep the center
	// of the tracked object in the center of the camera's
	// image using two servos that drive a pan/tilt platform.
	// If the camera doesn't have the object within it's field 
	// of view, this function will execute a search algorithm 
	// in an attempt to find the object.
	if(tracking_menu_active == 0)
	{
		Servo_Track();
	}
You are looking at the last bit there. That code checks if the code in terminal.c (I think) has set the tracking_menu_active variable to 0; if it has, it calls Servo_Track(). What you want to do is modify the line two lines above Servo_Track(); to read something like:
Code:
if((tracking_menu_active == 0)&&(whatever condition you want here))
where "whatever condition you want here" is replaced by what you want your code to check to see if it should call Servo_Track(). You could have a variable, for instance, called jbotRulesTheWorld (hey, I just had to add that ) and you want your code to call Servo_Track() if jbotRulesTheWorld equals 1. You would write:
Code:
if((tracking_menu_active == 0)&&(jbotRulesTheWorld == 1))
in place of the original
Code:
if(tracking_menu_active == 0)
Good luck, and if you need more help don't hesitate to post back here.

JBot (rules the world... )

EDIT: Oh, well Chris31 beat me to it. I'll still leave this post here for clarity.
__________________
Aren't signatures a bit outdated?