From f3731987cef7181a3de2a0b530f8e78e3174bdd7 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 14 Feb 2013 14:01:29 +0100 Subject: LocomotorPrimitivesController: Don't warn about combined missing muscles --- LocomotorPrimitivesController.cpp | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/LocomotorPrimitivesController.cpp b/LocomotorPrimitivesController.cpp index ccf45e5..74ce21c 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(&getActuatorSet().get(i)); - const OpenSim::Array 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 indices = _act.getColumnIndicesForIdentifier(muscle_name); if (indices.getSize() == 0) { logger.err("no actuation data for muscle '%s' found\n", muscle->getName().c_str()); ret--; -- cgit v1.2.3-54-g00ecf