mc_rbdyn::RobotLoader Class Reference

Load RobotModule instances from shared libraries. More...

#include <mc_rbdyn/RobotLoader.h>

Static Public Member Functions

template<typename... Args>
static mc_rbdyn::RobotModulePtr get_robot_module (const std::string &name, const Args &... args)
 
static RobotModulePtr get_robot_module (const std::vector< std::string > &args)
 
template<typename RetT , typename... Args>
static void register_object (const std::string &name, std::function< RetT *(const Args &...)> callback)
 
static void update_robot_module_path (const std::vector< std::string > &paths)
 
static void clear ()
 
static bool has_robot (const std::string &name)
 
static void set_verbosity (bool verbose)
 
static std::vector< std::string > available_robots ()
 
static void load_aliases (const std::string &fname)
 

Detailed Description

Load RobotModule instances from shared libraries.

Member Function Documentation

◆ available_robots()

static std::vector<std::string> mc_rbdyn::RobotLoader::available_robots ( )
static

Returns a list of available robots

◆ clear()

static void mc_rbdyn::RobotLoader::clear ( )
inlinestatic

Remove all loaded libraries

◆ get_robot_module() [1/2]

template<typename... Args>
static mc_rbdyn::RobotModulePtr mc_rbdyn::RobotLoader::get_robot_module ( const std::string &  name,
const Args &...  args 
)
inlinestatic

Return a RobotModule constructed with the provided Args

Parameters
nameThe module name
argsThe arguments provided to the module creation function
Note
It is the responsability of the caller to make sure that the signature of the module creation fits that declared by the module

◆ get_robot_module() [2/2]

static RobotModulePtr mc_rbdyn::RobotLoader::get_robot_module ( const std::vector< std::string > &  args)
static

Returns the RobotModule that would be loaded from get_robot_module(args[0], ..., args[args.size() - 1])

This is arbitrarly limited to 3 arguments

◆ has_robot()

static bool mc_rbdyn::RobotLoader::has_robot ( const std::string &  name)
inlinestatic

Check if a robot is available

Parameters
nameRobot name

◆ load_aliases()

static void mc_rbdyn::RobotLoader::load_aliases ( const std::string &  fname)
static

Load aliases

An aliases file should be a map of alias to param vector

Parameters
fnameA JSON or YAML containing aliases

◆ register_object()

template<typename RetT , typename... Args>
static void mc_rbdyn::RobotLoader::register_object ( const std::string &  name,
std::function< RetT *(const Args &...)>  callback 
)
inlinestatic

◆ set_verbosity()

static void mc_rbdyn::RobotLoader::set_verbosity ( bool  verbose)
inlinestatic

◆ update_robot_module_path()

static void mc_rbdyn::RobotLoader::update_robot_module_path ( const std::vector< std::string > &  paths)
static

Add additional directories to the robot module path

Parameters
pathsDirectories to be added to the module path

The documentation for this class was generated from the following file: