Skip to content
Snippets Groups Projects
Unverified Commit 2912c9a2 authored by Florent Lamiraux's avatar Florent Lamiraux Committed by GitHub
Browse files

Merge pull request #88 from florent-lamiraux/devel

Update to modifications in hpp-constraints
parents 01977fee d8cf85f0
No related branches found
No related tags found
No related merge requests found
...@@ -72,13 +72,13 @@ namespace hpp { ...@@ -72,13 +72,13 @@ namespace hpp {
return false; return false;
} }
inline std::size_t maskSize (const std::vector<bool>& mask) inline int maskSize (const std::vector<bool>& mask)
{ {
std::size_t res (0); std::size_t res (0);
for (std::size_t i = 0; i < 6; ++i) { for (std::size_t i = 0; i < 6; ++i) {
if (mask[i]) ++res; if (mask[i]) ++res;
} }
return res; return (int)res;
} }
inline bool is6Dmask (const std::vector<bool>& mask) inline bool is6Dmask (const std::vector<bool>& mask)
...@@ -130,7 +130,7 @@ namespace hpp { ...@@ -130,7 +130,7 @@ namespace hpp {
return constraints::explicit_::RelativePose::create return constraints::explicit_::RelativePose::create
(n, robot (), gripper->joint (), joint (), (n, robot (), gripper->joint (), joint (),
gripper->objectPositionInJoint (), localPosition(), gripper->objectPositionInJoint (), localPosition(),
mask_, ComparisonTypes_t (6, constraints::EqualToZero)); 6 * constraints::EqualToZero);
} }
return Implicit::create (RelativeTransformation::create return Implicit::create (RelativeTransformation::create
(n, robot (), gripper->joint (), joint (), (n, robot (), gripper->joint (), joint (),
...@@ -150,15 +150,14 @@ namespace hpp { ...@@ -150,15 +150,14 @@ namespace hpp {
if (is6Dmask(mask_)) { if (is6Dmask(mask_)) {
return Implicit::create ( return Implicit::create (
boost::shared_ptr <ZeroDiffFunc> (new ZeroDiffFunc ( boost::shared_ptr <ZeroDiffFunc> (new ZeroDiffFunc (
r->configSize(), r->numberDof (), n)) r->configSize(), r->numberDof (), n)), ComparisonTypes_t());
);
} else { } else {
std::vector<bool> Cmask = complementMask(mask_); std::vector<bool> Cmask = complementMask(mask_);
return Implicit::create (RelativeTransformation::create return Implicit::create (RelativeTransformation::create
(n, r, gripper->joint (), joint (), (n, r, gripper->joint (), joint (),
gripper->objectPositionInJoint (), localPosition(), gripper->objectPositionInJoint (), localPosition(),
Cmask), Cmask),
ComparisonTypes_t (maskSize (Cmask), constraints::Equality)); maskSize(Cmask) * constraints::Equality);
} }
} }
...@@ -184,8 +183,7 @@ namespace hpp { ...@@ -184,8 +183,7 @@ namespace hpp {
if (isHandleOnFreeflyer (*this)) { if (isHandleOnFreeflyer (*this)) {
return constraints::explicit_::RelativePose::create return constraints::explicit_::RelativePose::create
(n, robot (), gripper->joint (), joint (), (n, robot (), gripper->joint (), joint (),
gripper->objectPositionInJoint (), localPosition(), gripper->objectPositionInJoint (), localPosition(), comp);
std::vector <bool> (6, true), comp);
} }
return Implicit::create (RelativeTransformation::create return Implicit::create (RelativeTransformation::create
(n, robot (), gripper->joint (), joint (), (n, robot (), gripper->joint (), joint (),
...@@ -206,7 +204,7 @@ namespace hpp { ...@@ -206,7 +204,7 @@ namespace hpp {
(RelativeTransformation::create (RelativeTransformation::create
(n, robot(), gripper->joint (), joint (), (n, robot(), gripper->joint (), joint (),
M, localPosition(), mask_), M, localPosition(), mask_),
ComparisonTypes_t(maskSize (mask_), constraints::EqualToZero))); maskSize(mask_) * constraints::EqualToZero));
return result; return result;
} }
......
...@@ -324,7 +324,8 @@ namespace hpp { ...@@ -324,7 +324,8 @@ namespace hpp {
(hpp::constraints::ConvexShapeContact::create (hpp::constraints::ConvexShapeContact::create
(name, robot_, floorSurfaces, objectSurfaces)); (name, robot_, floorSurfaces, objectSurfaces));
cvxShape->setNormalMargin(margin + width); cvxShape->setNormalMargin(margin + width);
addNumericalConstraint (name, Implicit::create (cvxShape)); addNumericalConstraint (name, Implicit::create
(cvxShape, 5 * constraints::EqualToZero));
} }
void ProblemSolver::createGraspConstraint void ProblemSolver::createGraspConstraint
......
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