public static FrameTuple2dArrayList<FrameVector2D> createFrameVector2dArrayList(int initialSize) { return new FrameTuple2dArrayList<>(initialSize, FrameVector2D.class); } }
public void copyFromListAndTrimSize(FrameTuple2dArrayList<?> otherList) { ensureCapacity(otherList.size()); size = otherList.size; for (int i = 0; i < size; i++) { unsafeSet(i, otherList.unsafeGet(i)); } }
public void copyFromPoint2dListAndTrimSize(ReferenceFrame referenceFrame, List<? extends Tuple2DReadOnly> otherList) { for (int i = 0; i < otherList.size(); i++) { getAndGrowIfNeeded(i).setIncludingFrame(referenceFrame, otherList.get(i)); } while(size() > otherList.size()) { remove(size() - 1); } }
/** * 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(); } }
private void unsafeSet(int i, FrameTuple2DReadOnly frameTuple2d) { unsafeGet(i).setIncludingFrame(frameTuple2d); }
public void setOrCreate(int i, FrameTuple2d<?, ?> frameTuple2d) { if (i >= size) { size = i + 1; ensureCapacity(size); } unsafeGet(i).setIncludingFrame(frameTuple2d); }
public void getAllContactPoints(FrameTuple2dArrayList<FramePoint2d> contactPointListToPack) { contactPointListToPack.clear(); for (int i = 0; i < totalNumberOfContactPoints; i++) { YoContactPoint contactPoint = contactPoints.get(i); FramePoint2d contactPointLocation = contactPointListToPack.getAndGrowIfNeeded(i); contactPoint.getPosition2d(contactPointLocation); } }
public void set(int i, FrameTuple2d<?, ?> frameTuple2d) { get(i).setIncludingFrame(frameTuple2d); }
public void copyFromPoint2dListAndTrimSize(ReferenceFrame referenceFrame, List<? extends Tuple2d> otherList) { ensureCapacity(otherList.size()); size = otherList.size(); for (int i = 0; i < size; i++) { unsafeSet(i, referenceFrame, otherList.get(i)); } }
public void setOrCreate(int i, FrameTuple2DReadOnly frameTuple2d) { getAndGrowIfNeeded(i).setIncludingFrame(frameTuple2d); }
private void resetFootPlaneContactPoint(RobotSide robotSide) { ContactablePlaneBody foot = feet.get(robotSide); YoPlaneContactState footContactState = yoPlaneContactStates.get(foot); List<FramePoint2d> defaultContactPoints = foot.getContactPoints2d(); previousFootContactPoints.get(robotSide).copyFromListAndTrimSize(defaultContactPoints); footContactState.setContactFramePoints(defaultContactPoints); }
public void copyFromListAndTrimSize(List<? extends FrameTuple2DReadOnly> otherList) { for (int i = 0; i < otherList.size(); i++) { getAndGrowIfNeeded(i).setIncludingFrame(otherList.get(i)); } while(size() > otherList.size()) { remove(size() - 1); } }
private void unsafeSet(int i, ReferenceFrame referenceFrame, Tuple2DReadOnly tuple2d) { unsafeGet(i).setIncludingFrame(referenceFrame, tuple2d); }
public void set(int i, FrameTuple2DReadOnly frameTuple2d) { get(i).setIncludingFrame(frameTuple2d); }
public void copyFromListAndTrimSize(List<? extends FrameTuple2d<?, ?>> otherList) { ensureCapacity(otherList.size()); size = otherList.size(); for (int i = 0; i < size; i++) { unsafeSet(i, otherList.get(i)); } }
previousFootContactPoints.get(robotSide).copyFromListAndTrimSize(feet.get(robotSide).getContactPoints2d());
public static FrameTuple2dArrayList<FrameVector2d> createFrameVector2dArrayList(int initialSize) { return new FrameTuple2dArrayList<>(initialSize, FrameVector2d.class); } }
private void unsafeSet(int i, ReferenceFrame referenceFrame, Tuple2d tuple2d) { unsafeGet(i).setIncludingFrame(referenceFrame, tuple2d); }
/** * Adds N new vertices to this polygon using a list of {@code FramePoint2d}. * Note that this method recycles memory. * @param vertices {@code FrameTuple2dArrayList<FramePoint2d>} the list of new vertices (it is not modified). * @param numberOfVertices {@code int} that is used to determine the number of vertices to add to this polygon. Note the: {@code vertices.size()} can be greater or equal to numberOfVertices. * @throws ReferenceFrameMismatchException */ public void addVertices(FrameTuple2dArrayList<FramePoint2d> vertices, int numberOfVertices) { for (int i = 0; i < numberOfVertices; i++) { FramePoint2d vertex = vertices.get(i); addVertex(vertex); } }