Skip to content

Conversation

YusukeKato
Copy link
Contributor

@YusukeKato YusukeKato commented Sep 3, 2025

What does this implement/fix?

lifecycleのactivate時のセンサからデータが取得できるかのチェックは、元々はreadSensorData()の実行が成功するかどうかチェックしていましたが現在の方法だと正しくIMUセンサが接続されていてもタイミングによって失敗することがあるため、タイムアウト機能を追加して設定した時間内でセンサデータが取得できるかチェックするように変更します。

Does this close any currently open issues?

しません。

How has this been tested?

下記コマンドを実行してIMUノードのlifecycleがactiveへ遷移できることを確認しました。

# ターミナル1
ros2 run rt_usb_9axisimu_driver rt_usb_9axisimu_driver

# ターミナル2
ros2 lifecycle set rt_usb_9axisimu_driver configure
ros2 lifecycle set rt_usb_9axisimu_driver activate

また、ros2 lifecycle set rt_usb_9axisimu_driver configure実行後にPCから9軸IMUセンサの接続を外してros2 lifecycle set rt_usb_9axisimu_driver activateを実行すると、5秒後にタイムアウトしてactivateに失敗することも確認できました。

Any other comments?

本PR作成の背景として、launchファイルからlifecycleを遷移させる際、configure後すぐにactivateを行うとreadSensorData()に失敗する場合があることを確認したため、センサからデータが取得できるかのチェック時にタイムアウト機能を追加することにしました。

Checklists

@YusukeKato YusukeKato self-assigned this Sep 3, 2025
@YusukeKato YusukeKato added the Type: Bug Bug or Bug fixes label Sep 3, 2025
@YusukeKato YusukeKato marked this pull request as ready for review September 3, 2025 02:56
@YusukeKato YusukeKato requested a review from Kuwamai September 3, 2025 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug or Bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant