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

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

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

origin: us.ihmc/IHMCRoboticsToolkit

@Override
public void set(FrameConvexPolygon2d other)
{
 convexPolygon.set(other.convexPolygon);
 update();
}
origin: us.ihmc/CommonWalkingControlModules

  public double getCaptureRegionArea()
  {
   captureRegionPolygon.update();
   return captureRegionPolygon.getArea();
  }
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear(referenceFrame)};
* 2- {@code addVertices(vertices)};
* 3- {@code update()}.
* @param referenceFrame {@code ReferenceFrame} the new reference frame of this polygon.
* @param vertices {@code List<Point2d>} the list of points that is used to creates the vertices.
*/
public void setIncludingFrameAndUpdate(ReferenceFrame referenceFrame, List<Point2d> vertices)
{
 clear(referenceFrame);
 this.convexPolygon.addVertices(vertices, vertices.size());
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

public void setIncludingFrameAndUpdate(ReferenceFrame referenceFrame, Point2d[] vertices)
{
 clear(referenceFrame);
 this.convexPolygon.addVertices(vertices, vertices.length);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* Creates an empty convex polygon attached to a reference frame.
* @param referenceFrame {@code ReferenceFrame} reference frame to which this polygon will be attached.
*/
public FrameConvexPolygon2d(ReferenceFrame referenceFrame)
{
 super(referenceFrame, new ConvexPolygon2d());
 this.convexPolygon = this.getGeometryObject();
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

private void putYoValuesIntoFrameConvexPolygon2d()
{
 try
 {
   convexPolygon2dForReading.clear(referenceFrame);
   for (int i = 0; i < numVertices.getIntegerValue(); i++)
    convexPolygon2dForReading.addVertex(yoFramePoints.get(i).getFrameTuple2d());
   convexPolygon2dForReading.update();
 }
 catch (Exception e)
 {
   System.err.println("In YoFrameConvexPolygon2d.java: " + e.getClass().getSimpleName() + " while calling putYoValuesIntoFrameConvexPolygon2d().");
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear(referenceFrame)};
* 2- {@code addVertices(vertices)};
* 3- {@code update()}.
* @param referenceFrame {@code ReferenceFrame} the new reference frame of this polygon.
* @param vertices {@code double[>=numberOfVertices][>=2]} the array of points that is used to creates the vertices.
*/
public void setIncludingFrameAndUpdate(ReferenceFrame referenceFrame, double[][] vertices)
{
 clear(referenceFrame);
 this.convexPolygon.addVertices(vertices, vertices.length);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear(vertices.get(0).getReferenceFrame())};
* 2- {@code addVerticesByProjectionOntoXYPlane(vertices, numberOfVertices)};
* 3- {@code update()}.
* @param referenceFrame {@code ReferenceFrame} the new reference frame of this polygon.
* @param vertices {@code List<FramePoint>} the list of points that is used to creates the vertices.
* @param numberOfVertices {@code int}.
* @throws ReferenceFrameMismatchException
*/
public void setIncludingFrameByProjectionOntoXYPlaneAndUpdate(ReferenceFrame referenceFrame, List<FramePoint> vertices, int numberOfVertices)
{
 clear(referenceFrame);
 addVerticesByProjectionOntoXYPlane(vertices, numberOfVertices);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear(referenceFrame)};
* 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 referenceFrame {@code ReferenceFrame} the new reference frame of this polygon.
* @param otherPolygon {@code ConvexPolygon2d}
*/
public void setIncludingFrameAndUpdate(ReferenceFrame referenceFrame, ConvexPolygon2d otherPolygon)
{
 clear(referenceFrame);
 this.convexPolygon.addVertices(otherPolygon);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear()};
* 2- {@code addVerticesByProjectionOntoXYPlane(vertices, numberOfVertices)};
* 3- {@code update()}.
* @param vertices {@code List<FramePoint>} 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.
*/
public void setByProjectionOntoXYPlaneAndUpdate(List<FramePoint> vertices, int numberOfVertices)
{
 clear();
 addVerticesByProjectionOntoXYPlane(vertices, numberOfVertices);
 update();
}
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

  public void shrinkConstantDistanceInto(FrameConvexPolygon2d polygonQ, double distance, FrameConvexPolygon2d framePolygonToPack)
  {      
   if (Math.abs(distance) < 1.0e-10)
   {
     framePolygonToPack.setIncludingFrameAndUpdate(polygonQ);
     return;
   }
   
   framePolygonToPack.clear(polygonQ.getReferenceFrame());
   framePolygonToPack.update();
   ConvexPolygon2d polygon2dToPack = framePolygonToPack.getConvexPolygon2d();
   shrinkConstantDistanceInto(polygonQ.getConvexPolygon2dCopy(), distance, polygon2dToPack);
//      framePolygonToPack.updateFramePoints();
   framePolygonToPack.update();
  }
}
origin: us.ihmc/CommonWalkingControlModules

public void computeSupportPolygon()
{
 contactPointsPolygon.clear(planeFrame);
 for (int i = 0; i < getTotalNumberOfContactPoints(); i++)
 {
   contactPoints.get(i).getPosition(tempContactPointPosition);
   contactPointsPolygon.addVertexByProjectionOntoXYPlane(tempContactPointPosition);
 }
 contactPointsPolygon.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/CommonWalkingControlModules

private void computeFootstepCentroid(FramePoint2d centroidToPack, Footstep footstep)
{
 predictedSupportPolygon.clear(footstep.getSoleReferenceFrame());
 addPredictedContactPointsToPolygon(footstep, predictedSupportPolygon);
 predictedSupportPolygon.update();
 predictedSupportPolygon.getCentroid(centroidToPack);
}
origin: us.ihmc/CommonWalkingControlModules

private void computePredictedSupportCentroid(FramePoint2d centroidToPack, Footstep footstep, Footstep nextFootstep)
{
 predictedSupportPolygon.clear(worldFrame);
 addPredictedContactPointsToPolygon(footstep, predictedSupportPolygon);
 addPredictedContactPointsToPolygon(nextFootstep, predictedSupportPolygon);
 predictedSupportPolygon.update();
 predictedSupportPolygon.getCentroid(centroidToPack);
}
origin: us.ihmc/IHMCRoboticsToolkit

  public static boolean combineDisjointPolygons(FrameConvexPolygon2d polygon1, FrameConvexPolygon2d polygon2, FrameConvexPolygon2d combinedPolygonToPack,
     FrameLineSegment2d connectingEdge1ToPack, FrameLineSegment2d connectingEdge2ToPack)
  {
   combinedPolygonToPack.clear(polygon1.getReferenceFrame());
   combinedPolygonToPack.checkReferenceFrameMatch(connectingEdge1ToPack);
   combinedPolygonToPack.checkReferenceFrameMatch(connectingEdge2ToPack);

   boolean success = combineDisjointPolygons(polygon1.convexPolygon, polygon2.convexPolygon, combinedPolygonToPack.convexPolygon,
      connectingEdge1ToPack.lineSegment, connectingEdge2ToPack.lineSegment);

   if (!success)
     return false;

//      combinedPolygonToPack.updateFramePoints();
   combinedPolygonToPack.update();

   return true;
  }

origin: us.ihmc/CommonWalkingControlModules

  private void updateOnToesSupportPolygon(RobotSide trailingSide, FrameConvexPolygon2d leadingFootSupportPolygon)
  {
   computeToePoints(trailingSide);
   middleToePoint.changeFrame(worldFrame);

   onToesSupportPolygon.setIncludingFrameAndUpdate(leadingFootSupportPolygon);
   onToesSupportPolygon.changeFrameAndProjectToXYPlane(worldFrame);
   onToesSupportPolygon.addVertexByProjectionOntoXYPlane(middleToePoint);
   onToesSupportPolygon.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();
}
us.ihmc.robotics.geometryFrameConvexPolygon2dupdate

Javadoc

Calls ConvexPolygon2d.update() and updates the FramePoints of this FrameConvecPolygon2d.

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,
  • orthogonalProjection,
  • scale,
  • addVertexAndChangeFrame

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (Timer)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • BoxLayout (javax.swing)
  • JTextField (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • CodeWhisperer alternatives
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