Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions include/mujincontrollerclient/mujincontrollerclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,15 @@ class MUJINCLIENT_API WebResource
return __pk;
}

/// \brief gets an attribute of this web resource
template<class T>
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<T>(pt, path.c_str());
}

/// \brief gets an attribute of this web resource
template<class T>
inline T Get(const std::string& field, double timeout = 5.0) {
Expand Down