Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The single member of std_msgs::String is a std::string named data. The normal conversions between char * and std::string apply (among others, the assignment operator works):

std_msgs::String message;
char buffer[20] = "Hello World";
message.data = buffer;