How do I get eulerangles from two Vector3 coordinates based on openpose 3d?

174 Views Asked by At

In short. I want to make following program.

Input: Two Vector3 coordinates P1 = (x1, y1, z1) P2 = (x2, y2, z2)

output: one Eulerangles (P1->P2 or P2->P1).

I'm trying to apply 3d openpose joint data to robot arm control. 3d openpose data is constructed by Vector3 (x, y, z). but I must use EulerAngles to control a robot arm.

Please tell me how to calculate EulerAngles from two Vector3 coordinates.

The following diagram outlines what I want to do. Sorry for the hand-drawn illustration.
outline diagram

The following is a brief summary of code

def convert_pos2angle(P1, P2):
    
    ## some code here.
    

    return angle


def main():
    #sample input
    P1 = [0, 0, 0]
    P2 = [1, 1, 1]
    
    #convert
    angle = convert_pos2angle(P1, P2)

    print(angle)

    
1

There are 1 best solutions below

0
On BEST ANSWER

I was able to solve this problem on my own. I found the project "video2bvh" on GitHub. It Converts openpose to BVH data. These programs work very well.

GitHub: https://github.com/KevinLTT/video2bvh