Go to Post Band geek FIRST geeks = uberparty! - Nuttyman54 [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 24-12-2006, 17:37
chris31 chris31 is offline
Team 2021 Captain
AKA: Chris Davidson
FRC #2021 (FA Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2006
Location: Atlanta, GA/ Fredericksburg,VA
Posts: 949
chris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond repute
Send a message via AIM to chris31
Re: Programming for CMUCam

Remember that the robot runs on a continuos loop. So instead of stopping it, you just need to not call in on they next loop if you dont want it to be running.
  #2   Spotlight this post!  
Unread 24-12-2006, 18:47
teh_pwnerer795 teh_pwnerer795 is offline
Registered User
AKA: !!Mitch!!
FRC #1392
Team Role: Programmer
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Ajax, Canada
Posts: 142
teh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really nice
Send a message via MSN to teh_pwnerer795 Send a message via Yahoo to teh_pwnerer795
Re: Programming for CMUCam

Quote:
Originally Posted by chris31 View Post
Remember that the robot runs on a continuos loop. So instead of stopping it, you just need to not call in on they next loop if you dont want it to be running.
How would i do that? ..
__________________
Great Art is Created; Master Pieces are Stolen

[n00b]Teh_Foxdonut teh_pwnerer795 - CounterStrike:Source
  #3   Spotlight this post!  
Unread 24-12-2006, 18:51
chris31 chris31 is offline
Team 2021 Captain
AKA: Chris Davidson
FRC #2021 (FA Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2006
Location: Atlanta, GA/ Fredericksburg,VA
Posts: 949
chris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond repute
Send a message via AIM to chris31
Re: Programming for CMUCam

Dont call Servo_trace in you user_routine when you dont want it to run. Say you only want it to run when switch_1 is on then it would look like this

PHP Code:
if (switch_1 == 1)
{
Servo_Track();

  #4   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?
  #5   Spotlight this post!  
Unread 25-12-2006, 00:23
teh_pwnerer795 teh_pwnerer795 is offline
Registered User
AKA: !!Mitch!!
FRC #1392
Team Role: Programmer
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Ajax, Canada
Posts: 142
teh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really nice
Send a message via MSN to teh_pwnerer795 Send a message via Yahoo to teh_pwnerer795
Re: Programming for CMUCam

found an easier way .... i'll just declare Camera_Idle(); ... that'll stop everything that its trying to track.. but thxs alot for ur help
__________________
Great Art is Created; Master Pieces are Stolen

[n00b]Teh_Foxdonut teh_pwnerer795 - CounterStrike:Source
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
Programming The CMUcam for the Vex controller 987HighRoller Programming 3 24-06-2006 15:27
COM port settings for CMUcam labview testing and programming pwilczynski Programming 1 15-01-2006 15:09
CMUcam for Dummies? nosaj4268 Programming 2 14-01-2006 23:55
Program for CMUcam valahan Programming 1 10-01-2006 18:03
CMUcam autonomous programming kshot Programming 1 17-01-2005 19:18


All times are GMT -5. The time now is 01:21.

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