From fe174e2b9e872085d47979f3c08a090bf11f8852 Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <jmirabel@laas.fr>
Date: Mon, 4 Aug 2014 18:58:57 +0200
Subject: [PATCH] Update Robot::copyGrippers to take gripper parameter into
 account.

---
 src/robot.cc | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/robot.cc b/src/robot.cc
index 8645fda..f896dff 100644
--- a/src/robot.cc
+++ b/src/robot.cc
@@ -145,6 +145,18 @@ namespace hpp {
                itJoint != joints.end() ; itJoint++ ) {
           gripper->addDisabledCollision(jointMap_[*itJoint]);
         }
+        if ((*itGripper)->isParameterActive ())
+        {
+          JointVector_t innerJoints = (*itGripper)->innerJoints(),
+                        innerJointsNew;
+          for (model::JointVector_t::const_iterator itJoint = innerJoints.begin() ;
+              itJoint != innerJoints.end() ; itJoint++ ) {
+            innerJointsNew.push_back(jointMap_[*itJoint]);
+          }
+          gripper->innerJoints (innerJointsNew);
+          gripper->openConfig ((*itGripper)->openConfig ());
+          gripper->closedConfig ((*itGripper)->closedConfig ());
+        }
 	addGripper (gripper->name (), gripper);
       }
     }
-- 
GitLab