Borrar filtros
Borrar filtros

Finding an angle from quaternions or rotations on planes?

6 visualizaciones (últimos 30 días)
Vittorio Rossi
Vittorio Rossi el 27 de Mayo de 2018
Editada: James Tursa el 4 de Jun. de 2018
Hello everyone!
For a project I'm working on I have acquired data using three sensors, placed as displayed in the picture on the human body. Each sensor is able to sample Roll, Pitch and Yaw (rotation on xy, xz and yz planes) but also quaternions (with a matrix containing q0,q1,q2 and q3).
The goal of the project is to calculate the angle of the knee and the hip (also shown in the picture). Intuitively the solution should be to somehow calculate the difference of some data between the sensor on the upper leg and lower leg for the knee joint angle and from the upper leg and pelvis for the hip angle.
I've tried two metods using MATLAB:
  • calculating the difference between q0 of one sensor and q0 of the other, q1 and q1 and so on, and then using "quat2eur" to convert them into eulerian angles, but it didn't work
  • "resetting" roll, pitch and yaw when the subject is in standing position (first picture), and then calculate the difference between sensors of roll, pitch and yaw.
Both methods don't seem to have a reasonable graph as a result, does anyone have any ideas? I feel like I'm close to the solution but I'm missing something, perhaps because I don't have a lot of experience with the subject.
Thank you so much in advance for your time!
Vittorio
  2 comentarios
James Tursa
James Tursa el 28 de Mayo de 2018
You need to tell us precisely what the sensors are measuring. I.e., from what frame to what other frame?
Mo
Mo el 3 de Jun. de 2018
Editada: James Tursa el 4 de Jun. de 2018
I used 2 sensors (thigh and shank) and have a matrix (100*4) of the quaternion for each sensor. I have seen this method (see below) to calculate the relative angle between two quaternions but cannot use it for my matrix.
An=A/norm(A);
Bn=B/norm(B);
QuatDiff=quatmultiply(quatconj(An),Bn);
ang=2*atan2(norm(QuatDiff(2:4)),QuatDiff(1));
_________________________________________
A= sensor A quaternion and B=sensor B quaternion

Iniciar sesión para comentar.

Respuestas (1)

Mo
Mo el 3 de Jun. de 2018
I used 2 sensors (thigh and shank) and have a matrix (100*4) of the quaternion for each sensor. I have seen this method (see below) to calculate the relative angle between two quaternions but cannot use it for my matrix.
An=A/norm(A); Bn=B/norm(B); QuatDiff=quatmultiply(quatconj(An),Bn); ang=2*atan2(norm(QuatDiff(2:4)),QuatDiff(1)); _________________________________________ A= sensor A quaternion and B=sensor B quaternion

Categorías

Más información sobre Coordinate Transformations en Help Center y File Exchange.

Productos


Versión

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by