congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
FrameConvexPolygon2d.getNumberOfVertices
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: us.ihmc/IHMCRoboticsToolkit

private void getYoValuesFromFrameConvexPolygon2d()
{
 numVertices.set(convexPolygon2dForWriting.getNumberOfVertices());
 try
 {
   for (int i = 0; i < numVertices.getIntegerValue(); i++)
   {
    yoFramePoints.get(i).checkReferenceFrameMatch(convexPolygon2dForWriting);
    yoFramePoints.get(i).set(convexPolygon2dForWriting.getVertex(i));
   }
 }
 catch (Exception e)
 {
   System.err.println("In YoFrameConvexPolygon2d.java: " + e.getClass().getSimpleName() + " while calling getYoValuesFromFrameConvexPolygon2d().");
   e.printStackTrace();
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

@Override
public String toString()
{
 FramePoint2d vertex = new FramePoint2d();
 String ret = "";
 for (int i = 0; i < getNumberOfVertices(); i++)
 {
   this.getFrameVertex(i, vertex);
   ret = ret + vertex.toString() + "\n";
 }
 return ret;
}
origin: us.ihmc/IHMCHumanoidRobotics

public void setSupportPolygon(RobotSide robotSide, FrameConvexPolygon2d footPolygon)
{
 int numberOfVertices = footPolygon.getNumberOfVertices();
 if (numberOfVertices > MAXIMUM_NUMBER_OF_VERTICES)
 {
   numberOfVertices = MAXIMUM_NUMBER_OF_VERTICES;
 }
 if (robotSide == RobotSide.LEFT)
 {
   leftFootSupportPolygonLength = numberOfVertices;
 }
 else
 {
   rightFootSupportPolygonLength = numberOfVertices;
 }
 for (int i = 0; i < numberOfVertices; i++)
 {
   if (robotSide == RobotSide.LEFT)
   {
    footPolygon.getVertex(i, leftFootSupportPolygonStore[i]);
   }
   else
   {
    footPolygon.getVertex(i, rightFootSupportPolygonStore[i]);
   }
 }
}
origin: us.ihmc/CommonWalkingControlModules

public void updateCMPConstraintForSingleSupport(RobotSide supportSide, ICPOptimizationSolver solver)
{
 FrameConvexPolygon2d supportPolygon = bipedSupportPolygons.getFootPolygonInSoleFrame(supportSide);
 solver.setNumberOfCMPVertices(supportPolygon.getNumberOfVertices());
 for (int i = 0; i < supportPolygon.getNumberOfVertices(); i++)
 {
   supportPolygon.getFrameVertex(i, tempVertex);
   solver.setSupportPolygonVertex(i, tempVertex, supportPolygon.getReferenceFrame(), maxCMPSingleSupportExitForward.getDoubleValue(),
      maxCMPSingleSupportExitSideways.getDoubleValue());
 }
}
origin: us.ihmc/CommonWalkingControlModules

public void updateCMPConstraintForDoubleSupport(ICPOptimizationSolver solver)
{
 int numberOfVertices = 0;
 for (RobotSide robotSide : RobotSide.values)
   numberOfVertices += bipedSupportPolygons.getFootPolygonInMidFeetZUp(robotSide).getNumberOfVertices();
 solver.setNumberOfCMPVertices(numberOfVertices);
 numberOfVertices = 0;
 for (RobotSide robotSide : RobotSide.values)
 {
   FrameConvexPolygon2d supportPolygon = bipedSupportPolygons.getFootPolygonInMidFeetZUp(robotSide);
   for (int i = 0; i < supportPolygon.getNumberOfVertices(); i++)
   {
    supportPolygon.getFrameVertex(i, tempVertex);
    solver.setSupportPolygonVertex(numberOfVertices + i, tempVertex, supportPolygon.getReferenceFrame(), maxCMPDoubleSupportExitForward.getDoubleValue(),
       maxCMPDoubleSupportExitSideways.getDoubleValue());
   }
   numberOfVertices += supportPolygon.getNumberOfVertices();
 }
}
origin: us.ihmc/CommonWalkingControlModules

public void resetFootSupportPolygon(RobotSide robotSide)
{
 YoPlaneContactState contactState = footContactStates.get(robotSide);
 List<YoContactPoint> contactPoints = contactState.getContactPoints();
 FrameConvexPolygon2d defaultSupportPolygon = defaultFootPolygons.get(robotSide);
 for (int i = 0; i < defaultSupportPolygon.getNumberOfVertices(); i++)
 {
   defaultSupportPolygon.getFrameVertexXY(i, tempPosition);
   contactPoints.get(i).setPosition(tempPosition);
 }
 contactState.notifyContactStateHasChanged();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* Adds new vertices to this polygon from another convex polygon.
* Note that this method recycles memory.
* @param otherPolygon {@code FrameConvexPolygon2d} the other convex polygon that is used to add new vertices to this polygon.
* @throws ReferenceFrameMismatchException
*/
public void addVertices(FrameConvexPolygon2d otherPolygon)
{
 referenceFrame.checkReferenceFrameMatch(otherPolygon.getReferenceFrame());
 for (int i = 0; i < otherPolygon.getNumberOfVertices(); i++)
 {
   Point2d vertex = otherPolygon.convexPolygon.getVertex(i);
   convexPolygon.addVertex(vertex);
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

private void drawPolygon(FrameConvexPolygon2d frameConvexPolygon2d, Graphics graphics)
{
 Polygon polygon = new Polygon();
 for (int i = 0; i < frameConvexPolygon2d.getNumberOfVertices(); i++)
 {
   Point2d vertex = frameConvexPolygon2d.getVertex(i);
   int xInt = doubleToInt(vertex.getX(), xCenter, scale, getWidth());
   int yInt = doubleToInt(vertex.getY(), yCenter, -scale, getHeight());
   polygon.addPoint(xInt, yInt);
 }
 graphics.drawPolygon(polygon);
}
origin: us.ihmc/IHMCAvatarInterfaces

for (int contactPointIndex = 0; contactPointIndex < footSupportPolygon.getNumberOfVertices(); contactPointIndex++)
origin: us.ihmc/IHMCRoboticsToolkit

public static void movePointInsidePolygonAlongVector(FramePoint2d pointToMove, FrameVector2d vector, FrameConvexPolygon2d polygon, double distanceToBeInside)
   if (polygon.getNumberOfVertices() < 2)
origin: us.ihmc/CommonWalkingControlModules

private void computeToePoints(RobotSide supportSide)
{
 FrameConvexPolygon2d footDefaultPolygon = footDefaultPolygons.get(supportSide);
 toePoints[0].setIncludingFrame(footDefaultPolygon.getReferenceFrame(), Double.NEGATIVE_INFINITY, 0.0, 0.0);
 toePoints[1].setIncludingFrame(footDefaultPolygon.getReferenceFrame(), Double.NEGATIVE_INFINITY, 0.0, 0.0);
 for (int i = 0; i < footDefaultPolygon.getNumberOfVertices(); i++)
 {
   footDefaultPolygon.getFrameVertex(i, footPoint);
   if (footPoint.getX() > toePoints[0].getX())
   {
    toePoints[1].set(toePoints[0]);
    toePoints[0].setXY(footPoint);
   }
   else if (footPoint.getX() > toePoints[1].getX())
   {
    toePoints[1].setXY(footPoint);
   }
 }
 middleToePoint.setToZero(footDefaultPolygon.getReferenceFrame());
 middleToePoint.interpolate(toePoints[0], toePoints[1], 0.5);
}
origin: us.ihmc/CommonWalkingControlModules

int corners = supportPolygon.getNumberOfVertices();
currentCornerIdx = (int) (timeExploring / timeToExploreCorner);
int corner = currentCornerIdx % corners;
origin: us.ihmc/IHMCHumanoidBehaviors

private void sequenceShiftWeight()
{
 FramePoint2d center = new FramePoint2d(midFeetZUpFrame);
 FrameConvexPolygon2d supportPolygon = new FrameConvexPolygon2d(yoSupportPolygon.getFrameConvexPolygon2d());
 supportPolygon.changeFrameAndProjectToXYPlane(midFeetZUpFrame);
 FrameVector2d desiredPelvisOffset = new FrameVector2d(midFeetZUpFrame);
 for (int i = 0; i < supportPolygon.getNumberOfVertices(); i++)
 {
   supportPolygon.getFrameVertex(i, desiredPelvisOffset);
   desiredPelvisOffset.sub(center);
   submitDesiredPelvisPositionOffset(false, pelvisShiftScaleFactor.getX() * desiredPelvisOffset.getX(),
      pelvisShiftScaleFactor.getY() * desiredPelvisOffset.getY(), 0.0);
 }
 // Get back to the first vertex again
 supportPolygon.getFrameVertex(0, desiredPelvisOffset);
 desiredPelvisOffset.sub(center);
 submitDesiredPelvisPositionOffset(false, pelvisShiftScaleFactor.getX() * desiredPelvisOffset.getX(),
    pelvisShiftScaleFactor.getY() * desiredPelvisOffset.getY(), 0.0);
 submitPelvisHomeCommand(false);
}
origin: us.ihmc/IHMCHumanoidBehaviors

private void sequenceMediumWarmup()
{
 FramePoint2d center = new FramePoint2d(midFeetZUpFrame);
 FrameVector2d shiftScaleVector = new FrameVector2d(midFeetZUpFrame, 0.1, 0.7);
 FrameConvexPolygon2d supportPolygon = new FrameConvexPolygon2d(yoSupportPolygon.getFrameConvexPolygon2d());
 supportPolygon.changeFrameAndProjectToXYPlane(midFeetZUpFrame);
 FrameVector2d desiredPelvisOffset = new FrameVector2d(midFeetZUpFrame);
 for (int i = 0; i < supportPolygon.getNumberOfVertices(); i++)
 {
   supportPolygon.getFrameVertex(i, desiredPelvisOffset);
   desiredPelvisOffset.sub(center);
   submitDesiredPelvisPositionOffset(false, shiftScaleVector.getX() * desiredPelvisOffset.getX(), shiftScaleVector.getY() * desiredPelvisOffset.getY(),
      0.0);
   sequenceSquats();
   sequenceChestRotations(0.55); //TODO increase/decrease limit?
   sequencePelvisRotations(0.3); //TODO increase/decrease limit?
 }
 // Get back to the first vertex again
 supportPolygon.getFrameVertex(0, desiredPelvisOffset);
 desiredPelvisOffset.sub(center);
 submitDesiredPelvisPositionOffset(false, pelvisShiftScaleFactor.getX() * desiredPelvisOffset.getX(),
    pelvisShiftScaleFactor.getY() * desiredPelvisOffset.getY(), 0.0);
 submitChestHomeCommand(false);
 submitPelvisHomeCommand(false);
}
origin: us.ihmc/CommonWalkingControlModules

for (int i = 0; i < controllerFootPolygon.getNumberOfVertices(); i++)
origin: us.ihmc/IHMCHumanoidBehaviors

int numberOfVertices = supportPolygon.getNumberOfVertices();
ArrayList<FramePoint2d> supportCornerPoints = new ArrayList<>();
origin: us.ihmc/CommonWalkingControlModules

int corners = supportPolygon.getNumberOfVertices();
currentCornerIdx = (int) (timeExploring / timeToExploreCorner);
currentCornerIdx = currentCornerIdx % corners;
origin: us.ihmc/CommonWalkingControlModules

for (int i = 0; i < projectionArea.getNumberOfVertices(); i++)
us.ihmc.robotics.geometryFrameConvexPolygon2dgetNumberOfVertices

Popular methods of FrameConvexPolygon2d

  • <init>
    Creates an empty convex polygon attached to a reference frame, adds N new vertices using an array of
  • 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
  • clear
    After calling this method, the polygon has no vertex, area, or centroid, and is attached to a new re
  • addVertices,
  • clear,
  • getCentroid,
  • getReferenceFrame,
  • isEmpty,
  • orthogonalProjection,
  • scale,
  • update,
  • addVertexAndChangeFrame

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JTable (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Best IntelliJ plugins
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