|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Programming for CMUCam
Hey quick question..
To stop the Servo_Track(); from tracking.. could i just say Tracking_Initialized = 0; to stop it? |
|
#2
|
||||
|
||||
|
Re: Programming for CMUCam
You can just not call the function..
if (track_enabled == 1) { Servo_Track(); } |
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
Re: Programming for CMUCam
How would i do that? ..
|
|
#5
|
|||
|
|||
|
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:
|
|
#6
|
|||||
|
|||||
|
Re: Programming for CMUCam
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();
}
Code:
if((tracking_menu_active == 0)&&(whatever condition you want here)) ) and you want your code to call Servo_Track() if jbotRulesTheWorld equals 1. You would write:Code:
if((tracking_menu_active == 0)&&(jbotRulesTheWorld == 1)) Code:
if(tracking_menu_active == 0) JBot (rules the world... )EDIT: Oh, well Chris31 beat me to it. I'll still leave this post here for clarity. |
|
#7
|
|||
|
|||
|
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
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |