This tutorial shows how to use ZeroMQ with ROS for publishing and subscribing to messages. The following two languages are supported:
- CPP
- Python (see thanks section)
- ZeroMQ: Install ZeroMQ using following command:
It should be easy to install newer versions of ZeroMQ, and this repository should be compatible with them. However, please note that this repository is only for demonstration purposes. Therefore, we have not tested it thoroughly. In such cases, please feel free to open a new issue to inform the changes to authors.
sudo apt-get install libzmq3-dev
- Make sure to download complete repository. Use
git clone
or download zip as per convenience. - Invoke catkin tool inside ros workspace i.e.,
catkin_make
- Start ROS Core by using the following command:
roscore
- Invoke the publisher by using the following command:
Alternatively, the python version of talker can be started by using the following command:
rosrun ros_zeromq_tutorial talker_zmq
rosrun ros_zeromq_tutorial talker_zmq.py
- The published data can be seen by using the following command:
Alternatively, the python version of listener can be started by using the following command:
rosrun ros_zeromq_tutorial listener_zmq
rosrun ros_zeromq_tutorial listener_zmq.py
Please check here and create issues accordingly.
The following authors are sincerely acknowledged for the improvements of this package:
- Md Rakin Sarder: For providing python nodes