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()) {
62 throw Exception(
"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_);
Fawkes library namespace.
Thread class encapsulation of pthreads.
Logger * logger
This is the Logger member used to access the logger.
virtual void init()
Initialize the thread.
virtual void finalize()
Finalize the thread.
Base class for exceptions in Fawkes.
const char * name() const
Get name of thread.
virtual void log_error(const char *component, const char *format,...)=0
Log error message.
Configuration * config
This is the Configuration member used to access the configuration.
virtual std::string get_string(const char *path)=0
Get value from configuration which is of type string.