Averaging positions in URCap

Hello,

I’m creating a URCap, which allows the user to teach a few points.

For each point I’m getting the X, Y, Z, RX, RY and RZ values.

Then I need to calculate the center/average between them. I think for the XYZ, it is relatively straight forward, but I’m wondering how I can do it for the rotations. I don’t think simply averaging them can work. Currently looking into quaternion slerps, but I’m not sure if it is the right approach.

Has someone already done this?
Thanks.

Not sure it helps, since I don’t know exactly what you’re looking for, but the URScript command “pose_dist()” gives the difference in each value of a Pose, rotations included.

Hi Eric, thanks for your suggestion, but it doesn’t help me much, because I’m looking to create a whole new pose out of the ones that were taught, and this new one should be in the middle of them all (their center position).
For the X, Y and Z, just getting the sum and dividing it by the number of points should do the trick, but for RX, RY, and RZ I’m unsure how to get the average.