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