Skip to content

Commit

Permalink
Merge pull request #479 from traversaro/fixConsecutiveAddConstraint
Browse files Browse the repository at this point in the history
InverseKinematics: Fix multiple calls to add**(Target|Constraint)
  • Loading branch information
traversaro authored Sep 10, 2018
2 parents 874d88d + e8be1c4 commit 348803e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/inverse-kinematics/src/InverseKinematics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ namespace iDynTree {
IK_PIMPL(m_pimpl)->m_comHullConstraint_yAxisOfPlaneInWorld = yAxisOfPlaneInWorld;
IK_PIMPL(m_pimpl)->m_comHullConstraint_originOfPlaneInWorld = originOfPlaneInWorld;

// If this method is called again to reconfigure the constraint, the problem needs to be reinitialized
IK_PIMPL(m_pimpl)->m_problemInitialized = false;

return true;
}

Expand Down
8 changes: 8 additions & 0 deletions src/inverse-kinematics/src/InverseKinematicsData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ namespace kinematics {

//add the constraint to the set
std::pair<TransformMap::iterator, bool> result = m_constraints.insert(TransformMap::value_type(frameIndex, frameTransformConstraint));

// If this method is called again to reconfigure the constraint, the problem needs to be reinitialized
IK_PIMPL(m_pimpl)->m_problemInitialized = false;

return result.second;
}

Expand All @@ -195,6 +199,10 @@ namespace kinematics {
if (result.second) {
result.first->second.setTargetResolutionMode(m_defaultTargetResolutionMode);
}

// If this method is called again to reconfigure the constraint, the problem needs to be reinitialized
IK_PIMPL(m_pimpl)->m_problemInitialized = false;

return result.second;
}

Expand Down

0 comments on commit 348803e

Please sign in to comment.