diff --git a/include/hpp/manipulation/handle.hh b/include/hpp/manipulation/handle.hh index b3b4597d3afe405c685b2e33324308b58294455c..a62481db2b33c486d128dcff5814bd5f72f851c2 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 6122a5dd46d43e7784ed8212444bc672d1e8205f..0bc20ccb18ed649e3e50ee7719e2fc5466b02122 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