ros::serialization::OStream
Is there any standard way of converting ros::serialization::OStream to any standard format like std::string or std::stringstream?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Is there any standard way of converting ros::serialization::OStream to any standard format like std::string or std::stringstream?
Hi,
I suggest you to take a look to the way it is done in tool_topics:ShapeShifter
http://docs.ros.org/diamondback/api/t...
I expect the function you want to write to look like this
void copyToString(ros::serialization::OStream& stream, std::string& output)
{
output.resize( stream.getLength() );
memcpy(stream.getData(), &output[0], stream.getLength());
}
Asked: 2017-04-25 03:59:33 -0600
Seen: 530 times
Last updated: Apr 25 '17