I’d like to announce rosbags, a pure python library giving read-write access to rosbag1 and rosbag2 files including their conversion.
Rosbags does not have any dependencies on the ROS software stacks and can be used on its own or alongside ROS1 or ROS2. It is available from PyPI for easy installation.
It currently contains:
rosbag2 reader and writer,
rosbag1 reader for raw messages,
extensible type system with serializers and deserializers,
@smac The converter from rosbag1 to rosbag2 works out-of-the-box with custom message types as it does not deserialize but converts one serialization into the other. In order to deserialize custom rosbag2 messages they need to be registered first. This happens during runtime without extra build step. For more information see: Type system — Rosbags documentation
@chaoflow hi,I try to deserialize a custom message after register the type with get_types_from_msg() ,register_types() API like the tutorial; but when use deserialize_cdr(),there comes error like
'line 32, in deserialize_cdr
message, pos = func(rawdata[4:], 0, msgdef.cls)
File “”, line 21, in deserialize_cdr
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xbf in position 7: invalid start byte
’
the custom msg is simple only include two types:
Please excuse my ignorance, but how do I install the referenced CLI tool, rosbags.convert? I cannot find any instructions in your documentation for how to install. Convert Rosbag1 to Rosbag2 — Rosbags documentation