26#ifndef TESSERACT_KINEMATICS_KINEMATICS_PLUGIN_FACTORY_H
27#define TESSERACT_KINEMATICS_KINEMATICS_PLUGIN_FACTORY_H
34#include <yaml-cpp/yaml.h>
45#define TESSERACT_ADD_FWD_KIN_PLUGIN(DERIVED_CLASS, ALIAS) \
46 TESSERACT_ADD_PLUGIN_SECTIONED(DERIVED_CLASS, ALIAS, FwdKin)
48#define TESSERACT_ADD_INV_KIN_PLUGIN(DERIVED_CLASS, ALIAS) \
49 TESSERACT_ADD_PLUGIN_SECTIONED(DERIVED_CLASS, ALIAS, InvKin)
55class KinematicsPluginFactory;
61 using Ptr = std::shared_ptr<InvKinFactory>;
62 using ConstPtr = std::shared_ptr<const InvKinFactory>;
78 const YAML::Node&
config)
const = 0;
89 using Ptr = std::shared_ptr<FwdKinFactory>;
90 using ConstPtr = std::shared_ptr<const FwdKinFactory>;
106 const YAML::Node&
config)
const = 0;
172 const std::string& solver_name,
179 std::map<std::string, tesseract_common::PluginInfoContainer>
getFwdKinPlugins()
const;
186 void removeFwdKinPlugin(
const std::string& group_name,
const std::string& solver_name);
210 const std::string& solver_name,
217 std::map<std::string, tesseract_common::PluginInfoContainer>
getInvKinPlugins()
const;
224 void removeInvKinPlugin(
const std::string& group_name,
const std::string& solver_name);
250 const std::string& solver_name,
263 const std::string& solver_name,
This is a utility class for loading plugins within Tesseract.
Definition: plugin_loader.h:57
std::unique_ptr< ForwardKinematics > UPtr
Definition: forward_kinematics.h:55
Define a forward kinematics plugin which the factory can create an instance.
Definition: kinematics_plugin_factory.h:87
std::shared_ptr< FwdKinFactory > Ptr
Definition: kinematics_plugin_factory.h:89
static const std::string SECTION_NAME
Definition: kinematics_plugin_factory.h:109
virtual ForwardKinematics::UPtr create(const std::string &solver_name, const tesseract_scene_graph::SceneGraph &scene_graph, const tesseract_scene_graph::SceneState &scene_state, const KinematicsPluginFactory &plugin_factory, const YAML::Node &config) const =0
Create Inverse Kinematics Object.
friend class PluginLoader
Definition: kinematics_plugin_factory.h:110
virtual ~FwdKinFactory()=default
std::shared_ptr< const FwdKinFactory > ConstPtr
Definition: kinematics_plugin_factory.h:90
Define a inverse kinematics plugin which the factory can create an instance.
Definition: kinematics_plugin_factory.h:59
std::shared_ptr< const InvKinFactory > ConstPtr
Definition: kinematics_plugin_factory.h:62
friend class PluginLoader
Definition: kinematics_plugin_factory.h:82
std::shared_ptr< InvKinFactory > Ptr
Definition: kinematics_plugin_factory.h:61
virtual ~InvKinFactory()=default
virtual InverseKinematics::UPtr create(const std::string &solver_name, const tesseract_scene_graph::SceneGraph &scene_graph, const tesseract_scene_graph::SceneState &scene_state, const KinematicsPluginFactory &plugin_factory, const YAML::Node &config) const =0
Create Inverse Kinematics Object.
static const std::string SECTION_NAME
Definition: kinematics_plugin_factory.h:81
std::unique_ptr< InverseKinematics > UPtr
Definition: inverse_kinematics.h:55
Definition: kinematics_plugin_factory.h:114
void addInvKinPlugin(const std::string &group_name, const std::string &solver_name, tesseract_common::PluginInfo plugin_info)
Add a inverse kinematics plugin to the manager.
Definition: kinematics_plugin_factory.cpp:152
void setDefaultInvKinPlugin(const std::string &group_name, const std::string &solver_name)
Set a groups default inverse kinematics solver.
Definition: kinematics_plugin_factory.cpp:184
std::map< std::string, InvKinFactory::Ptr > inv_kin_factories_
Definition: kinematics_plugin_factory.h:303
KinematicsPluginFactory & operator=(KinematicsPluginFactory &&)=default
std::map< std::string, tesseract_common::PluginInfoContainer > getFwdKinPlugins() const
Get the map of forward kinematic plugins.
Definition: kinematics_plugin_factory.cpp:99
std::map< std::string, tesseract_common::PluginInfoContainer > inv_plugin_info_
Definition: kinematics_plugin_factory.h:305
std::map< std::string, tesseract_common::PluginInfoContainer > fwd_plugin_info_
Definition: kinematics_plugin_factory.h:304
std::set< std::string > getSearchLibraries() const
Get the plugin search libraries.
Definition: kinematics_plugin_factory.cpp:90
std::set< std::string > getSearchPaths() const
Get the plugin search paths.
Definition: kinematics_plugin_factory.cpp:83
YAML::Node getConfig() const
Get the plugin information config as a yaml node.
Definition: kinematics_plugin_factory.cpp:333
InverseKinematics::UPtr createInvKin(const std::string &group_name, const std::string &solver_name, const tesseract_scene_graph::SceneGraph &scene_graph, const tesseract_scene_graph::SceneState &scene_state) const
Get inverse kinematics object given group name and solver name.
Definition: kinematics_plugin_factory.cpp:270
void addFwdKinPlugin(const std::string &group_name, const std::string &solver_name, tesseract_common::PluginInfo plugin_info)
Add a forward kinematics plugin to the manager.
Definition: kinematics_plugin_factory.cpp:92
std::map< std::string, FwdKinFactory::Ptr > fwd_kin_factories_
Definition: kinematics_plugin_factory.h:302
void setDefaultFwdKinPlugin(const std::string &group_name, const std::string &solver_name)
Set a groups default forward kinematics solver.
Definition: kinematics_plugin_factory.cpp:124
KinematicsPluginFactory & operator=(const KinematicsPluginFactory &)=default
std::map< std::string, tesseract_common::PluginInfoContainer > getInvKinPlugins() const
Get the map of inverse kinematic plugins.
Definition: kinematics_plugin_factory.cpp:159
~KinematicsPluginFactory()
KinematicsPluginFactory(const KinematicsPluginFactory &)=default
KinematicsPluginFactory()
Definition: kinematics_plugin_factory.cpp:45
KinematicsPluginFactory(KinematicsPluginFactory &&)=default
void removeInvKinPlugin(const std::string &group_name, const std::string &solver_name)
remove inverse kinematics plugin from the manager
Definition: kinematics_plugin_factory.cpp:164
ForwardKinematics::UPtr createFwdKin(const std::string &group_name, const std::string &solver_name, const tesseract_scene_graph::SceneGraph &scene_graph, const tesseract_scene_graph::SceneState &scene_state) const
Get forward kinematics object given group name and solver name.
Definition: kinematics_plugin_factory.cpp:213
void removeFwdKinPlugin(const std::string &group_name, const std::string &solver_name)
remove forward kinematics plugin from the manager
Definition: kinematics_plugin_factory.cpp:104
tesseract_common::PluginLoader plugin_loader_
Definition: kinematics_plugin_factory.h:306
void addSearchPath(const std::string &path)
Add location for the plugin loader to search.
Definition: kinematics_plugin_factory.cpp:81
void addSearchLibrary(const std::string &library_name)
Add a library to search for plugin name.
Definition: kinematics_plugin_factory.cpp:85
std::string getDefaultFwdKinPlugin(const std::string &group_name) const
Get the default forward kinematics solver for a group.
Definition: kinematics_plugin_factory.cpp:139
std::string getDefaultInvKinPlugin(const std::string &group_name) const
Get the default forward inverse solver for a group.
Definition: kinematics_plugin_factory.cpp:199
void saveConfig(const tesseract_common::fs::path &file_path) const
Save the plugin information to a yaml config file.
Definition: kinematics_plugin_factory.cpp:326
tesseract_collision::CollisionCheckConfig config(5, request, tesseract_collision::CollisionEvaluatorType::LVS_DISCRETE, 0.5)
Definition: tesseract_common_serialization_unit.cpp:154
Forward kinematics functions.
A basic scene graph using boost.
auto scene_graph
Definition: ikfast_kinematics_7dof_unit.cpp:51
Inverse kinematics functions.
tesseract_scene_graph::SceneState scene_state
Definition: kinematics_factory_unit.cpp:265
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
Definition: forward_kinematics.h:44
Plugin Loader to be used throughout Tesseract for loading plugins.
tesseract_common::fs::path file_path(__FILE__)
This holds a state of the scene.
The Plugin Information struct.
Definition: types.h:104
This holds a state of the scene.
Definition: scene_state.h:54