Tabnine Logo
FrameConvexPolygon2d.orthogonalProjection
Code IndexAdd Tabnine to your IDE (free)

How to use
orthogonalProjection
method
in
us.ihmc.robotics.geometry.FrameConvexPolygon2d

Best Java code snippets using us.ihmc.robotics.geometry.FrameConvexPolygon2d.orthogonalProjection (Showing top 9 results out of 315)

origin: us.ihmc/CommonWalkingControlModules

public void projectOntoShrunkenPolygon(FramePoint2d pointToProject)
{
 shrunkFootPolygon.orthogonalProjection(pointToProject);
}
origin: us.ihmc/IHMCRoboticsToolkit

public static void projectOntoPolygonAndCheckDistance(FramePoint2d point, FrameConvexPolygon2d polygon, double epsilon)
{
 ReferenceFrame originalReferenceFrame = point.getReferenceFrame();
 point.changeFrame(polygon.getReferenceFrame());
 FramePoint2d originalPoint = new FramePoint2d(point);
 polygon.orthogonalProjection(point);
 double distance = originalPoint.distance(point);
 if (distance > epsilon)
   throw new RuntimeException("point outside polygon by " + distance);
 point.changeFrame(originalReferenceFrame);
}
origin: us.ihmc/CommonWalkingControlModules

private void putExitCMPOnToes(FrameConvexPolygon2d footSupportPolygon, FramePoint2d exitCMPToPack)
{
 // Set x to have the CMP slightly inside the support polygon
 exitCMPToPack.setToZero(footSupportPolygon.getReferenceFrame());
 exitCMPToPack.setX(footSupportPolygon.getMaxX() - 1.6e-2);
 exitCMPToPack.setY(footSupportPolygon.getCentroid().getY());
 // Then constrain the computed CMP to be inside a safe support region
 tempSupportPolygonForShrinking.setIncludingFrameAndUpdate(footSupportPolygon);
 convexPolygonShrinker.shrinkConstantDistanceInto(tempSupportPolygonForShrinking, safeDistanceFromCMPToSupportEdgesWhenSteppingDown.getDoubleValue(),
    footSupportPolygon);
 footSupportPolygon.orthogonalProjection(exitCMPToPack);
}
origin: us.ihmc/CommonWalkingControlModules

public void requestICPPlannerToHoldCurrentCoM()
{
 centerOfMassPosition.setToZero(centerOfMassFrame);
 FrameConvexPolygon2d supportPolygonInMidFeetZUp = bipedSupportPolygons.getSupportPolygonInMidFeetZUp();
 convexPolygonShrinker.shrinkConstantDistanceInto(supportPolygonInMidFeetZUp, distanceToShrinkSupportPolygonWhenHoldingCurrent.getDoubleValue(), shrunkSupportPolygon);
 centerOfMassPosition.changeFrame(shrunkSupportPolygon.getReferenceFrame());
 centerOfMassPosition2d.setByProjectionOntoXYPlaneIncludingFrame(centerOfMassPosition);
 shrunkSupportPolygon.orthogonalProjection(centerOfMassPosition2d);
 centerOfMassPosition.setXY(centerOfMassPosition2d);
 centerOfMassPosition.changeFrame(worldFrame);
 icpPlanner.holdCurrentICP(yoTime.getDoubleValue(), centerOfMassPosition);
}
origin: us.ihmc/CommonWalkingControlModules

