From fb002db0d9df8f7d7c76bb1f85d331ea2593e9e4 Mon Sep 17 00:00:00 2001 From: Francois Keith <francois.keith@inrialpes.fr> Date: Wed, 30 Nov 2011 22:46:09 +0100 Subject: [PATCH] Add the toes to the list of joints accessible with their names. --- src/dynamic.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/dynamic.cpp b/src/dynamic.cpp index 4e0f8a8..d9976a3 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." -- GitLab