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

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

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

origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear()};
* 2- {@code addVertices(vertices, numberOfVertices)};
* 3- {@code update()}.
* @param vertices {@code List<FramePoint2d>} the list of points that is used to creates the vertices.
* @param numberOfVertices {@code int} that is used to determine the number of vertices of the polygon. Note the: {@code vertices.size()} can be greater or equal to numberOfVertices.
* @throws ReferenceFrameMismatchException
*/
public void setAndUpdate(List<FramePoint2d> vertices, int numberOfVertices)
{
 clear();
 addVertices(vertices, numberOfVertices);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear()};
* 2- {@code addVertices(otherPolygon)};
* 3- {@code update()}.
* <p/> TODO There is no need to call update() there, instead update everything from the other polygon to make it faster.<p/>
* @param otherPolygon {@code FrameConvexPolygon2d}
* @throws ReferenceFrameMismatchException
*/
public void setAndUpdate(ConvexPolygon2d otherPolygon)
{
 clear();
 addVertices(otherPolygon);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear(otherPolygon.getReferenceFrame())};
* 2- {@code addVertices(otherPolygon)};
* 3- {@code update()}.
* <p/> TODO There is no need to call update() there, instead update everything from the other polygon to make it faster.<p/>
* @param otherPolygon {@code FrameConvexPolygon2d}
*/
public void setIncludingFrameAndUpdate(FrameConvexPolygon2d otherPolygon)
{
 clear(otherPolygon.getReferenceFrame());
 addVertices(otherPolygon);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear()};
