バイナリフォーマットでデータ送信します#5
Conversation
|
@mmaakkyyii |
|
手元のvscodeで開いたとき勝手に成形されてそうでした。何か直した方がいいでしょうか? |
|
arduinoのデフォルトでフォーマットしてもらえますか? https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-customize-auto-formatter/ |
|
auto formatかけました |
|
@mmaakkyyii |
| const unsigned char accScale[4] = { 0x04, 0x00, 0x00, 0x00 }; | ||
| result = writeDMPmems(ACC_SCALE, 4, &accScale[0]); | ||
| if (result > worstResult) | ||
| worstResult = result; // Write accScale to ACC_SCALE DMP register | ||
| // In order to output hardware unit data as configured FSR write 0x00040000 when FSR is 4g | ||
| const unsigned char accScale2[4] = {0x00, 0x04, 0x00, 0x00}; | ||
| result = writeDMPmems(ACC_SCALE2, 4, &accScale2[0]); if (result > worstResult) worstResult = result; // Write accScale2 to ACC_SCALE2 DMP register | ||
| const unsigned char accScale2[4] = { 0x00, 0x04, 0x00, 0x00 }; |
There was a problem hiding this comment.
myFSS.a = gpm16;に変更してたのでこちらの加速度スケールのパラメータも変更が必要そうです
|
ファームウェア修正前後でIMUを縦に傾けた状態から水平にする動きをして姿勢をみましたが 修正前 |
|
今確認中なんですが、加速度のレンジおかしくなってますね |
|
加速度の値が大きい問題は手元でも確認できました 変更箇所 |
|
4g IMG_4091.mov |
|
内部変数を整数型で扱うためにスケールしてそれを元に戻すためにACC_Scale2は逆数をとる必要あるみたいでした。 |
| if ((myICM.status == ICM_20948_Stat_Ok) || (myICM.status == ICM_20948_Stat_FIFOMoreDataAvail)) // Was valid data available? | ||
| { | ||
| if ((data.header & DMP_header_bitmap_Quat6) > 0)// && (data.header & DMP_header_bitmap_Gyro) > 0) | ||
| if ((data.header & DMP_header_bitmap_Quat6) > 0) // && (data.header & DMP_header_bitmap_Gyro) > 0) |
There was a problem hiding this comment.
静止状態で一定時間データをみてましたが定期的にノイズが入ってました。
おそらく、フレームにGyroやAccelがない状態で送ってしまうのが原因でGyroとAccelをフィルターするとノイズが消えました
| if ((data.header & DMP_header_bitmap_Quat6) > 0) // && (data.header & DMP_header_bitmap_Gyro) > 0) | |
| if ( | |
| ((data.header & DMP_header_bitmap_Quat6) > 0) && | |
| ((data.header & DMP_header_bitmap_Gyro) > 0) && | |
| ((data.header & DMP_header_bitmap_Accel) > 0)) |
What does this implement/fix?
Does this close any currently open issues?
#4
How has this been tested?
実機動作確認済みです
Any other comments?
Checklists