Skip to content
Snippets Groups Projects
Commit 32c79c1d authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Handle::createGraspComplement return a zero function

parent 73994c6e
No related branches found
No related tags found
No related merge requests found
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
// hpp-manipulation. If not, see // hpp-manipulation. If not, see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
#include <hpp/manipulation/handle.hh>
#include <hpp/util/debug.hh> #include <hpp/util/debug.hh>
#include <hpp/model/device.hh> #include <hpp/model/device.hh>
#include <hpp/core/explicit-numerical-constraint.hh>
#include <hpp/manipulation/handle.hh>
#include <boost/assign/list_of.hpp> #include <boost/assign/list_of.hpp>
...@@ -33,10 +33,24 @@ ...@@ -33,10 +33,24 @@
#include <hpp/constraints/relative-transformation.hh> #include <hpp/constraints/relative-transformation.hh>
#include <hpp/core/numerical-constraint.hh> #include <hpp/core/numerical-constraint.hh>
#include <hpp/core/explicit-numerical-constraint.hh>
#include <hpp/core/explicit-relative-transformation.hh> #include <hpp/core/explicit-relative-transformation.hh>
namespace hpp { namespace hpp {
namespace manipulation { namespace manipulation {
namespace {
struct ZeroDiffFunc : public constraints::DifferentiableFunction {
ZeroDiffFunc (size_type sIn, size_type sInD,
std::string name=std::string("Empty function"))
: DifferentiableFunction (sIn, sInD, 0, 0, name)
{
context ("Grasp complement");
}
inline void impl_compute (vectorOut_t, vectorIn_t) const {}
inline void impl_jacobian (matrixOut_t, vectorIn_t) const {}
};
}
using core::ExplicitNumericalConstraint; using core::ExplicitNumericalConstraint;
using constraints::DifferentiableFunction; using constraints::DifferentiableFunction;
...@@ -79,17 +93,13 @@ namespace hpp { ...@@ -79,17 +93,13 @@ namespace hpp {
NumericalConstraintPtr_t Handle::createGraspComplement NumericalConstraintPtr_t Handle::createGraspComplement
(const GripperPtr_t& gripper) const (const GripperPtr_t& gripper) const
{ {
using boost::assign::list_of; core::DevicePtr_t robot = gripper->joint()->robot();
std::vector <bool> mask = list_of (false)(false)(false)(false)(false) return NumericalConstraint::create (
(false); boost::shared_ptr <ZeroDiffFunc> (new ZeroDiffFunc (
return NumericalConstraintPtr_t robot->configSize(), robot->numberDof (),
(NumericalConstraint::create (RelativeTransformation::create "Transformation_(0,0,0,0,0,0)_" + name () + "_" + gripper->name ()
("Transformation_(0,0,0,0,0,0)_" + name () ))
+ "_" + gripper->name (), );
gripper->joint()->robot(),
gripper->joint (), joint (),
gripper->objectPositionInJoint (),
localPosition(), mask)));
} }
NumericalConstraintPtr_t Handle::createPreGrasp NumericalConstraintPtr_t Handle::createPreGrasp
......
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