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

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

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

origin: us.ihmc/IHMCRoboticsToolkit

public ConvexPolygon2d getConvexPolygon2d()
{
 putYoValuesIntoFrameConvexPolygon2d();
 return this.convexPolygon2dForReading.getConvexPolygon2d();
}
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/IHMCRoboticsToolkit

/**
* This function changes the polygon given, such that it has the desired number of vertices. It is conservative in
* the sense, that the modified polygon will be contained in the original polygon completely.
*
* @param polygon: modified to have the desired number of vertices
* @param desiredVertices: number of vertices that the polygon should have
*/
public static void limitVerticesConservative(FrameConvexPolygon2d polygon, int desiredVertices)
{
 limitVerticesConservative(polygon.getConvexPolygon2d(), desiredVertices);
}
origin: us.ihmc/IHMCRoboticsToolkit

public static int cutPolygonWithLine(FrameLine2d cuttingLine, FrameConvexPolygon2d polygonToCut, RobotSide sideOfLineToCut)
{
 cuttingLine.checkReferenceFrameMatch(polygonToCut);
 return cutPolygonWithLine(cuttingLine.getLine2d(), polygonToCut.getConvexPolygon2d(), sideOfLineToCut);
}
origin: us.ihmc/IHMCRoboticsToolkit

public void intersectWithLine(FrameConvexPolygon2d frameConvexPolygon2d, FrameLine2d frameLine2d)
{
 checkAndSetFrames(frameConvexPolygon2d, frameLine2d);
 int intersectionTypeInt = ConvexPolygon2dCalculator.intersectionWithLine(frameLine2d.getLine2d(), intersectionPointOne.getPoint(),
                                      intersectionPointTwo.getPoint(), frameConvexPolygon2d.getConvexPolygon2d());
 packIntersectionType(intersectionTypeInt);
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* There is actually no ray class at the moment, so we use a FrameLine2d.
*
* TODO: Make ray classes and use them. @dcalvert
*/
public void intersectWithRay(FrameConvexPolygon2d frameConvexPolygon2d, FrameLine2d frameRay2d)
{
 checkAndSetFrames(frameConvexPolygon2d, frameRay2d);
 int intersectionTypeInt = ConvexPolygon2dCalculator.intersectionWithRay(frameRay2d.getLine2d(), intersectionPointOne.getPoint(),
                                      intersectionPointTwo.getPoint(), frameConvexPolygon2d.getConvexPolygon2d());
 packIntersectionType(intersectionTypeInt);
}
origin: us.ihmc/CommonWalkingControlModules

public void setNextFootstep(Footstep nextFootstep)
{
 isUsingNextFootstep.set(nextFootstep != null);
 if (isUsingNextFootstep.getBooleanValue())
 {
   ReferenceFrame footstepSoleFrame = nextFootstep.getSoleReferenceFrame();
   ConvexPolygon2d footPolygon = footPolygons.get(nextFootstep.getRobotSide()).getConvexPolygon2d();
   nextFootstepPolygon.setIncludingFrameAndUpdate(footstepSoleFrame, footPolygon);
   nextFootstepPolygon.changeFrameAndProjectToXYPlane(worldFrame);
 }
}
origin: us.ihmc/CommonWalkingControlModules

public FootstepAdjustor(SideDependentList<? extends ContactablePlaneBody> contactableFeet, YoVariableRegistry parentRegistry,
   YoGraphicsListRegistry yoGraphicsListRegistry)
{
 parentRegistry.addChild(registry);
 if (yoGraphicsListRegistry != null && VISUALIZE)
 {
   footstepAdjusterVisualizer = new FootstepAdjusterVisualizer(this, yoGraphicsListRegistry, registry);
 }
 defaultSupportPolygons = new SideDependentList<>();
 for (RobotSide robotSide : RobotSide.values)
 {
   defaultSupportPolygons.put(robotSide, new FrameConvexPolygon2d(contactableFeet.get(robotSide).getContactPoints2d()).getConvexPolygon2d());
 }
}
origin: us.ihmc/CommonWalkingControlModules

/**
* This function is called at beginning of every DoubleSupport, not frequent enough to preallocate eveything. 
*/
public void updatePointAndPolygon(FrameConvexPolygon2d polygon, Point2d pointInPolygonFrame)
{
 //copy external point back to polygon frame
 framePoint2d = new FramePoint2d(polygon.getReferenceFrame(), pointInPolygonFrame);
 //update polygon class
 point2dInConvexPolygon2d = new Point2dInConvexPolygon2d(polygon.getConvexPolygon2d(), framePoint2d.getX(), framePoint2d.getY());
 angle.set(point2dInConvexPolygon2d.getAngle());
 eccentricity.set(point2dInConvexPolygon2d.getEccentricity());
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* All math in polygon frame.
*/
public boolean checkIfIntersectionExists(FrameSphere3d sphere, FrameConvexPolygon2d polygon)
{
 ReferenceFrame originalSphereFrame = sphere.getReferenceFrame();
 sphere.changeFrame(polygon.getReferenceFrame());
 
 sphere.getCenter(closestPointOnPolygon);
 closestPointOnPolygon2d.setByProjectionOntoXYPlaneIncludingFrame(closestPointOnPolygon);
 
 Point2d pointUnsafe = closestPointOnPolygon2d.getPoint();
 ConvexPolygon2dCalculator.orthogonalProjection(pointUnsafe, polygon.getConvexPolygon2d());
 closestPointOnPolygon2d.set(pointUnsafe.getX(), pointUnsafe.getY());
 
 closestPointOnPolygon.setXY(closestPointOnPolygon2d);
 
 boolean isInsideOrOnSurface = sphere.getSphere3d().isInsideOrOnSurface(closestPointOnPolygon.getPoint());
 
 closestPointOnPolygon.changeFrame(ReferenceFrame.getWorldFrame());
 sphere.changeFrame(originalSphereFrame);
 
 return isInsideOrOnSurface;
}
origin: us.ihmc/CommonWalkingControlModules

defaultFootPolygons.put(robotSide, defaultFootPolygon.getConvexPolygon2d());
origin: us.ihmc/CommonWalkingControlModules

tempPolygon2.setIncludingFrameAndUpdate(nextFootstep.getSoleReferenceFrame(), tempPolygon1.getConvexPolygon2d());
tempPolygon2.changeFrameAndProjectToXYPlane(safeArea.getReferenceFrame());
polygonShrinker.shrinkConstantDistanceInto(tempPolygon2, -distanceToExtendUpcomingFoothold.getDoubleValue(), tempPolygon1);
origin: us.ihmc/CommonWalkingControlModules

ConvexPolygon2d footPolygon = footDefaultPolygons.get(nextFootstep.getRobotSide()).getConvexPolygon2d();
nextFootstepPolygon.setIncludingFrameAndUpdate(footstepSoleFrame, footPolygon);
origin: us.ihmc/IHMCFootstepPlanning

RigidBodyTransform snapTransform = PlanarRegionsListPolygonSnapper.snapPolygonToPlanarRegionsList(footPolygon.getConvexPolygon2d(), planarRegionsList,
   regionToMoveTo);
if (snapTransform == null)
us.ihmc.robotics.geometryFrameConvexPolygon2dgetConvexPolygon2d

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
  • 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

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top PhpStorm 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