<< return to Pixycam.com

Retrieving the servo position values (angle of rotation)

I’m trying to retrieve the servos’ (pan and tilt) respective rotation angles based on the x and y coordinates of the object detected by the pixy cmucam5. Can anyone please help me out?

By the way, I intend to place this camera on a robot platform (with gripper and omni wheels). Once the x and y coordinates of the “taught object” is identified, the entire platform will align itself in such a way that the entire robot will rotate to the direction of the object and move forward to collect it with the gripper.

Thanks in advance.

Hello Lim,
I’m confused by your question. Are you using the pan/tilt demo? Please describe your setup.

Edward

Hello Lim,
I’m confused by your question. Are you using the pan/tilt demo? Please describe your setup.

Edward

Sorry for the missing details. Yes, I’m using the pan/tilt demo and I have seen the x and y coordinates of the detected object via the serial monitor. However, I have no idea on how to retrieve these values for the rotation of my robot platform.

Sorry for the missing details. Yes, I’m using the pan/tilt demo and I have seen the x and y coordinates of the detected object via the serial monitor. However, I have no idea on how to retrieve these values for the rotation of my robot platform.

Hello Lim,
The pan/tilt demo is meant just as a demo. Are you using an Arduino to talk to Pixy? You should consider controlling the pan/tilt servos from the Arduino (the pan_tilt demo does this). When you do this you will have all the information you need.

Hope this helps!