Note: This tutorial assumes that you have completed the previous tutorials: C++ Node Tutorial, Python Node Tutorial.
(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

C++/Python と Publisher/Subscriberを組み合わせる。

Description: 子のチュートリアルでは、C++とPythonで書かれたパブリッシャとサブスクライバを混ぜ合わせるかを紹介します。

Keywords: parameter server, dynamic reconfigure, publisher, subscriber

Tutorial Level: INTERMEDIATE

C++とPythonのパブリッシュ/サブスクライバを動的再設定とパラメータサーバを用いて組み合わせる。

前回、C++Pythonのパブリッシャとサブスクライバを作りました。同時に4つのnodeを全て実行することができます。

nodeを実行する

The command

roslaunch node_example node_example.launch

上記を打ち込むと、全てのnodeが実行されます。(dynamic reconfigure GUIrxconsoleと一緒に,talker, listener, pytalker.py , pylistener.py). launchファイルにには、すべてのnodeが同じtopicを使っていることを確認してください。nodeの出力は、rxconsoleの中で確認でき、launchファイルを実行しているときに気づくことは、両方のlistenerが両方のtalkerにサブスクライブされていることです。同じカスタムメッセージをnodeが使用しているためこのようになります。

可能な組み合わせ

以下のnodeの組み合わせで動きます.:

  • C++ publisher -> C++ listener

  • C++ publisher -> Python listener

  • C++ publisher -> C++ AND Python listeners

  • Python publisher -> C++ listener

  • Python publisher -> Python listener

  • Python publisher -> C++ AND Python listeners

遊んでみる

dynamic reconfigure GUIを使って、異なるパブリッシャを選択してメッセージや数を変えて、結果をrxconsoleで確認してみましょう。そしたら、nodeに自分の望むように編集してみましょう。

Then, modify the nodes to suit your own needs.

Wiki: ja/ROSNodeTutorialC++Python (last edited 2013-03-10 22:25:33 by Yuto Inagaki)