Reputation: 11
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)
Upvotes: 0
Views: 212
Reputation: 11
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
Upvotes: 0