/** * Adds the other orientation 2D to this:<br> * {@code this += other} * <p> * Note that resulting angle is computed such that it is contained in [-<i>pi</i>, <i>pi</pi>]. * </p> * * @param other the other orientation 2D to add to this. Not modified. */ default void add(Orientation2DReadOnly other) { add(other.getYaw()); }
@Override public void applyInverseTransform(Transform transform) { pose.getOrientation().applyInverseTransform(transform); } };
@Override public void applyTransform(Transform transform) { pose.getOrientation().applyTransform(transform); }
/** * Sets this orientation 2D to the {@code other} orientation 2D. * * @param other the other orientation 2D. Not modified. */ @Override public void set(Orientation2D other) { Orientation2DBasics.super.set(other); }
/** * Performs a linear interpolation from {@code this} to {@code other} given the percentage * {@code alpha}. * <p> * this = (1.0 - alpha) * this + alpha * other * </p> * * @param other the other orientation 2D used for the interpolation. Not modified. * @param alpha the percentage used for the interpolation. A value of 0 will result in not modifying * {@code this}, while a value of 1 is equivalent to setting {@code this} to * {@code other}. */ default void interpolate(Orientation2DReadOnly other, double alpha) { interpolate(this, other, alpha); }
/** * Subtracts the other orientation 2D from this orientation 2D:<br> * {@code this -= other} * <p> * Note that resulting angle is computed such that it is contained in [-<i>pi</i>, <i>pi</pi>]. * </p> * * @param other the other orientation 2D to subtract. Not modified. */ default void sub(Orientation2DReadOnly other) { sub(other.getYaw()); }
/** * Compares {@code this} to {@code other} to determine if the two orientations are geometrically * similar, i.e. the difference in yaw of {@code this} and {@code other} is less than or equal to * {@code epsilon}. * * @param other the orientation to compare to. Not modified. * @param epsilon the tolerance of the comparison. * @return {@code true} if the two orientations represent the same geometry, {@code false} * otherwise. */ @Override public boolean geometricallyEquals(Orientation2D other, double epsilon) { return Orientation2DBasics.super.geometricallyEquals(other, epsilon); }
/** * Tests if the yaw angle of this orientation is equal to an {@code epsilon} to the yaw of * {@code other}. * <p> * Note that this method performs number comparison and not an angle comparison, such that: * -<i>pi</i> ≠ <i>pi</i>. * </p> * * @param other the query. Not modified. * @param epsilon the tolerance to use. * @return {@code true} if the two orientations are equal, {@code false} otherwise. */ @Override public boolean epsilonEquals(Orientation2D other, double epsilon) { return Orientation2DBasics.super.epsilonEquals(other, epsilon); }
/** * Sets all the components of this pose 2D to {@link Double#NaN}. */ @Override default void setToNaN() { getPosition().setToNaN(); getOrientation().setToNaN(); }
/** * Sets this orientation 2D to the {@code other} orientation 2D. * * @param other the other orientation 2D. Not modified. */ @Override public void set(Orientation2DReadOnly other) { Orientation2DBasics.super.set(other); }
/** * Performs a linear interpolation from {@code this} to {@code other} given the percentage * {@code alpha}. * <p> * this = (1.0 - alpha) * this + alpha * other * </p> * * @param other the other orientation 2D used for the interpolation. Not modified. * @param alpha the percentage used for the interpolation. A value of 0 will result in not modifying * {@code this}, while a value of 1 is equivalent to setting {@code this} to * {@code other}. * @throws ReferenceFrameMismatchException if {@code other} is not expressed in the same frame as * {@code this}. */ default void interpolate(FrameOrientation2DReadOnly other, double alpha) { checkReferenceFrameMatch(other); Orientation2DBasics.super.interpolate(other, alpha); }
/** * Subtracts the other orientation 2D to this:<br> * {@code this -= other} * <p> * Note that resulting angle is computed such that it is contained in [-<i>pi</i>, <i>pi</pi>]. * </p> * * @param other the other orientation 2D to add to this. Not modified. * @throws ReferenceFrameMismatchException if {@code other} is not expressed in the same frame as * {@code this}. */ default void sub(FrameOrientation2DReadOnly other) { checkReferenceFrameMatch(other); Orientation2DBasics.super.sub(other); }
/** * Adds the given {@code yaw} angle to the orientation of this pose 2D. * <p> * If the position part of this pose 2D is to be rotated by the given angle, use * {@link #prependRotation(double)}. * </p> * * @param yaw the angle about the z-axis to append to this pose 2D. */ default void appendRotation(double yaw) { getOrientation().add(yaw); }
/** * Sets the orientation from the yaw angle of the given quaternion. * * @param orientation the orientation with the new angle value for this. Not modified. */ default void setOrientation(Orientation3DReadOnly orientation) { getOrientation().set(orientation); }
/** * Performs a linear interpolation from {@code orientation1} to {@code orientation2} given the * percentage {@code alpha}. * <p> * this = (1.0 - alpha) * orientation1 + alpha * orientation2 * </p> * * @param orientation1 the first orientation 2D used in the interpolation. Not modified. * @param orientation2 the second orientation 2D used in the interpolation. Not modified. * @param alpha the percentage to use for the interpolation. A value of 0 will result in setting * {@code this} to {@code orientation1}, while a value of 1 is equivalent to setting * {@code this} to {@code orientation2}. * @throws ReferenceFrameMismatchException if {@code orientation1} is not expressed in the same * frame as {@code this}. */ default void interpolate(FrameOrientation2DReadOnly orientation1, Orientation2DReadOnly orientation2, double alpha) { checkReferenceFrameMatch(orientation1); Orientation2DBasics.super.interpolate(orientation1, orientation2, alpha); }
/** * Sets this orientation 2D to the difference of the two given orientation 2Ds:<br> * {@code this = orientation1 - orientation2} * <p> * Note that resulting angle is computed such that it is contained in [-<i>pi</i>, <i>pi</pi>]. * </p> * * @param orientation1 the first orientation 2D. Not modified. * @param orientation2 the second orientation 2D. Not modified. * @throws ReferenceFrameMismatchException if {@code orientation2} is not expressed in the same * frame as {@code this}. */ default void sub(Orientation2DReadOnly orientation1, FrameOrientation2DReadOnly orientation2) { checkReferenceFrameMatch(orientation2); Orientation2DBasics.super.sub(orientation1, orientation2); }
/** * Transforms the position and orientation parts of this pose 2D by the inverse of the given * {@code transform}. * * @param transform the geometric transform to apply on this pose 2D. Not modified. * @throws NotAMatrix2DException if the rotation part of {@code transform} is not a transformation * in the XY plane. */ @Override default void applyInverseTransform(Transform transform) { getPosition().applyInverseTransform(transform); getOrientation().applyInverseTransform(transform); } }
/** * Transforms the position and orientation parts of this pose 2D by the given {@code transform}. * * @param transform the geometric transform to apply on this pose 2D. Not modified. * @throws NotAMatrix2DException if the rotation part of {@code transform} is not a transformation * in the XY plane. */ @Override default void applyTransform(Transform transform) { getPosition().applyTransform(transform); getOrientation().applyTransform(transform); }