diff options
author | Tobias Klauser <tobias.klauser@uzh.ch> | 2013-04-12 08:57:17 +0200 |
---|---|---|
committer | Tobias Klauser <tobias.klauser@uzh.ch> | 2013-04-12 08:57:17 +0200 |
commit | c4c11a2c86cac2907bc52cafa4b4e349ff0c88bc (patch) | |
tree | 182bb89cd7872b46d27c764426edd2eff70d221e /LocomotorPrimitivesController.cpp | |
parent | 153c3b2709f3649234eff8291d8e475e92b6f4c3 (diff) | |
parent | 341623412dbec7cb1eb136ab75c11918bb2b3d96 (diff) |
Merge branch 'master' of ssh+git://git.distanz.ch/home/tklauser/scm/locomotor-primitives
Diffstat (limited to 'LocomotorPrimitivesController.cpp')
-rw-r--r-- | LocomotorPrimitivesController.cpp | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/LocomotorPrimitivesController.cpp b/LocomotorPrimitivesController.cpp index ccf45e5..8a85e4f 100644 --- a/LocomotorPrimitivesController.cpp +++ b/LocomotorPrimitivesController.cpp @@ -22,8 +22,42 @@ int LocomotorPrimitivesController::checkControls() * available in the loaded storage */ for (int i = 0; i < act_set_siz; i++) { const OpenSim::Muscle *muscle = dynamic_cast<const OpenSim::Muscle *>(&getActuatorSet().get(i)); - const OpenSim::Array<int> indices = _act.getColumnIndicesForIdentifier(muscle->getName()); + std::string muscle_name = muscle->getName(); + + /* If it is one of the 'special' combined muscles, check the + * combination instead. See comment in computeControls() for + * details. */ + if (muscle_name.compare("bifemlh_r") == 0) { + muscle_name = "hs_r"; + } else if (muscle_name.compare("bifemlh_l") == 0) { + muscle_name = "hs_l"; + } else if (muscle_name.compare("bifemsh_r") == 0) { + muscle_name = "hs_r"; + } else if (muscle_name.compare("bifemsh_l") == 0) { + muscle_name = "hs_l"; + } else if (muscle_name.compare("semimem_r") == 0) { + muscle_name = "hs_r"; + } else if (muscle_name.compare("semimem_l") == 0) { + muscle_name = "hs_l"; + } else if (muscle_name.compare("semiten_r") == 0) { + muscle_name = "hs_r"; + } else if (muscle_name.compare("semiten_l") == 0) { + muscle_name = "hs_l"; + } else if (muscle_name.compare("glut_max1_r") == 0) { + muscle_name = "gm_r"; + } else if (muscle_name.compare("glut_max1_l") == 0) { + muscle_name = "gm_l"; + } else if (muscle_name.compare("glut_max2_r") == 0) { + muscle_name = "gm_r"; + } else if (muscle_name.compare("glut_max2_l") == 0) { + muscle_name = "gm_l"; + } else if (muscle_name.compare("glut_max3_r") == 0) { + muscle_name = "gm_r"; + } else if (muscle_name.compare("glut_max3_l") == 0) { + muscle_name = "gm_l"; + } + const OpenSim::Array<int> indices = _act.getColumnIndicesForIdentifier(muscle_name); if (indices.getSize() == 0) { logger.err("no actuation data for muscle '%s' found\n", muscle->getName().c_str()); ret--; @@ -136,7 +170,7 @@ void LocomotorPrimitivesController::computeControls(const SimTK::State &s, } if (n % N_PRINT == 0) - logger.log("timestep %f: actuation data for" + logger.log("timestep %f: actuation data for " "muscle '%s': %f\n", t, muscle_name.c_str(), mact); |