Calculate difference in Euler angle
3 ビュー (過去 30 日間)
古いコメントを表示
Hello. I have a set of Euler data (yaw, pitch roll). I need to calculate the relative differences in the, for example, the yaw angle from the start position.
I have a problem in calculating this since, say, the yaw angle will go from 0 to 360 degree. If the initial position is at 356 degree, I am not sure how to handle the data when the movement yaws to 1 again. If I use x-initialPosition metric, i will get 1-356, which is not the answer. Any suggestion?
This also applies to pitch that goes from 180 to -180
0 件のコメント
回答 (1 件)
Guillaume
2016 年 9 月 27 日
編集済み: Guillaume
2016 年 9 月 27 日
4 件のコメント
Guillaume
2016 年 9 月 27 日
編集済み: Guillaume
2016 年 9 月 27 日
mod(351-387, 360) is 354 not -354. Note that -6 and 354 are the same angles (modulo 360).
As demonstrated (twice now), you perform you difference as usual. If you want to display it in the range [0,360[ you use
mod(difference, 360)
If you want to display it in the range [-180, 180[ you use
mod(difference + 180, 360) - 180
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!