22 #include "robot_description_thread.h" 31 #define CFG_PREFIX "/ros/robot-description/" 38 ROSRobotDescriptionThread::ROSRobotDescriptionThread()
39 :
Thread(
"ROSRobotDescriptionThread",
Thread::OPMODE_WAITFORWAKEUP)
43 ROSRobotDescriptionThread::~ROSRobotDescriptionThread()
55 if (cfg_urdf_path_.substr(0,1) !=
"/") {
57 cfg_urdf_path_.insert(0, RESDIR
"/urdf/");
59 ifstream urdf_file(cfg_urdf_path_.c_str());
60 if (!urdf_file.is_open()) {
61 logger->
log_error(
name(),
"failed to open URDF File %s", cfg_urdf_path_.c_str());
64 while ( getline(urdf_file, line)) {
69 ros::param::set(cfg_ros_param_, urdf);
75 ros::param::del(cfg_ros_param_);
virtual void log_error(const char *component, const char *format,...)
Log error message.
Fawkes library namespace.
Thread class encapsulation of pthreads.
const char * name() const
Get the name of the plugin.
virtual void init()
Initialize the thread.
virtual void finalize()
Finalize the thread.
Configuration * config
Fawkes configuration.
virtual std::string get_string(const char *path)=0
Get value from configuration which is of type string.