/** * Sets both position and orientation. * * @param position the tuple with the new position coordinates. Not modified. * @param orientation the orientation with the new angle value for this. Not modified. */ default void set(Tuple2DReadOnly position, Orientation2DReadOnly orientation) { setPosition(position); setOrientation(orientation); }
/** * Sets all the components of this pose 2D. * * @param x the x-coordinate of the position. * @param y the y-coordinate of the position. * @param yaw the orientation angle value. */ default void set(double x, double y, double yaw) { setPosition(x, y); setOrientation(yaw); }
/** * Sets this pose 2D from the given {@code position} and {@code yaw} angle. * * @param position the tuple used to initialize this pose's position. Not modified. * @param yaw the angle used to initialize the pose's orientation. */ default void set(Tuple2DReadOnly position, double yaw) { setPosition(position); setOrientation(yaw); }
/** * Sets the orientation from the given frame orientation 2D. * * @param orientation the orientation with the new angle value for this. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code orientation} are not expressed * in the same reference frame. */ default void setOrientation(FrameOrientation2DReadOnly orientation) { checkReferenceFrameMatch(orientation); Pose2DBasics.super.setOrientation(orientation); }
/** * Sets the orientation from the yaw angle of the given {@code orientation}. * * @param orientation the orientation with the new angle value for this. Not modified. * @throws ReferenceFrameMismatchException if {@code this} and {@code orientation} are not expressed * in the same reference frame. */ default void setOrientation(FrameOrientation3DReadOnly orientation) { checkReferenceFrameMatch(orientation); Pose2DBasics.super.setOrientation(orientation); }
/** * Sets this pose 2D to the given {@code pose3DReadOnly}. * * @param pose3DReadOnly the pose 3D. Not modified. */ default void set(Pose3DReadOnly pose3DReadOnly) { setPosition(pose3DReadOnly.getPosition()); setOrientation(pose3DReadOnly.getOrientation()); }
/** * Sets this pose 2D to the {@code other} pose 2D. * * @param other the other pose 2D. Not modified. */ default void set(Pose2DReadOnly other) { setPosition(other.getPosition()); setOrientation(other.getOrientation()); }
/** * Sets this pose 2D to match the given rigid-body transform. * * @param rigidBodyTransform the transform use to set this pose 2D. Not modified. * @param checkIsTransform2D indicates whether or not the method should check that the rotation part * of the given transform represents a 2D rotation in the XY-plane. * @throws NotAMatrix2DException if {@code checkIsTransform2D} is {@code true} and if the rotation * part of the transform does not represent a 2D transformation. */ default void set(RigidBodyTransform rigidBodyTransform, boolean checkIsTransform2D) { if (checkIsTransform2D) rigidBodyTransform.checkIfRotation2D(); setPosition(rigidBodyTransform.getTranslationX(), rigidBodyTransform.getTranslationY()); setOrientation(rigidBodyTransform.getRotationMatrix().getYaw()); }