From ae34cfef4f80bee875f02083c512516f1e2891e6 Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <jmirabel@laas.fr>
Date: Wed, 27 Jan 2016 14:21:45 +0100
Subject: [PATCH] PreGrasp are not using inequality constraints. Remove
 Handle::preGrapsComplement

---
 include/hpp/manipulation/handle.hh | 20 ++++----------------
 src/handle.cc                      | 27 ++++-----------------------
 2 files changed, 8 insertions(+), 39 deletions(-)

diff --git a/include/hpp/manipulation/handle.hh b/include/hpp/manipulation/handle.hh
index b3b4597..a62481d 100644
--- a/include/hpp/manipulation/handle.hh
+++ b/include/hpp/manipulation/handle.hh
@@ -102,23 +102,11 @@ namespace hpp {
       /// \param gripper object containing the gripper information
       /// \return the constraint of relative transformation between the handle and
       ///         the gripper.
-      /// \note Only 5 DOFs of the relative transformation between the handle and the gripper
-      ///       are constrained. The translation along x-axis is not constrained.
+      /// \note 6 DOFs of the relative transformation between the handle and the gripper
+      ///       are constrained. The transformation is shifted along x-axis of
+      ///       value shift.
       virtual NumericalConstraintPtr_t createPreGrasp
-      (const GripperPtr_t& gripper) const;
-
-      /// Create constraint that acts on the non-constrained axis of the
-      /// constraint generated by Handle::createPreGrasp.
-      /// \param gripper object containing the gripper information
-      /// \param shift the target value along the x-axis
-      /// \param width width of the interval of freedom of gripper along x-axis.
-      /// \return the constraint of relative position between the handle and
-      ///         the gripper.
-      /// \note Only the x-axis of the relative transformation between the handle and the gripper
-      ///       is constrained.
-      virtual NumericalConstraintPtr_t createPreGraspComplement
-      (const GripperPtr_t& gripper, const value_type& shift,
-       const value_type& width) const;
+      (const GripperPtr_t& gripper, const value_type& shift) const;
 
       static NumericalConstraintPtr_t createGrasp
       (const GripperPtr_t& gripper,const HandlePtr_t& handle)
diff --git a/src/handle.cc b/src/handle.cc
index 6122a5d..0bc20cc 100644
--- a/src/handle.cc
+++ b/src/handle.cc
@@ -93,38 +93,19 @@ namespace hpp {
     }
 
     NumericalConstraintPtr_t Handle::createPreGrasp
-    (const GripperPtr_t& gripper) const
-    {
-      using boost::assign::list_of;
-      std::vector <bool> mask = list_of (false)(true)(true)(true)(true)(true);
-      return NumericalConstraintPtr_t
-	(NumericalConstraint::create (RelativeTransformation::create
-				      ("Transformation_(0,1,1,1,1,1)_" + name ()
-				       + "_" + gripper->name (),
-				       gripper->joint()->robot(),
-				       gripper->joint (), joint (),
-				       gripper->objectPositionInJoint (),
-				       localPosition(), mask)));
-    }
-
-    NumericalConstraintPtr_t Handle::createPreGraspComplement
-    (const GripperPtr_t& gripper, const value_type& shift,
-     const value_type& width) const
+    (const GripperPtr_t& gripper, const value_type& shift) const
     {
       using boost::assign::list_of;
-      using core::DoubleInequality;
-      std::vector <bool> mask = list_of (true)(false)(false)(false)(false)
-	(false);
+      std::vector <bool> mask = list_of (true)(true)(true)(true)(true)(true);
       Transform3f transform = gripper->objectPositionInJoint ()
         * Transform3f (fcl::Vec3f (shift,0,0));
       return NumericalConstraintPtr_t
 	(NumericalConstraint::create (RelativeTransformation::create
-				      ("Transformation_(1,0,0,0,0,0)_" + name ()
+				      ("Transformation_(0,1,1,1,1,1)_" + name ()
 				       + "_" + gripper->name (),
 				       gripper->joint()->robot(),
 				       gripper->joint (), joint (),
-				       transform, localPosition(), mask),
-				      DoubleInequality::create (width)));
+                                       transform, localPosition(), mask)));
     }
 
     HandlePtr_t Handle::clone () const
-- 
GitLab