Finding an angle from quaternions or rotations on planes?
5 ビュー (過去 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).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/190854/image.png)
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 で Coordinate Transformations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!