MBDyn new joints, sine, cosine

This commit is contained in:
Aik-Siong Koh
2023-12-08 21:39:53 -07:00
parent 98d6d46ebd
commit 56bba4e921
58 changed files with 5895 additions and 1905 deletions

View File

@@ -16,31 +16,15 @@ void MbD::MBDynBody::initialize()
void MbD::MBDynBody::parseMBDyn(std::string line)
{
bodyString = line;
size_t previousPos = 0;
auto pos = line.find(":");
auto front = line.substr(previousPos, pos - previousPos);
assert(front.find("body") != std::string::npos);
auto arguments = std::vector<std::string>();
std::string argument;
while (true) {
previousPos = pos;
pos = line.find(",", pos + 1);
if (pos != std::string::npos) {
argument = line.substr(previousPos + 1, pos - previousPos - 1);
arguments.push_back(argument);
}
else {
argument = line.substr(previousPos + 1);
arguments.push_back(argument);
break;
}
}
auto iss = std::istringstream(arguments.at(0));
iss >> name;
arguments.erase(arguments.begin());
iss = std::istringstream(arguments.at(0));
iss >> nodeName;
arguments.erase(arguments.begin());
arguments = collectArgumentsFor("body", line);
name = readStringOffTop(arguments);
nodeName = readStringOffTop(arguments);
//auto iss = std::istringstream(arguments.at(0));
//iss >> name;
//arguments.erase(arguments.begin());
//iss = std::istringstream(arguments.at(0));
//iss >> nodeName;
//arguments.erase(arguments.begin());
readMass(arguments);
rPcmP = readPosition(arguments);
readInertiaMatrix(arguments);