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.
As for now, I have managed to get the x and y coordinates of the “targeted object” with respect to the centre of the camera view after running the pan/tilt demo code. However, I still have no idea on how can I retrieve the rotation angle of the pan/tilt servos, which will be used to determine how many rounds should my omni wheels rotate to face the direction of the “targeted object”.
Thanks in advance.