Now, we are going to upload an example program from the IDE to Arduino. Select the Hello World sample and upload the sketch:
The code in the preceding screenshot is very similar to the following code. In the following code, you can see an include line with the ros.h library. This library is the rosserial library, which we have installed before. Also, you can see a library with the message to send with a topic; in this case, it is the std_msgs/String type.
The following code snippet is present in the c8_arduino_string.ino file:
#include <ros.h> #include <std_msgs/String.h> ...