0

I'm having the following problem: An algorithm is providing 3D poses in time, each described by a translation vector and a quaternion. The initial origin of this coord system is (0,0,0), rotation 0.

Now I would like to make one arbitrary pose of that stream "the kings" pose now, aka the origin of my new coordinate system. In my humble imagination I think, that it would be sufficient to apply a translation and rotation for every new incoming "old" coordinate into the new coord system by the translation/rotation derived at the time of fixing the new origin. But I have no idea, how to achieve that mathematically.

Any pointer welcome. Thanks.

decades
  • 827
  • 17
  • 25
  • I am doing this currently in 2D. Before I can answer, what is the format of the pose data? And is the pose data in delta (start at {0,0,0}, move BY {2,0,2}, ...), or absolute (start at {0,0,0}, move TO {2,0,2}, ...) – Werlious Nov 21 '19 at 23:59
  • Thanks for answering. The pose translation vector is x, y z. Origin is 0,0,0. Each new point is the offset along the axes in meters. If you take Euler NED as reference (x positive towards north, y positive towards, z positive towards ground) then the coord system of the source is like so: Euler x = -Device z, Euler y = Device x, Euler z = - Device y, but I guess this doesn't generally matter with respect to the problem. 2D would be sufficient for me too. – decades Nov 22 '19 at 12:27
  • In that case, I think it would suffice to just subtract the new "Kings pose" coords from the origin along with subtracting rotation angles as well. I am using something like this to deform 2d meshes after collisions, each point having a collision vector that starts at zero and is always subtracted from each point in the mesh. If this works let me know so I or someone else (or even you, good info is more important that good reputation and im honestly not good at explanations) can make a proper answer – Werlious Nov 24 '19 at 05:53
  • You are right. I figured it out during the weekend by myself. At least for the translation component subtracting the coordinates of the "King's" coordinate from every new incoming pose is the way to go in order to make the King the new origin. For the angles I know that it works that way for the yaw component, so I suppose it will work for pitch and roll too. Not tested yet. Thank you very much for your efforts – decades Nov 25 '19 at 08:33
  • No problem @decades. I'll go ahead and make an answer so the question can be closed. Glad I can help :) – Werlious Nov 25 '19 at 09:32

1 Answers1

0

I think it would suffice to subtract the coords of the new "kings pose" from incoming coordinates to achieve the translation. Could also help to have a "origin" vector stored on the object owning the poses with a default of (0,0,0) and subtract it from all incoming coords anyway so all you would have to do is set/clear the origin to change the "Kings Pose". Hope this helps

Werlious
  • 583
  • 6
  • 15