Skip to content
Snippets Groups Projects
Commit 0a2cf314 authored by Florent Lamiraux's avatar Florent Lamiraux Committed by Florent Lamiraux florent@laas.fr
Browse files

Remove deprecated class AxialHandle.

parent e1fe1829
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,6 @@ CONFIG_FILES (doc/main.hh
SET (${PROJECT_NAME}_HEADERS
${CMAKE_BINARY_DIR}/include/hpp/manipulation/package-config.hh
include/hpp/manipulation/fwd.hh
include/hpp/manipulation/axial-handle.hh
include/hpp/manipulation/handle.hh
include/hpp/manipulation/problem.hh
include/hpp/manipulation/problem-solver.hh
......
///
/// Copyright (c) 2014 CNRS
/// Authors: Florent Lamiraux
///
///
// This file is part of hpp-manipulation.
// hpp-manipulation is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// hpp-manipulation is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// hpp-manipulation. If not, see
// <http://www.gnu.org/licenses/>.
#ifndef HPP_MANIPULATION_AXIAL_HANDLE_HH
# 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:
static std::string className;
/// Create constraint corresponding to a gripper grasping this object
/// \param robot the robot that grasps the handle,
/// \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)
HPP_MANIPULATION_DEPRECATED;
/// Return a pointer to the copy of this
virtual HandlePtr_t clone () const;
/// 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 complement constraint of gripper grasping this handle
/// \param gripper object containing the gripper information
/// \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;
/// Create constraint corresponding to a pregrasping task.
/// \param gripper object containing the gripper information
/// \return the constraint of relative transformation between the handle and
/// the gripper.
/// \note The translation along x-axis and the rotation around z-axis are not constrained.
/// \todo this function is never called. It should follow changes of
/// Handle::createPreGrasp prototype.
virtual NumericalConstraintPtr_t createPreGrasp
(const GripperPtr_t& gripper, const value_type& shift, std::string name) const;
virtual std::ostream& print (std::ostream& os) const;
protected:
/// Constructor
/// \param robot the robot that grasps the handle,
/// \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.
AxialHandle (const std::string& name, const Transform3f& localPosition,
const JointPtr_t& joint) HPP_MANIPULATION_DEPRECATED;
void init (const AxialHandleWkPtr_t& weakPtr)
{
Handle::init (weakPtr);
weakPtr_ = weakPtr;
}
/// Weak pointer to itself
AxialHandleWkPtr_t weakPtr_;
}; // class AxialHandle
} // namespace manipulation
} // namespace hpp
#endif // HPP_MANIPULATION_AXIAL_HANDLE_HH
......@@ -20,7 +20,6 @@
SET(LIBRARY_NAME ${PROJECT_NAME})
SET(SOURCES
axial-handle.cc
handle.cc
symbolic-planner.cc
manipulation-planner.cc
......
///
/// Copyright (c) 2014 CNRS
/// Authors: Florent Lamiraux
///
///
// This file is part of hpp-manipulation.
// hpp-manipulation is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// hpp-manipulation is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// hpp-manipulation. If not, see
// <http://www.gnu.org/licenses/>.
#include <hpp/manipulation/axial-handle.hh>
#include <boost/assign/list_of.hpp>
#include <hpp/pinocchio/joint.hh>
#include <hpp/pinocchio/gripper.hh>
#include <hpp/constraints/generic-transformation.hh>
#include <hpp/core/numerical-constraint.hh>
namespace hpp {
namespace manipulation {
std::string AxialHandle::className ("AxialHandle");
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
{
using boost::assign::list_of;
std::vector <bool> mask = list_of (true)(true)(true)(true)(true)(false);
if (n.empty())
n = "Transformation_(1,1,1,1,1,0)_" + name() + "_" + gripper->name();
return NumericalConstraintPtr_t
(NumericalConstraint::create (RelativeTransformation::create
(n,
gripper->joint()->robot(),
gripper->joint (), joint (),
gripper->objectPositionInJoint (),
localPosition(), mask)));
}
NumericalConstraintPtr_t AxialHandle::createGraspComplement
(const GripperPtr_t& gripper, std::string n) const
{
using boost::assign::list_of;
std::vector <bool> mask = list_of (false)(false)(false)(false)(false)
(true);
if (n.empty())
n = "Transformation_(0,0,0,0,0,1)_" + name() + "_" + gripper->name();
return NumericalConstraint::create (RelativeTransformation::create
(n, gripper->joint()->robot(),
gripper->joint (), joint (),
gripper->objectPositionInJoint (),
localPosition(), mask),
ComparisonTypes_t (1, constraints::Equality));
}
NumericalConstraintPtr_t AxialHandle::createPreGrasp
(const GripperPtr_t& gripper, const value_type& shift, std::string n) const
{
using boost::assign::list_of;
std::vector <bool> mask = list_of (true)(true)(true)(true)(true)(false);
Transform3f transform = gripper->objectPositionInJoint ()
* Transform3f (I3, vector3_t (shift,0,0));
if (n.empty())
n = "Transformation_(1,1,1,1,1,0)_" + name () + "_" + gripper->name ();
return NumericalConstraintPtr_t
(NumericalConstraint::create (RelativeTransformation::create
(n,
gripper->joint()->robot(),
gripper->joint (), joint (),
transform,
localPosition(), mask)));
}
HandlePtr_t AxialHandle::clone () const
{
AxialHandlePtr_t self = weakPtr_.lock ();
return AxialHandle::create (self->name (), self->localPosition (),
self->joint ());
}
std::ostream& AxialHandle::print (std::ostream& os) const
{
os << "name :" << name () << " (axial)" << std::endl;
os << "local position :" << localPosition () << std::endl;
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment