[SOLVED] converting 2D coordinate systems

Hi,

We are building a vision guided robot system. No electrical or programming issues, but I have a question about the math.

We have a fixed camera, and a robot arm. The aim of the setup is that the robot arm picks up an item that the camera locates.

The camera gives the coordinates of the item in camera coordinates (x,y). These coordinates have to be translated to robot coordinates, so that the robot can get the item.

So there are 2 2D coordinate systems. They have an offset in X, in Y and there is a angle difference. Also, there is a difference in units. The camera gives its results in pixels, the robot works in mm.

I need a formula to convert the camera coordinates to robot coordinates.

How :

I put an object in the camera's view, and ask its coordinates. I get camera coordinates of point P1. Then I move the robot arm to the item. I read the coordinates from the robot and see the robot coordinates for P1. I do the same thing on a different location.

So for 2 points, I have the camera and the robot coordinates.

Now in the camera coordinate system, I want to calculate the center of the robot coordinate system, its angle and unit gain.

I think it should be possible. I started with equations, but I think that I should be easier with matrices.

I started to calculate the distance to the center from the two points = sqrt(x1²+x1²). This results in 2 circles crossing each other in 2 points. Then I have to find the correct point, and find angle and unit gain.