Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.
This repository was archived by the owner on May 31, 2025. It is now read-only.

Declaring a rosbag::Bag member in a nodelet class leads to failure to launch the nodelet #1474

@kartikmohta

Description

@kartikmohta

Having a class member of type rosbag::Bag in a nodelet leads to failure to launch the nodelet in ROS melodic.
Here is a minimum example:

#include <nodelet/nodelet.h>
#include <rosbag/bag.h>

class MyNodelet : public nodelet::Nodelet
{
 public:
  void onInit() {}

 private:
  rosbag::Bag bag_;
};

#include <pluginlib/class_list_macros.h>
PLUGINLIB_EXPORT_CLASS(MyNodelet, nodelet::Nodelet);

(Here is the full package: my_package.tar.gz)

Compiling and running

rosrun nodelet nodelet standalone my_package/MyNodelet

leads to the following error:

[ERROR] [1533595561.186295932]: Failed to load nodelet [/my_package_MyNodelet] of type [my_package/MyNodelet] even after refreshing the cache: MultiLibraryClassLoader: Could not create object of class type rosbag::NoEncryptor as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary()
[ERROR] [1533595561.187418380]: The error before refreshing the cache was: MultiLibraryClassLoader: Could not create object of class type rosbag::NoEncryptor as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary()

This used to work fine in lunar. It seems to be related to some recent changes to add encryption support in rosbag (#1206).

Changing the member to be a pointer which is initialized in the onInit function works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions