diff --git a/src/dynamic.cpp b/src/dynamic.cpp index 4e0f8a88f15f56d9667fc4e1f1a761f53dcc8d19..d9976a32bffecff3d73e26081db5bc0a798b446d 100644 --- a/src/dynamic.cpp +++ b/src/dynamic.cpp @@ -1253,6 +1253,24 @@ CjrlJoint* Dynamic::getJointByName( const std::string& jointName ) return m_HDR->chest(); } else if (jointName == "gaze") { return m_HDR->gazeJoint(); + } + + // left toe + else if (jointName == "left-toe") + { + if (m_HDR->leftAnkle()->countChildJoints () == 0) + throw ExceptionDynamic(ExceptionDynamic::GENERIC," The robot has no toes"); + else + return m_HDR->leftAnkle()->childJoint(0); + } + + // right toe + else if (jointName == "right-toe") { + if (m_HDR->rightAnkle()->countChildJoints () == 0) + throw ExceptionDynamic(ExceptionDynamic::GENERIC," The robot has no toes"); + else + return m_HDR->rightAnkle()->childJoint(0); + } else { throw ExceptionDynamic(ExceptionDynamic::GENERIC, jointName + " is not a valid name."