public interface Pose3DBasics extends Pose3DReadOnly, us.ihmc.euclid.interfaces.Transformable, us.ihmc.euclid.interfaces.Clearable
A pose 3D represents a position and orientation in 3 dimensions.
Modifier and Type | Method and Description |
---|---|
default void |
appendPitchRotation(double pitch)
Appends a rotation about the y-axis to this pose 3D.
|
default void |
appendRollRotation(double roll)
Appends a rotation about the x-axis to this pose 3D.
|
default void |
appendRotation(us.ihmc.euclid.orientation.interfaces.Orientation3DReadOnly orientation)
Appends the given orientation to this pose 3D.
|
default void |
appendTransform(us.ihmc.euclid.transform.QuaternionBasedTransform transform)
Appends the given
transform to this pose 3D. |
default void |
appendTransform(us.ihmc.euclid.transform.RigidBodyTransform transform)
Appends the given
transform to this pose 3D. |
default void |
appendTranslation(double x,
double y,
double z)
Rotates, then adds the translation (x, y, z) to this pose 3D.
|
default void |
appendTranslation(us.ihmc.euclid.tuple3D.interfaces.Tuple3DReadOnly translation)
Rotates, then adds the given
translation to this pose 3D. |
default void |
appendYawRotation(double yaw)
Appends a rotation about the z-axis to this pose 3D.
|
default void |
applyInverseTransform(us.ihmc.euclid.transform.interfaces.Transform transform)
Transforms the position and orientation parts of this pose 3D by the inverse of the given
transform . |
default void |
applyTransform(us.ihmc.euclid.transform.interfaces.Transform transform)
Transforms the position and orientation parts of this pose 3D by the given
transform . |
default boolean |
containsNaN()
Tests if this pose contains a
Double.NaN . |
us.ihmc.euclid.tuple4D.interfaces.QuaternionBasics |
getOrientation()
Gets the reference to the orientation part of this pose 3D.
|
us.ihmc.euclid.tuple3D.interfaces.Point3DBasics |
getPosition()
Gets the reference of the position part of this pose 3D.
|
default void |
interpolate(Pose3DReadOnly other,
double alpha)
Performs a linear interpolation from
this to other given the percentage
alpha . |
default void |
interpolate(Pose3DReadOnly pose1,
Pose3DReadOnly pose2,
double alpha)
Performs a linear interpolation from
pose1 to pose2 given the percentage
alpha . |
default void |
normalizeQuaternion()
Normalizes the quaternion part of this pose to ensure it is a unit-quaternion describing a proper
orientation.
|
default void |
normalizeQuaternionAndLimitToPi()
Normalizes the quaternion part of this pose and then limits the angle of the rotation it
represents to be ∈ [-pi;pi].
|
default void |
prependPitchRotation(double pitch)
Prepends a rotation about the y-axis to this pose 3D: Rotates the position part and prepends the
rotation to the orientation part.
|
default void |
prependRollRotation(double roll)
Prepends a rotation about the x-axis to this pose 3D: Rotates the position part and prepends the
rotation to the orientation part.
|
default void |
prependRotation(us.ihmc.euclid.orientation.interfaces.Orientation3DReadOnly rotation)
Rotates the position part of this pose 3D by the given
rotation and prepends it to the
orientation part. |
default void |
prependTransform(us.ihmc.euclid.transform.QuaternionBasedTransform transform)
Prepends the given transform to this pose 3D.
|
default void |
prependTransform(us.ihmc.euclid.transform.RigidBodyTransform transform)
Prepends the given transform to this pose 3D.
|
default void |
prependTranslation(double x,
double y,
double z)
Adds the translation (x, y, z) to this pose 3D assuming it is expressed in the coordinates in
which this pose is expressed.
|
default void |
prependTranslation(us.ihmc.euclid.tuple3D.interfaces.Tuple3DReadOnly translation)
Adds the given
translation to this pose 3D assuming it is expressed in the coordinates in
which this pose is expressed. |
default void |
prependYawRotation(double yaw)
Prepends a rotation about the z-axis to this pose 3D: Rotates the position part and prepends the
rotation to the orientation part.
|
default void |
set(double x,
double y,
double z,
double yaw,
double pitch,
double roll)
Sets all the components of this pose 3D.
|
default void |
set(Pose2DReadOnly pose2DReadOnly)
Sets this pose 3D to the given
pose2DReadOnly . |
default void |
set(Pose3DReadOnly other)
Sets this pose 3D to the
other pose 3D. |
default void |
set(us.ihmc.euclid.transform.QuaternionBasedTransform quaternionBasedTransform)
Sets this pose 3D to match the given quaternion-based transform.
|
default void |
set(us.ihmc.euclid.transform.RigidBodyTransform rigidBodyTransform)
Sets this pose 3D to match the given rigid-body transform.
|
default void |
set(us.ihmc.euclid.tuple3D.interfaces.Tuple3DReadOnly position,
us.ihmc.euclid.axisAngle.interfaces.AxisAngleReadOnly orientation)
Sets both position and orientation.
|
default void |
set(us.ihmc.euclid.tuple3D.interfaces.Tuple3DReadOnly position,
us.ihmc.euclid.tuple4D.interfaces.QuaternionReadOnly orientation)
Sets both position and orientation.
|
default void |
setOrientation(double qx,
double qy,
double qz,
double qs)
Sets the orientation part of this pose 3D with the 4 components of a quaternion.
|
default void |
setOrientation(Orientation2DReadOnly orientation)
Sets the orientation part of this pose 3D with the given orientation 2D.
|
default void |
setOrientation(us.ihmc.euclid.orientation.interfaces.Orientation3DReadOnly orientation)
Sets the orientation part of this pose 3D with the given orientation.
|
default void |
setOrientationYawPitchRoll(double[] yawPitchRoll)
Sets the orientation part of this pose 3D with the given yaw, pitch, and roll angles.
|
default void |
setOrientationYawPitchRoll(double yaw,
double pitch,
double roll)
Sets the orientation part of this pose 3D with the given yaw, pitch, and roll angles.
|
default void |
setPosition(double x,
double y,
double z)
Sets the position coordinates.
|
default void |
setPosition(us.ihmc.euclid.tuple2D.interfaces.Tuple2DReadOnly position2D)
Sets the x and y coordinates from the given tuple 2D, the z coordinate remains unchanged.
|
default void |
setPosition(us.ihmc.euclid.tuple2D.interfaces.Tuple2DReadOnly position2D,
double z)
Sets the position from the given tuple 2D and z coordinate.
|
default void |
setPosition(us.ihmc.euclid.tuple3D.interfaces.Tuple3DReadOnly position)
Sets the position to the given tuple.
|
default void |
setToNaN() |
default void |
setToZero()
Sets the position to (0, 0) and the orientation to the neutral quaternion, i.e.
|
default void |
setX(double x)
Sets the x-coordinate of the position.
|
default void |
setY(double y)
Sets the y-coordinate of the position.
|
default void |
setZ(double z)
Sets the z-coordinate of the position.
|
epsilonEquals, equals, geometricallyEquals, get, get, get, getOrientationDistance, getOrientationDistance, getOrientationYawPitchRoll, getPitch, getPositionDistance, getPositionDistance, getRoll, getRotationVector, getX, getY, getYaw, getZ
default void setX(double x)
x
- the x-coordinate of the position.default void setY(double y)
y
- the y-coordinate of the position.default void setZ(double z)
z
- the z-coordinate of the position.us.ihmc.euclid.tuple3D.interfaces.Point3DBasics getPosition()
getPosition
in interface Pose3DReadOnly
us.ihmc.euclid.tuple4D.interfaces.QuaternionBasics getOrientation()
getOrientation
in interface Pose3DReadOnly
default void setPosition(double x, double y, double z)
x
- the x-coordinate of the position.y
- the y-coordinate of the position.z
- the z-coordinate of the position.default void setPosition(us.ihmc.euclid.tuple3D.interfaces.Tuple3DReadOnly position)
position
- the tuple with the new position coordinates. Not modified.default void setPosition(us.ihmc.euclid.tuple2D.interfaces.Tuple2DReadOnly position2D)
The z component remains unchanged.
position2D
- the tuple with the new x and y coordinates. Not modified.default void setPosition(us.ihmc.euclid.tuple2D.interfaces.Tuple2DReadOnly position2D, double z)
position2D
- the tuple with the new x and y coordinates. Not modified.z
- the new z value for this pose's position z-coordinate.default void set(double x, double y, double z, double yaw, double pitch, double roll)
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
x
- the x-coordinate of the position.y
- the y-coordinate of the position.z
- the z-coordinate of the position.yaw
- the angle to rotate about the z-axis.pitch
- the angle to rotate about the y-axis.roll
- the angle to rotate about the x-axis.default void set(Pose2DReadOnly pose2DReadOnly)
pose2DReadOnly
.pose2DReadOnly
- the pose 2D used to set this pose 3D. Not modified.default void set(Pose3DReadOnly other)
other
pose 3D.other
- the other pose 3D. Not modified.default void setOrientation(double qx, double qy, double qz, double qs)
The quaternion is normalized internally.
qx
- the x-component of the quaternion's vector part.qy
- the y-component of the quaternion's vector part.qz
- the z-component of the quaternion's vector part.qs
- the scalar component of the quaternion.default void setOrientation(Orientation2DReadOnly orientation)
orientation
- the orientation 2D used to set this pose's orientation. Not modified.default void setOrientation(us.ihmc.euclid.orientation.interfaces.Orientation3DReadOnly orientation)
orientation
- the orientation used to set this pose's orientation. Not modified.default void setOrientationYawPitchRoll(double[] yawPitchRoll)
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
yawPitchRoll
- array containing the yaw-pitch-roll angles. Not modified.default void setOrientationYawPitchRoll(double yaw, double pitch, double roll)
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
yaw
- the angle to rotate about the z-axis.pitch
- the angle to rotate about the y-axis.roll
- the angle to rotate about the x-axis.default void set(us.ihmc.euclid.transform.RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
- the transform use to set this pose 3D. Not modified.default void set(us.ihmc.euclid.transform.QuaternionBasedTransform quaternionBasedTransform)
quaternionBasedTransform
- the transform use to set this pose 3D. Not modified.default void set(us.ihmc.euclid.tuple3D.interfaces.Tuple3DReadOnly position, us.ihmc.euclid.tuple4D.interfaces.QuaternionReadOnly orientation)
position
- the tuple with the new position coordinates. Not modified.orientation
- the quaternion with the new orientation. Not modified.default void set(us.ihmc.euclid.tuple3D.interfaces.Tuple3DReadOnly position, us.ihmc.euclid.axisAngle.interfaces.AxisAngleReadOnly orientation)
position
- the tuple with the new position coordinates. Not modified.orientation
- the axis-angle with the new orientation. Not modified.default boolean containsNaN()
Double.NaN
.containsNaN
in interface us.ihmc.euclid.interfaces.Clearable
containsNaN
in interface Pose3DReadOnly
true
if this pose contains a Double.NaN
, false
otherwise.default void setToNaN()
setToNaN
in interface us.ihmc.euclid.interfaces.Clearable
default void setToZero()
setToZero
in interface us.ihmc.euclid.interfaces.Clearable
default void normalizeQuaternion()
Edge cases:
Double.NaN
, this method is ineffective.
default void normalizeQuaternionAndLimitToPi()
Edge cases:
Double.NaN
, this method is ineffective.
default void interpolate(Pose3DReadOnly other, double alpha)
this
to other
given the percentage
alpha
.
this.position = (1.0 - alpha) * this.position + alpha * other.position
this.orientation = (1.0 - alpha) * this.orientation + alpha * other.orientation
other
- the other pose 3D used for the interpolation. Not modified.alpha
- the percentage used for the interpolation. A value of 0 will result in not modifying
this
, while a value of 1 is equivalent to setting this
to
other
.default void interpolate(Pose3DReadOnly pose1, Pose3DReadOnly pose2, double alpha)
pose1
to pose2
given the percentage
alpha
.
this.position = (1.0 - alpha) * pose1.position + alpha * pose2.position
this.orientation = (1.0 - alpha) * pose1.orientation + alpha * pose2.orientation
pose1
- the first pose 3D used in the interpolation. Not modified.pose2
- the second pose 3D used in the interpolation. Not modified.alpha
- the percentage to use for the interpolation. A value of 0 will result in setting
this
to pose1
, while a value of 1 is equivalent to setting this
to pose2
.default void prependTranslation(double x, double y, double z)
If the translation is expressed in the local coordinates described by this pose 3D, use
appendTranslation(double, double, double)
.
x
- the translation distance along the x-axis.y
- the translation distance along the y-axis.z
- the translation distance along the z-axis.default void prependTranslation(us.ihmc.euclid.tuple3D.interfaces.Tuple3DReadOnly translation)
translation
to this pose 3D assuming it is expressed in the coordinates in
which this pose is expressed.
If the translation
is expressed in the local coordinates described by this pose 3D, use
appendTranslation(Tuple3DReadOnly)
.
translation
- tuple containing the translation to apply to this pose 3D. Not modified.default void prependRotation(us.ihmc.euclid.orientation.interfaces.Orientation3DReadOnly rotation)
rotation
and prepends it to the
orientation part.rotation
- the rotation to prepend to this pose 3D. Not modified.default void prependYawRotation(double yaw)
yaw
- the angle to rotate about the z-axis.default void prependPitchRotation(double pitch)
pitch
- the angle to rotate about the y-axis.default void prependRollRotation(double roll)
roll
- the angle to rotate about the x-axis.default void prependTransform(us.ihmc.euclid.transform.RigidBodyTransform transform)
This is the same as applyTransform(Transform)
.
transform
- the transform to prepend to this pose 3D. Not modified.default void prependTransform(us.ihmc.euclid.transform.QuaternionBasedTransform transform)
This is the same as applyTransform(Transform)
.
transform
- the transform to prepend to this pose 3D. Not modified.default void appendTranslation(double x, double y, double z)
Use this method if the translation (x, y, z) is expressed in the local coordinates described by
this pose 3D. Otherwise, use prependTranslation(double, double, double)
.
x
- the translation distance along the x-axis.y
- the translation distance along the y-axis.z
- the translation distance along the z-axis.default void appendTranslation(us.ihmc.euclid.tuple3D.interfaces.Tuple3DReadOnly translation)
translation
to this pose 3D.
Use this method if the translation
is expressed in the local coordinates described by
this pose 3D. Otherwise, use prependTranslation(Tuple3DReadOnly)
.
translation
- tuple containing the translation to apply to this pose 3D. Not modified.default void appendRotation(us.ihmc.euclid.orientation.interfaces.Orientation3DReadOnly orientation)
Only the orientation part of this pose is affected by this operation, for more details see
Orientation3DBasics.append(Orientation3DReadOnly)
.
orientation
- the orientation to append to this pose 3D. Not modified.default void appendYawRotation(double yaw)
More precisely, the position part is unchanged while the orientation part is updated as
follows:
/ cos(yaw) -sin(yaw) 0 \ this.orientation = this.orientation * | sin(yaw) cos(yaw) 0 | \ 0 0 1 /
yaw
- the angle to rotate about the z-axis.default void appendPitchRotation(double pitch)
More precisely, the position part is unchanged while the orientation part is updated as
follows:
/ cos(pitch) 0 sin(pitch) \ this.orientation = this.orientation * | 0 1 0 | \ -sin(pitch) 0 cos(pitch) /
pitch
- the angle to rotate about the y-axis.default void appendRollRotation(double roll)
More precisely, the position part is unchanged while the orientation part is updated as
follows:
/ 1 0 0 \ this.orientation = this.orientation * | 0 cos(roll) -sin(roll) | \ 0 sin(roll) cos(roll) /
roll
- the angle to rotate about the x-axis.default void appendTransform(us.ihmc.euclid.transform.RigidBodyTransform transform)
transform
to this pose 3D.transform
- the rigid-body transform to append to this pose 3D. Not modified.default void appendTransform(us.ihmc.euclid.transform.QuaternionBasedTransform transform)
transform
to this pose 3D.transform
- the quaternion-based transform to append to this pose 3D. Not modified.default void applyTransform(us.ihmc.euclid.transform.interfaces.Transform transform)
transform
.applyTransform
in interface us.ihmc.euclid.interfaces.Transformable
transform
- the geometric transform to apply on this pose 3D. Not modified.default void applyInverseTransform(us.ihmc.euclid.transform.interfaces.Transform transform)
transform
.applyInverseTransform
in interface us.ihmc.euclid.interfaces.Transformable
transform
- the geometric transform to apply on this pose 3D. Not modified.