Practical issue regarding Quaternions

In summary: JensIn summary, Jens is having trouble setting a specific starting position for an object and having it move relative to that position. He is considering using quaternion multiplication or conjugation to achieve this, but is facing the issue of resulting in non-unity quaternions. He is seeking advice on how to solve this problem.
  • #1
jensru
1
0
Hi there!

I´ve got a practical problem with quaternions which I was not able to solve by my own so far.

A machine detects the position and orientation of an object which I get as unity quaternion.
I visualize that using matlab, which still works more or less, but I´d like to 'force' the object to a defined position in the beginning and make the following movement relative to that. I hope it´s understandable what I want?

So my thought was to 'define' the first quaternion, which is ~ [0.89 -0.27 -0.28 -0.2] as [1 0 0 0] just by subtracting the difference and also subtract the difference from the following quaternions. But obviously that won´t work, because the result is no longer a unity quaternion in most cases. So does anyone has an idea of how to solve my problem?

Thanks a lot in advance
jens
 
Physics news on Phys.org
  • #2


Hello Jens,

Thank you for sharing your problem with us. It sounds like you are trying to set a specific starting position and then have the object move relative to that position. This can be achieved by using a technique called "quaternion multiplication."

First, let's define the starting quaternion as q0, and the following quaternions as q1, q2, q3, etc. To move the object relative to q0, we need to multiply each subsequent quaternion by q0. This can be written as q1' = q0 * q1, q2' = q0 * q2, q3' = q0 * q3, etc.

This will result in new quaternions that are relative to the starting position. However, as you mentioned, this may not always result in a unity quaternion. To fix this, we can normalize the resulting quaternion by dividing each component by the magnitude of the quaternion.

Alternatively, you can also use the concept of "quaternion conjugation" to rotate the object to a specific position. This involves finding the inverse of the starting quaternion, q0^-1, and then multiplying it with each subsequent quaternion. This can be written as q1' = q0^-1 * q1, q2' = q0^-1 * q2, q3' = q0^-1 * q3, etc.

I hope this helps you solve your problem. If you have any further questions or need clarification, please don't hesitate to ask.


 

FAQ: Practical issue regarding Quaternions

What are quaternions and why are they used in practical applications?

Quaternions are a type of mathematical concept that extends the complex numbers to four dimensions. They are used in practical applications, such as computer graphics and robotics, because they can represent rotations in three-dimensional space without experiencing the issues of gimbal lock that can occur with other methods.

How are quaternions different from other methods of representing rotations?

Unlike other methods, such as Euler angles, quaternions do not suffer from gimbal lock, which is a phenomenon that occurs when two of the three rotational axes align. This can cause inaccuracies and difficulties in representing rotations. Quaternions also have a more compact representation and are more numerically stable than other methods.

What are some practical challenges when using quaternions?

One challenge is that quaternions can be difficult to visualize and understand, as they involve four dimensions. Another challenge is that they require more computational resources compared to other methods, which can be an issue for real-time applications. Additionally, quaternions can be prone to numerical errors, so careful implementation is necessary.

How are quaternions used in computer graphics?

In computer graphics, quaternions are used to represent rotations of objects in three-dimensional space. They are particularly useful for animating 3D objects, as they can smoothly interpolate between rotations and avoid gimbal lock. Quaternions are also used in skeletal animation, where they represent the rotations of joints in a character's skeleton.

Can quaternions be used for other practical applications besides computer graphics?

Yes, quaternions have a wide range of practical applications outside of computer graphics. They are used in robotics, aerospace engineering, and navigation systems, among others. Quaternions are also used in physics and engineering simulations, as well as in 3D printing and motion capture technology.

Similar threads

Back
Top