View Single Post
  #7   Spotlight this post!  
Unread 12-02-2005, 03:34
Leav's Avatar
Leav Leav is offline
Spud Gun Division
AKA: Leav Oz-Ari
FRC #3316 (D-Bug)
Team Role: Mentor
 
Join Date: Dec 2004
Rookie Year: 2005
Location: Technion, Haifa, Israel
Posts: 774
Leav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond repute
Send a message via ICQ to Leav Send a message via AIM to Leav Send a message via MSN to Leav
Re: Camera stops working when we use camera_set_servos()...

Quote:
Originally Posted by Matt Krass
It works, but it calls camera_stop() in camera_set_servos(), which interestingly enough makes it stop..everything, color tracking included. Without camera_stop() it jsut seizes up the camera.

just an idea, but.....

what if:
1)you took the pwm out on the camera, and connected that to the pwn in on the robot controller.
2)connected a pwm out from the robot controller to the servos on thecamera mount.

now all you need to do is decide on the software level when you want to track and when you want to keep panning.
Code:
if (!tracking) //if the caera isn't trying to track - pan
{
    pwm_15=cnt;
    cnt += dir;
    if(cnt >= 210)
      dir = -5;
    else if(cnt <= 40)
      dir = 5;
    
    printf("Didn't find it: %d\r",cnt);
}
else if (tracking) //if the camera is trying to track, give the servos it's values.
{
    pwm_15=pwm_in15;
}
one problem might be that the camera wouldnt know where it started, and if it needs its current location to move the servos correctly, you would need to compensate somehow:
Code:
else if (tracking) //if the camera is trying to track, give the servos it's values.
{
    pwm_15=(cnt-127)+pwm_in15; //if the camera expects to start from 127, then you need to compenstae, because it thinks it's starting at a different place.....
}
(cnt-127) gives you the offset....

just my 0.02 NIS (New Israeli Shekel)
-Leav
__________________
"We choose to build robots this season and do the other things; Not because they are easy, but because they are hard."
-Paraphrasing JFK

Participated in FIRST as a student: 2005-2006 (But still learning every season!)
Mentor: 2008 - ? (Team 2630 2008-2011, and Team 3316 since 2013)
Engineer: 2011 - ? (B.Sc. and M.Sc. in Mech. Eng. from the Technion IIT)
FIRST Volunteer - 2007 - ? (MC, FTA, FIRST Aid etc.)