Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Servos for the camera (http://www.chiefdelphi.com/forums/showthread.php?t=33336)

MV_Hirsch 24-01-2005 16:07

Servos for the camera
 
Is there anything that you can call to figure out what the position of the servo is? What method would I call?
---Thankx

MikeDubreuil 24-01-2005 16:13

Re: Servos for the camera
 
There isn't a function or method to tell you the position of a servo.

This is an overview of how the servo works:
The software tells the robot controller to send the servo a position (0-254). Then the servo will try with all it's might to get to and stay at that position. There is never any feedback to the robot controller from the servo.

phrontist 24-01-2005 16:28

Re: Servos for the camera
 
How do we know the orientation of the camera then?

Greg Marra 24-01-2005 16:31

Re: Servos for the camera
 
Quote:

Originally Posted by phrontist
How do we know the orientation of the camera then?

The camera is what is driving your servos, and it tells the RC where it thinks the servo is at. The actual variable used to relay this is described in the documentation for the camera. You can also find it in the source code of the default camera tracking code, particularly where it echoes the information back through the serial port by a printf.

Mike Soukup 24-01-2005 16:35

Re: Servos for the camera
 
I'm assuming you have the servos hooked up directly to the camera and are using the tracking feedback loop in the camera. In the default code in user_camera.c : camera_track_update() the RC gets some data back from the camera. Among this data is the pan & tilt positions (cam.pan_servo & cam.tilt_servo) of the servos. The pan position is used in user_routines.c : Camera_Processing() to make the robot turn left / right, and with a few more lines of code you can make the robot drive forward / backward based on the tilt.


All times are GMT -5. The time now is 02:49.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi