diff --git a/src/btree_nodes/src/Extensions.cpp b/src/btree_nodes/src/Extensions.cpp index 3b5fe2a..f4827ab 100644 --- a/src/btree_nodes/src/Extensions.cpp +++ b/src/btree_nodes/src/Extensions.cpp @@ -38,15 +38,22 @@ namespace BT { template<> std::shared_ptr convertFromString(StringView str) { auto parts = splitString(str, ','); - if (parts.size() != 3) { - throw RuntimeError("Incorrect number of arguments, expected 3 in format ',,'."); + if (!(parts.size() == 3 || parts.size() == 7)) { + throw RuntimeError("Incorrect number of arguments, expected 3 or 7 in format ',,[,,,,]'."); } auto pose = std::make_shared(); - pose->orientation.w = 1; - pose->orientation.x = 0; - pose->orientation.y = 0; - pose->orientation.z = 0; + if(parts.size() == 7){ + pose->orientation.w = convertFromString(parts[3]); + pose->orientation.x = convertFromString(parts[4]); + pose->orientation.y = convertFromString(parts[5]); + pose->orientation.z = convertFromString(parts[6]); + }else{ + pose->orientation.w = 1; + pose->orientation.x = 0; + pose->orientation.y = 0; + pose->orientation.z = 0; + } pose->position.x = convertFromString(parts[0]); pose->position.y = convertFromString(parts[1]); pose->position.z = convertFromString(parts[2]);