diff --git a/core/include/moveit/task_constructor/properties.h b/core/include/moveit/task_constructor/properties.h index 42a44e90..f0c4087a 100644 --- a/core/include/moveit/task_constructor/properties.h +++ b/core/include/moveit/task_constructor/properties.h @@ -230,6 +230,12 @@ public: else it->second.setValue(value); } + + /// overloading: const char* is stored as std::string + inline void set(const std::string& name, const char* value){ + set(name, value); + } + /// temporarily set the value of a property void setCurrent(const std::string& name, const boost::any& value); diff --git a/core/include/moveit/task_constructor/stage.h b/core/include/moveit/task_constructor/stage.h index 8ca057cc..7c01cd96 100644 --- a/core/include/moveit/task_constructor/stage.h +++ b/core/include/moveit/task_constructor/stage.h @@ -182,6 +182,10 @@ public: } /// set a previously declared property to a new value void setProperty(const std::string& name, const boost::any& value); + /// overload: const char* values are stored as std::string + inline void setProperty(const std::string& name, const char* value) { + setProperty(name, std::string(value)); + } /// analyze source of error and report accordingly void reportPropertyError(const Property::error &e); diff --git a/core/include/moveit/task_constructor/task.h b/core/include/moveit/task_constructor/task.h index e1a5d2f4..653e7c71 100644 --- a/core/include/moveit/task_constructor/task.h +++ b/core/include/moveit/task_constructor/task.h @@ -115,6 +115,10 @@ public: return const_cast(this)->properties(); } void setProperty(const std::string& name, const boost::any& value); + /// overload: const char* values are stored as std::string + inline void setProperty(const std::string& name, const char* value) { + setProperty(name, std::string(value)); + } protected: bool canCompute() const override;