Karlsruhe Institute of Technology (KIT) Logo

Master Motor Map

Whole-body human reference model and tools for unifying representations of whole-body human motion

General Plug-In-Architecture

The MMM framework consists of various different Plug-Ins to represent, visualize, convert, segment and further handle motions.

Plug-Ins

Plug-Ins are libraries which are dynamically loaded at runtime to extend a program's functionality. Using predefined interfaces, these Plug-Ins are completely irrespective of the program. Therefore adding new functionality via Plug-Ins does not need a change in the program's code and they can be compiled outside of the program's library.

Create a plugin type

Deriving from MMM::AbstractFactoryMethod you can create your own type of plugins. The derived class should be a factory which creates your specific object derived also from a general interface.

class IExampleFactory : public MMM::AbstractFactoryMethod<IExampleFactory, void*>
{
public:
IExampleFactory() { }
virtual ~IExampleFactory() { }
virtual IExample createConcreteExampleObject(...) = 0;
// Returns the specific type name of the example plugin
virtual std::string getName() = 0;
};
typedef boost::shared_ptr<IExampleFactory> IExampleFactoryPtr;

See classes MMM::SensorFactory and MMM::Sensor in MMMCore for an implementation of plugin type creation and MMM Sensor Plug-In-Architecture for an example sensor plugin creation.

Loading Plug-Ins

The MMM::FactoryPluginLoader is used to load different plug-in types without effort. In the mmm library the MMM::MotionReaderXML for reading MMM Data Format and the MMMViewer to visualize sensor data are using the MMM::FactoryPluginLoader to load their plugins from independet libraries.
Here is an example how to use it in general:

std::vector<std::string> pluginPaths = ... // paths to plugin folders
boost::shared_ptr<MMM::FactoryPluginLoader<SomeFactory> > factoryPluginLoader(new MMM::FactoryPluginLoader<SomeFactory>(pluginPaths)); // SomeFactory is the corresponding factory interface of the to load plugins, e.g. MMM::SensorFactory
boost::shared_ptr<SomeFactory> = factoryPluginLoader->loadFactory(PLUGIN_TYPE_NAME); // unique PLUGIN_TYPE_NAME to decide which subclass factory should be loaded, e.g. "Example" for ExampleSensorFactory
if (factory) Some object = factory->someMethod(); // corresponding method of the factory to create the object, e.g. createSensor(...) in MMM::SensorFactory
KoroiBot Logo WALK-MAN Logo Xperience Logo SecondHands Logo TimeStorm Logo I-SUPPORT Logo
PACO-PLUS Logo SFB-588 Logo SPP1527 Logo