View Single Post
  #9   Spotlight this post!  
Unread 10-02-2005, 01:00
ace123's Avatar
ace123 ace123 is offline
Registered User
AKA: Patrick Horn
FRC #0008 (Paly Robotics - http://robotics.paly.net/)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Palo Alto, CA
Posts: 50
ace123 has a spectacular aura aboutace123 has a spectacular aura about
Send a message via AIM to ace123
Question TC command after camera_stop() doesn't work.

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 wrote this from memory since I don't have access to the other computer, but it is the general idea (check for updates, stop, turn, track).

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;)
__________________
-Patrick Horn, Paly Robotics

Check out the space simulator called Vega Strike, modelled after the space simulator games Elite and Wing Commander. It's Open Source too!
If you have ever played Wing Commander, or especially Privateer, and had a feeling of nostalga derived from the you will enjoy these two Vega Strike mods: Privateer Gemini Gold and Privateer Remake!
I'm working on adding multiplayer support this year...