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

@@ -263,7 +263,10 @@ FMatDsptr MbD::MBDynItem::readOrientation(std::vector<std::string>& args)
aAOf = readOrientation(args);
}
else if (str.find("position") != std::string::npos) {
//Do nothing
if (str.find("orientation") != std::string::npos) {
args.erase(args.begin());
aAOf = readOrientation(args);
}
}
else if (str.find("orientation") != std::string::npos) {
args.erase(args.begin());
@@ -283,7 +286,7 @@ FMatDsptr MbD::MBDynItem::readBasicOrientation(std::vector<std::string>& args)
if (str.find("euler") != std::string::npos) {
args.erase(args.begin());
auto euler = std::make_shared<EulerAngles<Symsptr>>();
euler->rotOrder = std::make_shared<FullColumn<int>>(std::initializer_list<int>{ 1, 2, 3 });
euler->rotOrder = std::make_shared<std::vector<int>>(std::initializer_list<int>{ 1, 2, 3 });
for (int i = 0; i < 3; i++)
{
auto userFunc = std::make_shared<BasicUserFunction>(popOffTop(args), 1.0);
@@ -432,6 +435,26 @@ std::string MbD::MBDynItem::readStringOffTop(std::vector<std::string>& args)
return str;
}
void MbD::MBDynItem::readName(std::vector<std::string>& args)
{
name = readStringOffTop(args);
}
std::string MbD::MBDynItem::readJointTypeOffTop(std::vector<std::string>& args)
{
auto ss = std::stringstream();
auto iss = std::istringstream(popOffTop(args));
std::string str;
iss >> str;
ss << str;
while (!iss.eof()) {
ss << ' ';
iss >> str;
ss << str;
}
return ss.str();
}
std::string MbD::MBDynItem::readToken(std::string& line)
{
auto iss = std::istringstream(line);