Skip to content

Commit 9124411

Browse files
committed
Merge pull request ihmcrobotics#261 in ROB/ihmc-open-robotics-software from feature/new_toe_cmp_calculation to develop
* commit '11481f033e416372c03585fbf42cc6ec9ae701bc': modified the action taken when the put exit CMP on toes boolean is set true
2 parents 010238a + 11481f0 commit 9124411

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

CommonWalkingControlModules/src/us/ihmc/commonWalkingControlModules/instantaneousCapturePoint/ReferenceCentroidalMomentumPivotLocationsCalculator.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,9 @@ else if (putExitCMPOnToes.getBooleanValue())
667667
}
668668
else if (putCMPOnToesWalking)
669669
{
670-
putExitCMPOnToes(cmp2d, footSupportPolygon, exitCMPUserOffsets.get(robotSide).getY());
670+
constrainCMPAccordingToSupportPolygonAndUserOffsets(cmp2d, footSupportPolygon, centroidOfFootstepToConsider, exitCMPUserOffsets.get(robotSide),
671+
minForwardExitCMPOffset.getDoubleValue(), footSupportPolygon.getMaxX(),
672+
exitCMPForwardSafetyMarginOnToes.getDoubleValue());
671673
}
672674
else if (putCMPOnToesSteppingDown)
673675
{
@@ -699,7 +701,16 @@ private void putExitCMPOnToes(FramePoint2D exitCMPToPack, FrameConvexPolygon2d f
699701
}
700702

701703
private void constrainCMPAccordingToSupportPolygonAndUserOffsets(FramePoint2D cmpToPack, FrameConvexPolygon2d footSupportPolygon,
702-
FramePoint2D centroidOfFootstepToConsider, YoFrameVector2d cmpOffset, double minForwardCMPOffset, double maxForwardCMPOffset)
704+
FramePoint2D centroidOfFootstepToConsider, YoFrameVector2d cmpOffset,
705+
double minForwardCMPOffset, double maxForwardCMPOffset)
706+
{
707+
constrainCMPAccordingToSupportPolygonAndUserOffsets(cmpToPack, footSupportPolygon, centroidOfFootstepToConsider, cmpOffset, minForwardCMPOffset,
708+
maxForwardCMPOffset, safeDistanceFromCMPToSupportEdges.getDoubleValue());
709+
}
710+
711+
private void constrainCMPAccordingToSupportPolygonAndUserOffsets(FramePoint2D cmpToPack, FrameConvexPolygon2d footSupportPolygon,
712+
FramePoint2D centroidOfFootstepToConsider, YoFrameVector2d cmpOffset,
713+
double minForwardCMPOffset, double maxForwardCMPOffset, double safeDistanceFromCMPToSupportEdges)
703714
{
704715
// First constrain the computed CMP to the given min/max along the x-axis.
705716
FramePoint2D footSupportCentroid = footSupportPolygon.getCentroid();
@@ -711,7 +722,7 @@ private void constrainCMPAccordingToSupportPolygonAndUserOffsets(FramePoint2D cm
711722

712723
// Then constrain the computed CMP to be inside a safe support region
713724
tempSupportPolygonForShrinking.setIncludingFrameAndUpdate(footSupportPolygon);
714-
convexPolygonShrinker.scaleConvexPolygon(tempSupportPolygonForShrinking, safeDistanceFromCMPToSupportEdges.getDoubleValue(), footSupportPolygon);
725+
convexPolygonShrinker.scaleConvexPolygon(tempSupportPolygonForShrinking, safeDistanceFromCMPToSupportEdges, footSupportPolygon);
715726

716727
footSupportPolygon.orthogonalProjection(cmpToPack);
717728
}

0 commit comments

Comments
 (0)