From 8cbb0948039df35d8dcf9f3d3c3ef36135daa9c4 Mon Sep 17 00:00:00 2001 From: Florent Lamiraux <florent@laas.fr> Date: Sat, 25 Nov 2017 11:47:25 +0100 Subject: [PATCH] Make class AxialHandle deprecated. --- include/hpp/manipulation/axial-handle.hh | 36 ++++++++++++------------ src/axial-handle.cc | 17 +++++++++++ 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/include/hpp/manipulation/axial-handle.hh b/include/hpp/manipulation/axial-handle.hh index 5cd03689..6a947de3 100644 --- a/include/hpp/manipulation/axial-handle.hh +++ b/include/hpp/manipulation/axial-handle.hh @@ -21,11 +21,14 @@ # define HPP_MANIPULATION_AXIAL_HANDLE_HH # include <hpp/manipulation/handle.hh> +# include <hpp/manipulation/deprecated.hh> namespace hpp { namespace manipulation { /// Handle symmetric around its z-axis. The constraint defined for a grasp /// by a gripper is free to rotate around z-axis. + /// \deprecated This class is deprecated. Use class Handle with appropriate + /// mask class HPP_MANIPULATION_DLLAPI AxialHandle : public Handle { public: @@ -34,30 +37,29 @@ namespace hpp { /// \param grasp object containing the grasp information /// \return the constraint of relative position between the handle and /// the gripper. The rotation around x is not constrained. + /// \deprecated This class is deprecated. The method creates an instance + /// of Handle with appropriate mask static AxialHandlePtr_t create (const std::string& name, const Transform3f& localPosition, const JointPtr_t& joint) - { - AxialHandle* ptr = new AxialHandle (name, localPosition, joint); - AxialHandlePtr_t shPtr (ptr); - ptr->init (shPtr); - return shPtr; - } + HPP_MANIPULATION_DEPRECATED; + /// Return a pointer to the copy of this virtual HandlePtr_t clone () const; - /// Create constraint corresponding to a gripper grasping this object - /// \param grasp object containing the grasp information - /// \return the constraint of relative transformation between the handle and - /// the gripper. The rotation around x is not constrained. + /// Create constraint corresponding to a gripper grasping this handle + /// \param gripper object containing the gripper information + /// \return the constraint of relative transformation between the handle + /// and the gripper. + /// \note 5 degrees of freedom are constrained. Rotation around z is free. virtual NumericalConstraintPtr_t createGrasp (const GripperPtr_t& gripper, std::string name) const; - /// Create constraint that acts on the non-constrained axis of the - /// constraint generated by Handle::createGrasp. + /// Create complement constraint of gripper grasping this handle /// \param gripper object containing the gripper information - /// \return a relative orientation constraint between the handle and - /// the gripper. Only the rotation around the x-axis is constrained. + /// \return trivial constraint + /// \note 1 degree of freedom is constrained: rotation around z. + /// \note the constraint is parameterizable: non constant right hand side. virtual NumericalConstraintPtr_t createGraspComplement (const GripperPtr_t& gripper, std::string name) const; @@ -91,10 +93,8 @@ namespace hpp { /// \return the constraint of relative position between the handle and /// the gripper. The rotation around x is not constrained. AxialHandle (const std::string& name, const Transform3f& localPosition, - const JointPtr_t& joint) : Handle (name, localPosition, - joint), weakPtr_ () - { - } + const JointPtr_t& joint) HPP_MANIPULATION_DEPRECATED; + void init (const AxialHandleWkPtr_t& weakPtr) { Handle::init (weakPtr); diff --git a/src/axial-handle.cc b/src/axial-handle.cc index 0cf828f3..ee652d88 100644 --- a/src/axial-handle.cc +++ b/src/axial-handle.cc @@ -32,6 +32,16 @@ namespace hpp { namespace manipulation { static const matrix3_t I3 = matrix3_t::Identity(); + AxialHandlePtr_t AxialHandle::create (const std::string& name, + const Transform3f& localPosition, + const JointPtr_t& joint) + { + AxialHandle* ptr = new AxialHandle (name, localPosition, joint); + AxialHandlePtr_t shPtr (ptr); + ptr->init (shPtr); + return shPtr; + } + NumericalConstraintPtr_t AxialHandle::createGrasp (const GripperPtr_t& gripper, std::string n) const { @@ -119,5 +129,12 @@ namespace hpp { os << "joint :" << joint ()->name () << std::endl; return os; } + + AxialHandle::AxialHandle (const std::string& name, + const Transform3f& localPosition, + const JointPtr_t& joint) : + Handle (name, localPosition, joint), weakPtr_ () + { + } } // namespace manipulation } // namespace hpp -- GitLab