ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
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;