# Set gripping orientation depending on component orientation

Hello everyone,

I am sitting on a problem for quite some time now. Let A be a component, which has an initial position a_pick in the world coordinate system. To pick A, a gripping point and orientation gripper_pick are known in the world coordinate system as well.
Now I have a place position a_place. How do I get the orientation of the gripper for a_place?

I have tried different things already:

1. Get WPR of a_pick and a_place, calculate the difference, and add the difference to the WPR angles of gripper_pick to get gripper_place, which seemed to be reasonable, as all positions are defined in the world coordinate system. However, it didnâ€™t work as I hoped. (See attached picture).

2. I also tried to rotate the position matrix of gripper_pick around the difference between a_pick and a_place. This however did not work either.

I use .Net API for my project to read in relevant data about positions and process sequences from a JSON File. I would be happy if someone could help me with this problem or could tell me, which function I have to use to transform the gripper orientation correctly.

Kind regards,
Josh

Hi,

WPR angles are generally not something you can perform sum and difference operations and get meaningful results. In order to â€śchainâ€ť transformations you need to use matrix multiplication and inverse operations.

Letâ€™s look at the picture below. On the first image you have 3 transformations (matrices). â€śpartâ€ť matrix is know position of a part. â€śpickâ€ť matrix is taught pick position for gripper. â€śpartâ€ť and â€śpickâ€ť are using the same reference coordinate system (e.g. robot world). â€śpick_in_partâ€ť is the pick position in reference to part position. And it can be calculated like this in python API:

``````ipart = vcMatrix.new(part)
ipart.invert()
pick_in_part = ipart * pick
``````

On the second image you have new known position for part called â€śpart_xâ€ť. And you want to know new known pick position â€śpick_xâ€ť. This can now be calculated with the help of known transformation â€śpick_in_partâ€ť:

``````pick_x = part_x * pick_in_part
``````

-k

1 Like