Wie man rosbag2_py No RMW implementation found supporting serialization format behebt
Problem
Sie haben Code wie
rosbag_write_example.py
import rosbag2_py
# [...]
storage_options = rosbag2_py.StorageOptions(uri=bag_directory, storage_id="sqlite3")
converter_options = rosbag2_py.ConverterOptions(output_serialization_format="cdr")
writer = rosbag2_py.SequentialWriter()
writer.open(storage_options, converter_options)aber wenn Sie ihn ausführen, sehen Sie ein Fehlerprotokoll wie
rosbag_error_output.txt
[INFO] [1736530048.500477128] [rosbag2_cpp]: No plugin found providing serialization format ''. Falling back to checking RMW implementations.
[ERROR] [1736530048.500722869] [rosbag2_cpp]: Could not initialize RMWImplementedConverter: No RMW implementation found supporting serialization format
[INFO] [1736530048.500779197] [rosbag2_cpp]: No plugin found providing serialization format 'cdr'. Falling back to checking RMW implementations.
Traceback (most recent call last):
File "/dev/shm/test.py", line 52, in <module>
write_ros2_bag()
File "/dev/shm/test.py", line 35, in write_ros2_bag
writer.open(storage_options, converter_options)
RuntimeError: Could not find converter for formatLösung
Obwohl Sie nur schreiben (und keinen ROSBag lesen), müssen Sie auch ein input_serialization_format-Serialisierungsformat für den Konverter angeben:
rosbag_converter_options.py
converter_options = rosbag2_py.ConverterOptions(
input_serialization_format="cdr",
output_serialization_format="cdr"
)
# [...]Vollständiger korrigierter Code
rosbag_write_fixed.py
import rosbag2_py
# [...]
storage_options = rosbag2_py.StorageOptions(uri=bag_directory, storage_id="sqlite3")
converter_options = rosbag2_py.ConverterOptions(
input_serialization_format="cdr",
output_serialization_format="cdr"
)
writer = rosbag2_py.SequentialWriter()
writer.open(storage_options, converter_options)If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow