Jump to content

Rotations Question ...


Slastraf
 Share

Go to solution Solved by Slastraf,

Recommended Posts

I need more data on how the Ultra Engine works.
I had great success combining the Vicon SDK headers, dlls ...,  inside Ultra Engine.
It is used to track real life objects into virtual space.
The tracking translation works fine, however I have great issues adjusting the details.

The Vicon SDK Documentation says this about their conventions

Units
"Positions are expressed in millimeters. Rotation is expressed in radians."

When I convert from radians to degrees to be applicable inside Ultra Engine, there are various issues, such as the object flipping at certain angles etc. I convert by multiplying each vector component by (180 / 3.14)
Instead of Euler XYZ there are also functions to get the Quat , x y z w  . This had no flipping issues but the axis are not aligned.

"The quaternion is of the form (x, y, z, w) where w is the real component and x, y and z are the imaginary
components. N.B. This is different from that used in many other applications, which use (w, x, y, z)."
Ultra Engine uses x,y,z,w as i remember from the documentation. However the axis are still flipped.

I made a video to show how the tracking currently works:
https://ody.sh/b85p8I5GK8 (odysee)

SetAxisMapping() :
Vicon Data uses a right-handed coordinate system, with +X forward, +Y left, and +Z up


I am at a loss at how to properly implement this.

Link to comment
Share on other sites

Update Ultra
The engine uses a left-handed coordinate system. The X axis points to the right, the Y axis points up, and the Z axis points forward.
            this->client->SetAxisMapping(
                ViconDataStreamSDK::CPP::Direction::Right,
                ViconDataStreamSDK::CPP::Direction::Up,            // Y-up
                ViconDataStreamSDK::CPP::Direction::Forward
            );

the rotation axis are still wrong.
I have a reference live view inside vicon tracker, and the rotations are very different

Link to comment
Share on other sites

//radians to degrees
rot.x = UltraEngine::Degrees(rot.x);
rot.y = UltraEngine::Degrees(rot.y);
rot.z = UltraEngine::Degrees(rot.z);

// prevent gimbal lock
this->model->SetRotation(0, 0, 0);
this->model->Turn(rot.x, 0.0, 0.0);
this->model->Turn(0.0, rot.y, 0.0);
this->model->Turn(0.0, 0.0, rot.z);

this is example code to prevent gimbal lock. i do no longer use quaternions. but from radians eulers converted instead.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...