* 2- {@code addVertices(firstPolygon)};
* 2- {@code addVertices(secondPolygon)};
* 3- {@code update()}.
* <p/> TODO: Make this more efficient by finding the rotating calipers, as in the intersection method.<p/>
* @param firstPolygon {@code FrameConvexPolygon2d}
* @param secondPolygon {@code FrameConvexPolygon2d}
* @throws ReferenceFrameMismatchException
*/
public void setAndUpdate(FrameConvexPolygon2d firstPolygon, FrameConvexPolygon2d secondPolygon)
{
 referenceFrame.checkReferenceFrameMatch(firstPolygon.getReferenceFrame());
 referenceFrame.checkReferenceFrameMatch(secondPolygon.getReferenceFrame());
 clear();
 addVertices(firstPolygon);
 addVertices(secondPolygon);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* If the list of vertices is empty, this polygon will be empty and its reference frame won't be changed.
* If the list of vertices is not empty, this method does:
* 1- {@code clear(vertices.get(0).getReferenceFrame())};
* 2- {@code addVertices(vertices)};
* 3- {@code update()}.
* @param referenceFrame {@code ReferenceFrame} the new reference frame of this polygon.
* @param vertices {@code List<FramePoint2d>} the list of points that is used to creates the vertices.
* @throws ReferenceFrameMismatchException
*/
public void setIncludingFrameAndUpdate(List<FramePoint2d> vertices)
{
 int numberOfVertices = vertices.size();
 if (numberOfVertices < 1 )
 {
   clear();
   update();
 }
 else
 {
   clear(vertices.get(0).getReferenceFrame());
   addVertices(vertices, numberOfVertices);
   update();
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear()};
* 2- {@code addVertices(otherPolygon)};
* 3- {@code update()}.
* <p/> TODO There is no need to call update() there, instead update everything from the other polygon to make it faster.<p/>
* @param otherPolygon {@code FrameConvexPolygon2d}
* @throws ReferenceFrameMismatchException
*/
public void setAndUpdate(FrameConvexPolygon2d otherPolygon)
{
 referenceFrame.checkReferenceFrameMatch(otherPolygon.getReferenceFrame());
 clear();
 addVertices(otherPolygon);
 update();
}
origin: us.ihmc/CommonWalkingControlModules

private void fitLine()
{
 if (!footCoPOccupancyGrid.fitLineToData(line))
   return;
 lineL.setIncludingFrame(line);
 lineL.shiftToLeft(width/2.0);
 lineR.setIncludingFrame(line);
 lineR.shiftToRight(width/2.0);
 backupFootPolygon.set(shrunkFootPolygon);
 shrunkFootPolygon.clear();
 shrunkFootPolygon.addVertices(defaultFootPolygon.intersectionWith(lineL));
 shrunkFootPolygon.addVertices(defaultFootPolygon.intersectionWith(lineR));
 shrunkFootPolygon.update();
}
origin: us.ihmc/CommonWalkingControlModules

private void computeFinalCMPBetweenSupportFeet(int cmpIndex, FrameConvexPolygon2d footA, FrameConvexPolygon2d footB)
{
 footA.getCentroid(tempCentroid);
 firstCMP.setXYIncludingFrame(tempCentroid);
 firstCMP.changeFrame(worldFrame);
 footB.getCentroid(tempCentroid);
 secondCMP.setXYIncludingFrame(tempCentroid);
 secondCMP.changeFrame(worldFrame);
 upcomingSupport.clear(worldFrame);
 tempFootPolygon.setIncludingFrame(footA);
 tempFootPolygon.changeFrameAndProjectToXYPlane(worldFrame);
 upcomingSupport.addVertices(tempFootPolygon);
 tempFootPolygon.setIncludingFrame(footB);
 tempFootPolygon.changeFrameAndProjectToXYPlane(worldFrame);
 upcomingSupport.addVertices(tempFootPolygon);
 upcomingSupport.update();
 entryCMPs.get(cmpIndex).switchCurrentReferenceFrame(worldFrame);
 exitCMPs.get(cmpIndex).switchCurrentReferenceFrame(worldFrame);
 upcomingSupport.getCentroid(tempCentroid);
 tempCentroid3d.setXYIncludingFrame(tempCentroid);
 double chicken = MathTools.clipToMinMax(percentageChickenSupport.getDoubleValue(), 0.0, 1.0);
 if (chicken <= 0.5)
   entryCMPs.get(cmpIndex).interpolate(firstCMP, tempCentroid3d, chicken * 2.0);
 else
   entryCMPs.get(cmpIndex).interpolate(tempCentroid3d, secondCMP, (chicken-0.5) * 2.0);
 exitCMPs.get(cmpIndex).set(entryCMPs.get(cmpIndex));
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* If the list of vertices is empty, this polygon will be empty and its reference frame won't be changed.
* If the list of vertices is not empty, this method does:
* 1- {@code clear(vertices.get(0).getReferenceFrame())};
* 2- {@code addVertices(vertices)};
* 3- {@code update()}.
* @param referenceFrame {@code ReferenceFrame} the new reference frame of this polygon.
* @param vertices {@code FrameTuple2dArrayList<FramePoint2d>} the list of points that is used to creates the vertices.
* @throws ReferenceFrameMismatchException
*/
public void setIncludingFrameAndUpdate(FrameTuple2dArrayList<FramePoint2d> vertices)
{
 int numberOfVertices = vertices.size();
 if (numberOfVertices < 1 )
 {
   clear();
   update();
 }
 else
 {
   clear(vertices.get(0).getReferenceFrame());
   addVertices(vertices, numberOfVertices);
   update();
 }
}
origin: us.ihmc/CommonWalkingControlModules

fullSupportAfterShrinking.setIncludingFrameAndUpdate(oppositeFootPolygon);
fullSupportAfterShrinking.changeFrameAndProjectToXYPlane(worldFrame);
fullSupportAfterShrinking.addVertices(controllerFootPolygonInWorld);
fullSupportAfterShrinking.update();
momentumBasedController.getCapturePoint(capturePoint);
origin: us.ihmc/CommonWalkingControlModules

tempPolygon2.changeFrameAndProjectToXYPlane(safeArea.getReferenceFrame());
polygonShrinker.shrinkConstantDistanceInto(tempPolygon2, -distanceToExtendUpcomingFoothold.getDoubleValue(), tempPolygon1);
safeArea.addVertices(tempPolygon1);
safeArea.update();
us.ihmc.robotics.geometryFrameConvexPolygon2daddVertices

Javadoc

Adds N new vertices to this polygon using a list of FramePoint2d. Note that this method recycles memory.

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
  • clear
    After calling this method, the polygon has no vertex, area, or centroid, and is attached to a new re
  • addVertexByProjectionOntoXYPlane,
  • clear,
  • getCentroid,
  • getReferenceFrame,
  • isEmpty,
  • orthogonalProjection,
  • scale,
  • update,
  • addVertexAndChangeFrame

Popular in Java

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
  • setScale (BigDecimal)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • 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