|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.|
Combining C++/Python Publisher/SubscriberDescription: This tutorial shows how to mix publishers and subscribers written in C++ and Python.
Keywords: parameter server, dynamic reconfigure, publisher, subscriber
Tutorial Level: INTERMEDIATE
Combining C++ and Python Publishers/Subscribers with Dynamic Reconfigure and Parameter Server
Starting the Nodes
roslaunch node_example node_example.launch
will start all of the nodes -- talker, listener, pytalker.py and pylistener.py -- as well as a dynamic reconfigure GUI and rxconsole. In the launch file, make sure that all of the nodes are using the same topic. The output of the nodes can be seen in rxconsole and the thing to notice when running this launch file is that both listeners are subscribed to both talkers. This works because they all the nodes are using the same custom message.
Note that the following combination of nodes will work:
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
Use the dynamic reconfigure GUI to select different publishers and change the messages or numbers and see the results in rxconsole. Then, modify the nodes to suit your own needs.