public RateLimitedYoFramePoint(String namePrefix, String nameSuffix, YoVariableRegistry registry, DoubleProvider maxRate, double dt, FrameTuple3DReadOnly rawPosition) { this(namePrefix, nameSuffix, registry, maxRate, dt, rawPosition, rawPosition.getReferenceFrame()); }
public AlphaFilteredYoFrameVector(String namePrefix, String nameSuffix, YoVariableRegistry registry, DoubleProvider alpha, FrameTuple3DReadOnly unfilteredFrameTuple3D) { this(namePrefix, nameSuffix, registry, alpha, unfilteredFrameTuple3D.getReferenceFrame(), unfilteredFrameTuple3D); }
public RateLimitedYoFrameVector(String namePrefix, String nameSuffix, YoVariableRegistry registry, DoubleProvider maxRate, double dt, FrameTuple3DReadOnly rawPosition) { this(namePrefix, nameSuffix, registry, maxRate, dt, rawPosition, rawPosition.getReferenceFrame()); }
public AlphaFilteredYoFramePoint(String namePrefix, String nameSuffix, YoVariableRegistry registry, DoubleProvider alpha, FrameTuple3DReadOnly unfilteredFrameTuple3D) { this(namePrefix, nameSuffix, registry, alpha, unfilteredFrameTuple3D.getReferenceFrame(), unfilteredFrameTuple3D); }
@Override public ReferenceFrame getReferenceFrame() { return referenceTuple.getReferenceFrame(); }
/** * Tests on a per component basis, if this tuple is exactly equal to {@code other}. * <p> * If the two tuples have different frames, this method returns {@code false}. * </p> * * @param other the other tuple to compare against this. Not modified. * @return {@code true} if the two tuples are exactly equal component-wise and are expressed in the * same reference frame, {@code false} otherwise. */ default boolean equals(FrameTuple3DReadOnly other) { if (other == null || getReferenceFrame() != other.getReferenceFrame()) return false; return Tuple3DReadOnly.super.equals(other); } }
/** * Tests on a per component basis if this tuple is equal to the given {@code other} to an * {@code epsilon}. * <p> * If the two tuples have different frames, this method returns {@code false}. * </p> * * @param other the other tuple to compare against this. Not modified. * @param epsilon the tolerance to use when comparing each component. * @return {@code true} if the two tuples are equal and are expressed in the same reference frame, * {@code false} otherwise. */ default boolean epsilonEquals(FrameTuple3DReadOnly other, double epsilon) { if (getReferenceFrame() != other.getReferenceFrame()) return false; return Tuple3DReadOnly.super.epsilonEquals(other, epsilon); }
public AlphaFilteredYoFrameVector(String namePrefix, String nameSuffix, YoVariableRegistry registry, double alpha, FrameTuple3DReadOnly unfilteredFrameTuple3D) { this(namePrefix, nameSuffix, registry, AlphaFilteredYoVariable.createAlphaYoDouble(namePrefix + nameSuffix, alpha, registry), unfilteredFrameTuple3D.getReferenceFrame(), unfilteredFrameTuple3D); }
public RateLimitedYoFrameVector(String namePrefix, String nameSuffix, YoVariableRegistry registry, double maxRate, double dt, FrameTuple3DReadOnly rawPosition) { this(namePrefix, nameSuffix, registry, createMaxRateYoDouble(namePrefix, nameSuffix, maxRate, registry), dt, rawPosition, rawPosition.getReferenceFrame()); }
public AlphaFilteredYoFramePoint(String namePrefix, String nameSuffix, YoVariableRegistry registry, double alpha, FrameTuple3DReadOnly unfilteredFrameTuple3D) { this(namePrefix, nameSuffix, registry, AlphaFilteredYoVariable.createAlphaYoDouble(namePrefix + nameSuffix, alpha, registry), unfilteredFrameTuple3D.getReferenceFrame(), unfilteredFrameTuple3D); }
public RateLimitedYoFramePoint(String namePrefix, String nameSuffix, YoVariableRegistry registry, double maxRate, double dt, FrameTuple3DReadOnly rawPosition) { this(namePrefix, nameSuffix, registry, createMaxRateYoDouble(namePrefix, nameSuffix, maxRate, registry), dt, rawPosition, rawPosition.getReferenceFrame()); }
public void setIncludingFrame(FrameTuple3DReadOnly frameTuple) { multipleFramesHelper.switchCurrentReferenceFrame(frameTuple.getReferenceFrame()); set(frameTuple); }
/** * Sets this frame tuple from the reference frame, x and y components of the given * {@code frameTuple3DReadOnly}. * * @param frameTuple3DReadOnly the tuple to copy the values and reference frame from. Not modified. */ default void setIncludingFrame(FrameTuple3DReadOnly frameTuple3DReadOnly) { setReferenceFrame(frameTuple3DReadOnly.getReferenceFrame()); set((Tuple3DReadOnly) frameTuple3DReadOnly); }
/** * Sets this frame tuple to {@code other}. * * @param other the other frame tuple to copy the values and reference frame from. Not modified. */ default void setIncludingFrame(FrameTuple3DReadOnly other) { setReferenceFrame(other.getReferenceFrame()); set((Tuple3DReadOnly) other); }
public void setIncludingFrame(FrameTuple3DReadOnly frameTuple) { multipleFramesHelper.switchCurrentReferenceFrame(frameTuple.getReferenceFrame()); set(frameTuple); }
/** * Asserts on a per component basis that the two frame tuples are equal to an {@code epsilon}. * <p> * Note: the two arguments are considered to be equal if they are both equal to {@code null}. * </p> * * @param messagePrefix prefix to add to the error message. * @param expected the expected frame tuple. Not modified. * @param actual the actual frame tuple. Not modified. * @param epsilon the tolerance to use. * @param format the format to use for printing each component when an {@code AssertionError} is * thrown. * @throws AssertionError if the two frame tuples are not equal or not expressed in the reference * frame. If only one of the arguments is equal to {@code null}. */ public static void assertFrameTuple3DEquals(String messagePrefix, FrameTuple3DReadOnly expected, FrameTuple3DReadOnly actual, double epsilon, String format) { if (expected == null && actual == null) return; if (expected != null ^ actual != null) throwNotEqualAssertionError(messagePrefix, expected, actual, format); if (expected.getReferenceFrame() != actual.getReferenceFrame()) { throwNotEqualAssertionError(messagePrefix, expected, actual, format); } assertTuple3DEquals(messagePrefix, expected, actual, epsilon, format); }
/** * Sets reference frame, position, and orientation. * * @param position the tuple with the new position coordinates. Not modified. * @param orientation the new orientation. Not modified. * @throws ReferenceFrameMismatchException if {@code position} and {@code orientation} are not * expressed in the same reference frame. */ default void setIncludingFrame(FrameTuple3DReadOnly position, FrameOrientation3DReadOnly orientation) { position.checkReferenceFrameMatch(orientation); setReferenceFrame(position.getReferenceFrame()); set((Tuple3DReadOnly) position, (Orientation3DReadOnly) orientation); }
/** * Sets this frame tuple to {@code other}. * <p> * If {@code other} is expressed in the frame as {@code this}, then this method is equivalent to * {@link #set(FrameTuple3DReadOnly)}. * </p> * <p> * If {@code other} is expressed in a different frame than {@code this}, then {@code this} is set to * {@code other} once transformed to be expressed in {@code this.getReferenceFrame()}. * </p> * * @param other the other frame tuple to set this to. Not modified. */ default void setMatchingFrame(FrameTuple3DReadOnly other) { Tuple3DBasics.super.set(other); other.getReferenceFrame().transformFromThisToDesiredFrame(getReferenceFrame(), this); }
public FilteredVelocityYoFrameVector(String namePrefix, String nameSuffix, DoubleProvider alpha, double dt, YoVariableRegistry registry, FrameTuple3DReadOnly frameTuple3DToDifferentiate) { super(namePrefix, nameSuffix, frameTuple3DToDifferentiate.getReferenceFrame(), registry); this.alphaProvider = alpha; this.dt = dt; hasBeenCalled = new YoBoolean(namePrefix + nameSuffix + "HasBeenCalled", registry); currentPosition = frameTuple3DToDifferentiate; lastPosition = new YoFrameVector3D(namePrefix + "_lastPosition", nameSuffix, getReferenceFrame(), registry); reset(); }