Finding an angle from quaternions or rotations on planes?
9 次查看(过去 30 天)
显示 更早的评论
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 个评论
James Tursa
2018-5-28
You need to tell us precisely what the sensors are measuring. I.e., from what frame to what other frame?
Mo
2018-6-3
编辑:James Tursa
2018-6-4
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
回答(1 个)
Mo
2018-6-3
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specialized Messages 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!