|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#13
|
||||
|
||||
|
Hmm... I'm trying to get the servos to turn while tracking and I fail every time:
If I use camera_find_color and then set servos, it stops finding color. If I use camera_stop(), camera_set_servo(), camera_find_color() then it resets to center because that's what camera_find_color() does. If I put all the color init code at the beginning, and then only run the TC command at the time, then stop it, it doesn't recieve updates: Code:
///// For some reason camera_track_update() returns 0 unless I call reset before I send the TC command.
static int counter=0;
if (camera_track_update()) {
// updated
} else {
// no update
}
counter++;
if (counter>15) {
counter=0;
camera_stop(); // in user_camera
camera_set_pan_servo(...); // sends "SV 0 xxx"
// camera_reset(); // If I call this then it works, but keeps jumping to the center servo position.
camera_track_continue(); // function that just sends "TC ... ... ..."
}
I am sure that the individual camera_ functions work as they work when not setting the servo, and the servos move but don't track. But the combination causes it ot not reply with a "T ... ..." packet. Also, I read something about poll mode ("PM 1") I tried this and it still did not recieve packets. Have any of you had this method work? Maybe I have to call the TC command twice. (I remember having to click the button twice in the java program to retart the tracking...? I could also try using HyperTerminal and pasting in all the stuff that it would have sent from the RC. Do you have any ideas about what works for you? If I can't figure it out, it won't hurt the time very much to actually turn the entire robot instead (pwm01=80;pwm02=-80; ) |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Camera Auto Tracking? | Ryan Cumings | Programming | 9 | 22-01-2005 02:20 |
| IR Tracking & Navigation | Tallman | General Forum | 3 | 20-01-2004 17:26 |
| auto archiving of posts | Joe Ross | CD Forum Support | 4 | 01-01-2004 02:04 |
| My auto is better than yours.. lol | randomperson | Programming | 25 | 07-04-2003 12:10 |
| picking auto program | Mike375 | Programming | 19 | 03-03-2003 15:47 |