How do I get the length of a String in C++?
I'm sending binary data as a String. It's easy to publish it and read it in Python, but I'm trying to extend a driver that's written in C++ (and I have very little C++ experience). I made it work by using this ugly kludge in the topic subscriber.
uint32_t string_length = ros::serialization::serializationLength(*msg) - 4;
I was hoping that there would be a length value in the message but according to http://wiki.ros.org/ROS/Tutorials/Wri... String only has one member, "data". Is there a clean way to get the length of the data?