Today, I continue the series of tutorials with a template for a ROS subscriber using rosserial on the Arduino board. In addition, I’ll write a subscriber node based on the below template.

Below you will find the template for a ROS subscriber using rosserial on the Arduino board. To write your own subscriber using rosserial on Arduino, copy the template into Arduino IDE, delete the information that you don’t need and replace the text in capital letters.

How to run the node
Step 1: Open a new Terminal, type roscore and press the Enter key;
Step 2: Open a new Terminal and run the node to publish the messages;
Step 3: Open another Terminal and start the subscriber node by typing the following command:

rosrun rosserial_python serial_node.py /dev/ttyACM0

Thanks for reading. And before you go…
If you found this article helpful, share the article on Facebook and Twitter so other people can benefit from it too.