Skip to content

Software

class_loader

By ROS core stacks, from github.com/ros/class_loader (opens in a new tab)

  • Middleware
  • Library
  • BSD-3-Clause

A ROS-independent C++ library for loading plugins at runtime from shared libraries, without needing the classes' header files. It underpins the ROS pluginlib package.

Facts

GitHub stars
46read on 27 Nov 2026
Last update
24 Nov 2026Newest commit on rolling
Maintenance
Activea commit in the last 90 days
Difficulty
Advanced

Checked on GitHub on 28 Nov 2026.

Licenses

Code
BSD-3-Clause (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (BSD-3-Clause) at commit 9157bdc (opens in a new tab), on 28 Nov 2026.

Commercial use
Yes

At a glance

What it is
  • Uses the host operating system's runtime loader to open shared libraries such as .so, .dll or dylib files.
  • Introspects a library for exported plugin classes and lists those that implement a given base class.
  • Creates and destroys instances of exported classes without declaring them in a header file.
  • Offers ClassLoader for a single runtime library and MultiLibraryClassLoader for several libraries.
  • Intended for plugins used by non-ROS packages; ROS packages should use pluginlib instead.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
BSD-3-Clause. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's README (opens in a new tab)
Maintenance
Active, last commit on 24 Nov 2026.

Use it

How to install it, in the creator's words: The project's README (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit 9157bdc

Robotheca read the repository at two versions: the summary at 7ca3a02 and the facts and the README at 9157bdc (read on 28 Nov 2026).

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by ROS core stacks, at commit 9157bdc, under BSD-3-Clause (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

class_loader

The class_loader package is a ROS-independent package for loading plugins during runtime and the foundation of the higher level ROS pluginlib library. class_loader utilizes the host operating system's runtime loader to open runtime libraries (e.g. .so/.dll/dylib files), introspect the library for exported plugin classes, and allows users to instantiate objects of said exported classes without the explicit declaration (i.e. header file) for those classes.

class_loader VS pluginlib

class_loader is used in the implementation of the higher-level ROS package pluginlib which is the encouraged method for loading plugins in the ROS ecosystem. You should use class_loader when creating plugins intended for non-ROS packages and pluginlib when exporting plugins to ROS packages.

Quality Declaration

This package claims to be in the Quality Level 1 category, see the Quality Declaration (opens in a new tab) for more details.

Usage

The interface is provided through two classes, class_loader::ClassLoader and class_loader::MultiLibraryClassLoader. Both provide similar interfaces but the former only binds to a single runtime library whereas the latter can associate with multiple libraries. The typical workflow is as follows:

  • Include class_loader/class_loader.hpp in your source code
  • Instantiate a class_loader::ClassLoader object passing the path and name of the library to open
class_loader::ClassLoader loader("libMyLibrary.so");
  • Query the class for exported classes which have an interface defined by some base class (MyBase in the example)
   std::vector<std::string> classes = loader.getAvailableClasses<MyBase>()
  • Create/destroy objects of said exported classes
 for(unsigned int c = 0; c < classes.size(); ++c)
 {
   std::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
   plugin->someMethod();
   //'plugin' will automatically be deleted when it goes out of scope
 }
  • Destroy the ClassLoader object to shutdown the library.

Example: Basic Workflow for ClassLoader

#include <class_loader/class_loader.hpp>
#include "MyBase.h" //Defines class MyBase

int main()
{
  class_loader::ClassLoader loader("libMyLibrary.so");
  std::vector<std::string> classes = loader.getAvailableClasses<MyBase>();
  for(unsigned int c = 0; c < classes.size(); ++c)
  {
    std::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
    plugin->someMethod();
  }
}

Visit the class_loader (opens in a new tab) API documentation for a complete list of its main components.

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.