XBotInterface
2.4.1
XBotInterface provides a generic API to model and control a robot.
|
Go to the documentation of this file.
20 #ifndef __XBOT_CONFIG_OPTIONS_H__
21 #define __XBOT_CONFIG_OPTIONS_H__
28 #include <boost/any.hpp>
29 #include <yaml-cpp/yaml.h>
64 template <
typename ParameterType>
65 bool get_parameter(std::string key, ParameterType& value)
const;
67 template <
typename ParameterType>
68 bool set_parameter(std::string key,
const ParameterType& value);
94 std::map<std::string, boost::any> _any_values;
102 template <
typename ParameterType>
105 if(_any_values.count(key) == 0)
112 value = boost::any_cast<ParameterType>(_any_values.at(key));
114 catch(std::exception& e)
116 Logger::error(
"Unable to convert parameter %s to the desired type: %s", key.c_str(), e.what());
125 template <
typename ParameterType>
128 _any_values[key] = boost::any(value);
Definition: ConfigOptions.h:36
const std::string & get_joint_id_map() const
Definition: ConfigOptions.cpp:12
bool has_config() const
Definition: ConfigOptions.cpp:27
std::string _path_to_cfg
Definition: ConfigOptions.h:90
bool get_urdf_path(std::string &urdf_path)
get_urdf_path retrieve the path to the urdf passed
Definition: ConfigOptions.cpp:368
std::string _urdf
Definition: ConfigOptions.h:87
static std::ostream & error(Logger::Severity s=Logger::Severity::HIGH)
Logs an error message (in red, with bold [ERROR] header).
Definition: RtLog.cpp:41
bool set_jidmap_path(std::string path_to_jidmap)
Definition: ConfigOptions.cpp:217
bool get_srdf_path(std::string &srdf_path)
get_srdf_path retrieve the path to the srdf passed
Definition: ConfigOptions.cpp:377
bool is_floating_base()
Definition: ConfigOptions.cpp:351
std::string get_path_to_config() const
Definition: ConfigOptions.cpp:363
bool set_urdf(std::string urdf)
Definition: ConfigOptions.cpp:222
std::string _jidmap
Definition: ConfigOptions.h:87
std::string _srdf_path
Definition: ConfigOptions.h:88
bool set_srdf(std::string srdf)
Definition: ConfigOptions.cpp:257
const std::string & get_urdf() const
Definition: ConfigOptions.cpp:22
std::string _srdf
Definition: ConfigOptions.h:87
bool set_parameter(std::string key, const ParameterType &value)
Definition: ConfigOptions.h:126
YAML::Node _config
Definition: ConfigOptions.h:89
bool set_urdf_path(std::string path_to_urdf)
Definition: ConfigOptions.cpp:199
const std::string & get_srdf() const
Definition: ConfigOptions.cpp:17
bool generate_jidmap()
Definition: ConfigOptions.cpp:386
void make_floating_base(bool fb)
Definition: ConfigOptions.cpp:281
bool set_srdf_path(std::string path_to_srdf)
Definition: ConfigOptions.cpp:211
bool set_jidmap(std::string jidmap)
Definition: ConfigOptions.cpp:269
bool is_same_robot(const ConfigOptions &other) const
Definition: ConfigOptions.cpp:32
std::string _urdf_path
Definition: ConfigOptions.h:88
const YAML::Node & get_config() const
Definition: ConfigOptions.cpp:7
static ConfigOptions FromConfigFile(std::string path_to_config_file)
Definition: ConfigOptions.cpp:58
Definition: IXBotModel.h:20
bool get_parameter(std::string key, ParameterType &value) const
Definition: ConfigOptions.h:103