private void constrainCMPAccordingToSupportPolygonAndUserOffsets(FramePoint2d cmpToPack, FrameConvexPolygon2d footSupportPolygon,
   FramePoint2d centroidOfFootstepToConsider, YoFrameVector2d cmpOffset, double minForwardCMPOffset, double maxForwardCMPOffset)
{
 // First constrain the computed CMP to the given min/max along the x-axis.
 FramePoint2d footSupportCentroid = footSupportPolygon.getCentroid();
 double cmpXOffsetFromCentroid = stepLengthToCMPOffsetFactor.getDoubleValue() * (centroidOfFootstepToConsider.getX() - footSupportCentroid.getX()) + cmpOffset.getX();
 cmpXOffsetFromCentroid = MathTools.clipToMinMax(cmpXOffsetFromCentroid, minForwardCMPOffset, maxForwardCMPOffset);
 cmpToPack.setIncludingFrame(footSupportCentroid);
 cmpToPack.add(cmpXOffsetFromCentroid, cmpOffset.getY());
 // Then constrain the computed CMP to be inside a safe support region
 tempSupportPolygonForShrinking.setIncludingFrameAndUpdate(footSupportPolygon);
 convexPolygonShrinker.shrinkConstantDistanceInto(tempSupportPolygonForShrinking, safeDistanceFromCMPToSupportEdges.getDoubleValue(), footSupportPolygon);
 footSupportPolygon.orthogonalProjection(cmpToPack);
}
origin: us.ihmc/CommonWalkingControlModules

/** 
* This function projects the footstep midpoint in the capture region.
* Might be a bit conservative it should be sufficient to slightly overlap the capture region
* and the touch-down polygon.
*/
private void projectFootstepInCaptureRegion(Footstep footstep, FramePoint2d projectionPoint, FrameConvexPolygon2d captureRegion)
{
 projection.setIncludingFrame(projectionPoint);
 projection.changeFrame(footstep.getParentFrame());
 // move the position of the footstep to the capture region centroid
 nextStep2d.setIncludingFrame(captureRegion.getCentroid());
 nextStep2d.changeFrame(footstep.getParentFrame());
 // move the position as far away from the projectionPoint as possible
 direction.setIncludingFrame(nextStep2d);
 direction.sub(projection);
 direction.normalize();
 direction.scale(10.0);
 nextStep2d.add(direction);
 nextStep2d.changeFrame(captureRegion.getReferenceFrame());
 captureRegion.orthogonalProjection(nextStep2d);
 nextStep2d.changeFrame(footstep.getParentFrame());
 footstep.setPositionChangeOnlyXY(nextStep2d);
 calculateTouchdownFootPolygon(footstep, captureRegion.getReferenceFrame(), touchdownFootPolygon);
}
origin: us.ihmc/CommonWalkingControlModules

supportPolygon.orthogonalProjection(desiredCMP);
origin: us.ihmc/CommonWalkingControlModules

safeSupportPolygonToConstrainICPOffset.orthogonalProjection(desiredICPToModify);
origin: us.ihmc/CommonWalkingControlModules

projectionArea.orthogonalProjection(projectedCMP);
activeProjection.set(ProjectionMethod.ORTHOGONAL_PROJECTION);
us.ihmc.robotics.geometryFrameConvexPolygon2dorthogonalProjection

Popular methods of FrameConvexPolygon2d

  • <init>
    Creates an empty convex polygon attached to a reference frame, adds N new vertices using an array of
  • getNumberOfVertices
  • changeFrameAndProjectToXYPlane
  • getFrameVertex
  • isPointInside
    isPointInside Determines whether a point is inside the convex polygon (point in polygon test). Uses
  • getConvexPolygon2d
  • getVertex
  • intersectionWith
  • setIncludingFrameAndUpdate
    This method does: 1- clear(referenceFrame); 2- addVertices(vertices); 3- update().
  • addVertex
    Add a vertex to this polygon. Note that this method recycles memory.
  • addVertexByProjectionOntoXYPlane
    Add a vertex to this polygon after doing newVertex2d.changeFrameAndProjectToXYPlane(this.referenceFr
  • addVertices
  • addVertexByProjectionOntoXYPlane,
  • addVertices,
  • clear,
  • getCentroid,
  • getReferenceFrame,
  • isEmpty,
  • scale,
  • update,
  • addVertexAndChangeFrame

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now