フィルターのクリア

Quaternion rotation around only two axes.

18 ビュー (過去 30 日間)
Adam Levschuk
Adam Levschuk 2020 年 12 月 11 日
コメント済み: Amrtanshu Raj 2020 年 12 月 23 日
Hello all,
I am working on a problem where i am using quaternions to put meaured accelerations into the global reference frame (North-East-Down). When I rotate the acceleraion vectors by the conjugate of the quaternions it does this perfectly. However, what if i wanted to keep the Heading (the yaw, or the k component on the quaterion) the same and not rotate my accelerations about this axis as to not change the heading? How would i go about doing this? is this possible?
thank you for your input
  4 件のコメント
James Tursa
James Tursa 2020 年 12 月 11 日
Can you post the exact code you are using currently to rotate your acceleration vector?
Adam Levschuk
Adam Levschuk 2020 年 12 月 11 日
Aboslutly, here we go.
acc = quatrotate(quatconj(quat), acc);
quat is a 4 x m array where the first columns go [0 i j k] and describes the orinetation of the sensor relative to NED reference frame.
thank you

サインインしてコメントする。

回答 (1 件)

Amrtanshu Raj
Amrtanshu Raj 2020 年 12 月 23 日
Hi,
You can convert the quaternion to euler angles and then set the yaw(z axis) to zero and then convert it back to quaternion and do the required rotations.
quat = quaternion(0,.1,.2,.3) %Sample data
ang = quat2eul(quat) %get euler angles
ang_new = ang
ang_new(1) = 0 %set yaw to zero
quat_new = quaternion(eul2quat(ang_new)) %convert it back to quaternion
Hope this helps !!
  2 件のコメント
Adam Levschuk
Adam Levschuk 2020 年 12 月 23 日
Hello Amrtanshu, thanks for the reply, i was using this method in the meantime.
I was hoping to find a way to do this completely with quaternions. Do you know how to do this soley using quaternions and not converting to euler Angles as an intermediate step?
Looking forward to hearing from you!
Amrtanshu Raj
Amrtanshu Raj 2020 年 12 月 23 日
Directly getting the desired quaternion after eliminating rotation along a specific axis is not possible in Matlab. However, you can derive a set of equations using basic quaternion and vector calculations to get rotation quaternion after eliminating rotation along a specific axis.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCoordinate Transformations についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by