how can i convert a char* into std_msgs::String [closed]
Hello, std_msgs::String data1; char buffer[20];
I just want to do data1.something = buffer
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Hello, std_msgs::String data1; char buffer[20];
I just want to do data1.something = buffer
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;
Asked: 2019-09-22 20:58:28 -0500
Seen: 1,724 times
Last updated: Sep 22 '19
How to make ROS Indigo work with Gazebo 4? [closed]
ROS Cmake Error in lsb.cmake:8 (string): string no output variable specified
Turtlebot not moving by getting velocity commands from MATLAB
Unable to display image with cvbridge
When is ${catkin_EXPORTED_TARGETS} needed
Reference sketch does not exist. Solidworks to URDF Exporter error
Not related to ROS in any way. https://www.geeksforgeeks.org/how-to-...