diff --git a/include/mujincontrollerclient/mujincontrollerclient.h b/include/mujincontrollerclient/mujincontrollerclient.h index 55aead94..6f8ceb3e 100644 --- a/include/mujincontrollerclient/mujincontrollerclient.h +++ b/include/mujincontrollerclient/mujincontrollerclient.h @@ -692,6 +692,15 @@ class MUJINCLIENT_API WebResource return __pk; } + /// \brief gets an attribute of this web resource + template + inline T GetPath(const std::string& path, double timeout = 5.0) { + rapidjson::Document pt(rapidjson::kObjectType); + std::string fieldToConstraintForCallGet = path.substr(1, path.find('/', 1)); + GetWrap(pt, fieldToConstraintForCallGet, timeout); + return mujinjson_external::GetJsonValueByPath(pt, path.c_str()); + } + /// \brief gets an attribute of this web resource template inline T Get(const std::string& field, double timeout = 5.0) {