Message generation
Like all ROS Client Libraries, rosserial takes msg files and generates Arduino C/C++ source code for them. The pattern for this is:
package_name/msg/Foo.msg → package_name::Foo
Similarly, srv files also have C/C++ source code generated. The pattern for this is:
package_name/srv/Bar.srv → package_name::Bar
The source for the generated files are in the package_name directory of ros_lib library folder.
Thus, including the std_msgs/String message in your code involves:
and instantiating the message:
1 std_msgs::String str;
Note that all fields in a message are currently initialized to a default value of 0 (or null pointers for strings and variable-length arrays).
Message Header Generation
When you run make in the rosserial_arduino package, header files are automatically created for many common messages. Please see this tutorial you have additional messages for which you need to create header files.






