# Performing inverse kinematics based on a displacement of the end effector?

I think i have an simple problem, but can't my head around how i should resolve it...

My setup looks like this:

The grey box on end effector is supposed to be an camera, which measures a dx,dy,dz between the object and the camera. These are used to position the camera such that dz between the object and the camera is equal to 0.5, and dx = dy = 0.

I know that I using inverse kinematics can determine the Q which positions it according the given rotation and position, but what if I only provide it a position only?

How do extract all Q that make dx = dy = 0, and dz = 0.5, while keeping the object in sight at all time?

An example could be if an object was placed just above the base (see second image), it should then find all possible configurations which in this case would consist of the arm rotating around the object, while the camera keeps the object in sight...

Update

I just realized a possible solution would be to create a sphere with the object in centrum an radius of dz, and then use this sphere to extract all pairs of rotations and position... But how would one come by with such an solution?

You always have both position ad orientation. In your case the orientation can be chosen by you to be constant (e.g. 0, 0, 0), in which case you will be not be able to track the object if it is for example above the camera.

Th camera measures the relative position of the object (relative to the camera). You subtract the distance on the z axis that you want to keep and you add the difference to the current poseition of the robot. Morever you can calculate the angle how much the endefector has to rotate to face the object. Eg. If the camera measures: Dx = 0,5, dy=0 and dz=0,5 then you would add the dx to the current tcp position (since dz=0,5 which is the distance you want to keep). After that you can calulate the change in orientation needed to face the object by

$RotY = atan2(dx,dz) = atan2(0.5,0.5) = 45deg$

You add this (also calculate RotX and RotZ if not defined as "tool axis") to the current orientation of the end-effector and give it as reference (together withe the changed position) value for the next motion.

• What about my solution.. It seem like your solution only provide one solution.. – James potter Apr 22 '16 at 21:18
• Your inverse knematics should provide all solutions to the IK problem. This is independent of all the tracking functionality. For one given position (not considering the camera axis rotation) there is only one orientation that faces the object. You can define the spehre as you mentioned and get different positions and for the different orientations. You can write the shere equation with a known center point and radius. You can descretize it and each descerte point on the surface you can calculate the orientation which faces the object and use the IK function the get the Q angles. – 50k4 Apr 23 '16 at 6:13
• I am still confused... Is it a bad solution or a good solution. I am still struggling with getting the rotation matrices from each point on the sphere.. – James potter Apr 23 '16 at 6:22
• You do not need rotation matrices. You just need then x rotation angle and y rotation angle (if the z axis is your tool axis). Simplofy the problem. Consider a circle first, not a shpere (only on orientation, fix the other one). Make a sketch calculate the one angle for orientation geometrically then go on and to a sphere ad get the second angle similarly. It is not a good or a bas solution, it is one way of modelling the same thing. It as as good as any other solution. – 50k4 Apr 23 '16 at 6:33
• I am not sure I understand why I don't need a rotation matrix, shouldn't i somehow determine my desires rotation aswell? Trying to simplify the problem seems a good idea, but i am not sure which angles you want me to compute, The angle between the orientation vector and coordinate angle (x - axis,y-axis,z-axis) or? – James potter Apr 23 '16 at 6:41