Skip to content

Migrate to ROS 2 Dashing #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Sep 1, 2020
Merged

Migrate to ROS 2 Dashing #26

merged 19 commits into from
Sep 1, 2020

Conversation

ShotaAk
Copy link
Contributor

@ShotaAk ShotaAk commented Jul 31, 2020

What does this implement/fix?

ROS2 Dashingへの対応です。
ROS1ノードと違い、ComponentとLifecycle機能を追加しています。

Lifecycleについて

  • Unconfigured: 9軸IMU(USBケーブル)を抜き差しできます
  • Inactive: 9軸IMUを認識します。認識できなければUnconfigureに戻ります
  • Active: 9軸IMUと10ms周期で通信し、とトピックをパブリッシュします
    • この状態でUSBケーブルを抜いても、エラーメッセージを出力するだけで、状態遷移しません
    • この状態からUSBケーブルを抜き、復帰するためには、状態をUnconfigureまで戻さないといけません

Component について

  • rt_usb_9axisimu_driver::Driverというコンポーネントを作成します
  • コンポーネントを実行するノードrt_usb_9axisimu_driver_nodeを用意しています

Launchファイルについて

  • rt_usb_9axisimu_driver_nodeを呼び出すrt_usb_9axisimu_driver.launch.pyを用意しています
    • 外部からノードのLifecycleを操作しなければトピックを出力しません

Lintについて

  • rt-netの他のROS2パッケージではament_lintでフォーマットを整えていますが、このパッケージでは使用していません

How has this been tested?

  • バイナリモードとアスキーモードの9軸IMUで動作を確認しました
  • 各ライフサイクルでの状態でUSBケーブルを抜き差しして挙動を確認しました

Checklists

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

@ShotaAk ShotaAk added the Type: Feature New Feature label Jul 31, 2020
@ShotaAk ShotaAk marked this pull request as ready for review August 18, 2020 07:20
@Tiryoh Tiryoh self-requested a review August 18, 2020 07:35
@Tiryoh Tiryoh self-assigned this Aug 18, 2020
@Tiryoh Tiryoh added the Status: In Progress Work in Progress label Aug 26, 2020
@ShotaAk
Copy link
Contributor Author

ShotaAk commented Aug 31, 2020

シリアルのread()でブロッキングすると、ノードが常に通信するため、ros2 のserviceに応答しなくなることが分かりました。
PCだと問題ないですが、ラズパイのようなスペックの低いデバイスだと発生します。

確認方法

# ノードを立ち上げた後、別ターミナルで↓
$ ros2 lifecycle set rt_usb_9axisimu_driver configure
$ ros2 lifecycle set rt_usb_9axisimu_driver activate

# ノードのライフサイクル状態を取得するサービスをコールする
$ ros2 lifecycle get
/rt_usb_9axisimu_driver: active [3]
$ ros2 lifecycle get
# 応答なし・・・

21d887c で、ポートOpen時にO_NONBLOCKオプション追加して対策しました。

@Tiryoh Tiryoh removed the Status: In Progress Work in Progress label Sep 1, 2020
Copy link
Contributor

@Tiryoh Tiryoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

実機にてROSのトピックが配信されていることを確認しました。またframe_id, port等パラメータもlaunchファイルを編集して反映できることを確認しました。

@Tiryoh Tiryoh changed the title Migrate to ros2 dashing Migrate to ROS 2 Dashing Sep 1, 2020
@Tiryoh Tiryoh merged commit 0ab62c6 into dashing-devel Sep 1, 2020
@Tiryoh Tiryoh deleted the migrate_to_ros2_dashing branch September 1, 2020 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy