Skip to content

Commit

Permalink
Update BNO055.md
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyNelson314 authored Feb 14, 2025
1 parent cba3862 commit debec3a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/Driver/BNO055.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void loop()
ヨー角以外の角度を取得する場合は、クオータニオンを取得後、各角度へ変換します。
Unity などに姿勢を送る際は、クオータニオンを送信します。(オイラー角はシンバルロックが起きる可能性があります)
Unity などに姿勢を送る際は、クオータニオンを送信します。(一般的な3Dゲームエンジンは計算量などの観点からクオータニオンを用いて姿勢を管理しています)
```cpp
const Udon::Quaternion quaternion = gyro.getQuaternion();
Expand All @@ -46,8 +46,9 @@ const double pitch = quaternion.toPitch();
const double roll = quaternion.toRoll();
```

オイラー角から取得することもできますが、ヨー角のみを取得する場合、クオータニオンからヨー角を求める方がパフォーマンス的に良いです。(内部的にクオータニオンを用いており、オイラー角に変換する段階で不要なピッチ、ロール角まで求めてしまうため)
オイラー角から取得することもできますが、単一の角 (ピッチ角など) のみを使用する場合、クオータニオンから求める方がパフォーマンス的に良いです。(内部的にクオータニオンを用いており、オイラー角に変換する段階で不要な他の角を求めてしまうため)

```cpp
const double yaw = gyro.getEuler().yaw;
// 非推奨
const double pitch = gyro.getEuler().pitch;
```

0 comments on commit debec3a

Please sign in to comment.