Skip to content

Using existing storage_default_plugins as base_class_type for other plugins #84

@ruffsl

Description

@ruffsl

I'd like to add more plugins to the set of rosbag2_storage_default_plugins; and to improve code reuse, I'd like to do this by inheriting from existing plugins.

However, after creating a child class, I can't seem to configure pluginlib to utilize my appended plugin_description.xml, thus the get_interface_instance call fails to find the new plugin when I attempt to set the parent plugin's type as the child plugin's base_class_type instead of the parent's own base_class_type. Doing the latter of course prevents me from leaving the public function unimplemented when attempting to inherit.

$ ros2 bag play -s checkpoint bag_file_path
DISCLAIMER
ros2 bag is currently under development and not ready to use yet
[ERROR] [rosbag2_storage]: Could not load/open plugin with storage id 'checkpoint'.
[ERROR] [rosbag2_transport]: Failed to play: No storage could be initialized. Abort

Here is my current plugin_description.xml

<library path="rosbag2_storage_default_plugins">
  <class
    name="sqlite3"
    type="rosbag2_storage_plugins::SqliteStorage"
    base_class_type="rosbag2_storage::storage_interfaces::ReadWriteInterface"
  >
    <description>Plugin to write to SQLite3 databases</description>
  </class>
  <class
    name="checkpoint"
    type="rosbag2_storage_plugins::CheckpointStorage"
    base_class_type="rosbag2_storage_plugins::SqliteStorage"
  >
    <description>Plugin to write to Checkpoint databases</description>
  </class>
</library>

This commit/branch shows a minimal example of what was attempted above: 849c722

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions