# Hand Eye Calibration Formula

I'm trying to write a Python formula so that my robot arm can pick up a tennis ball (I'll be adding a gripper soon). The depth camera is mounted near the toolhead.

Any help on writing this formula or how I would write this formula would be appreciated!

Picture: Here is some sample data that I have collected:

• Camera center is -6.5 inches from the toolhead
• The robot coordinate system uses the mounting plate of the robot as its starting point.
• The camera coordinate system uses the center of the camera as its starting point.
• The camera xyz orientation is: 1. The positive x-axis points to the right.
2. The positive y-axis points down.
3. The positive z-axis points forward.

The robot xyz orientation is: 1. The positive x-axis points forward.
2. The positive y-axis points to the left.
3. The positive z-axis points upward.

---- sample 1 ----

robot start position (inches) xyz, toolhead angle 10.12 0 10.06 -50

what camera sees at robot start position (inches) xyz 10.89 1.37 13.62

robot at ball (inches) xyz, toolhead angle 14.5 .1 1.99 -35

---- sample 2 ----

robot start position (inches) xyz, toolhead angle 10.12 0 10.06 -50

what camera sees at robot start position (inches) xyz 3.36 -1.07 15.59

robot at ball (inches) xyz, toolhead angle 17.5 4.5 1.99 -35

---- sample 3 ----

robot start position (inches) xyz, toolhead angle 10.12 0 10.06 -50

what camera sees at robot start position (inches) xyz 7.81 2.0 12.7

robot at ball (inches) xyz, toolhead angle 15.5 2 1.99 -35