rt_usb_9axisimu_driver icon indicating copy to clipboard operation
rt_usb_9axisimu_driver copied to clipboard

Read the latest data regardless of the operation frequency

Open ShotaAk opened this issue 2 years ago • 0 comments

What does this implement/fix?

#49 に関連します。

現在の実装では、IMUの最新データを受け取れるかどうかがtimerの動作周期に依存しています。 例えば、timerの周期を遅くすると最新データがほとんど取れなくなります。(遅れたデータを受信します)

https://github.com/rt-net/rt_usb_9axisimu_driver/blob/94f1714f5c4d7accc133ef28a88de07eaa864053/src/rt_usb_9axisimu_driver_component.cpp#L116

このPRでは、readを繰り返し実行し、常に最新データが取れるようにします。

Does this close any currently open issues?

#49

How has this been tested?

Binary、ASCIIモードで下記を確認しました。

  • timerの周期を100ms、5ms、10msに変更しても常に最新データが出力されること
  • on_configure時、USBが刺さっていないときにエラーを返すこと
  • on_activate時、USBが刺さっていないときにエラーを返すこと
  • activate中、USBを取り外すとエラーを返すこと

Any other comments?

Checklists

  • [x] I have read the CONTRIBUTING guidelines.
  • [x] I have checked to ensure there aren't other open Pull Requests for the same change.

ShotaAk avatar Dec 13 '23 10:12 ShotaAk