I have a simple subscriber to a topic in C++, and am receiving a custom PositionMsg, which includes other custom messages (Velocity, datum, etc). ROS2 handles all that very well, I'm getting the information.
Now I have been told to serialize the message as a string and store it in a database, where it will need to be deserialized later. Is there something in ROS2 that can write it out as a string. I can use Serialization and get back a SerializedMessage, but how do I save that as a std::string? It does not need to be easily human readable as a string, but if it is easier to do in yaml or json, that is fine too.