/** * Sets the orientation of this shape. * <p> * This method does not affect the position of this shape. * </p> * <p> * The given {@code yaw}, {@code pitch}, and {@code roll} angles are composed into a rotation matrix * as follows: * * <pre> * / cos(yaw) -sin(yaw) 0 \ / cos(pitch) 0 sin(pitch) \ / 1 0 0 \ * R = | sin(yaw) cos(yaw) 0 | * | 0 1 0 | * | 0 cos(roll) -sin(roll) | * \ 0 0 1 / \ -sin(pitch) 0 cos(pitch) / \ 0 sin(roll) cos(roll) / * </pre> * </p> * * @param yawPitchRoll array containing the yaw-pitch-roll angles. Not modified. * @deprecated Use {@link YawPitchRoll} with {@link #setOrientation(Orientation3DReadOnly)}. */ public final void setOrientationYawPitchRoll(double[] yawPitchRoll) { shapePose.setRotationYawPitchRoll(yawPitchRoll); }
RigidBodyTransform invertTransform = new RigidBodyTransform(); transform.setRotationYawPitchRoll(0.0, Math.PI / 2.0, 0.0); invertTransform.set(transform); invertTransform.invert();
/** * Sets the orientation of this shape. * <p> * This method does not affect the position of this shape. * </p> * <p> * The given {@code yaw}, {@code pitch}, and {@code roll} angles are composed into a rotation matrix * as follows: * * <pre> * / cos(yaw) -sin(yaw) 0 \ / cos(pitch) 0 sin(pitch) \ / 1 0 0 \ * R = | sin(yaw) cos(yaw) 0 | * | 0 1 0 | * | 0 cos(roll) -sin(roll) | * \ 0 0 1 / \ -sin(pitch) 0 cos(pitch) / \ 0 sin(roll) cos(roll) / * </pre> * </p> * * @param yaw the angle to rotate about the z-axis. * @param pitch the angle to rotate about the y-axis. * @param roll the angle to rotate about the x-axis. */ public final void setOrientationYawPitchRoll(double yaw, double pitch, double roll) { shapePose.setRotationYawPitchRoll(yaw, pitch, roll); }
Vector3D expectedTranslation = new Vector3D(); actualTransform.getTranslation(expectedTranslation); actualTransform.setRotationYawPitchRoll(yawPitchRoll[0], yawPitchRoll[1], yawPitchRoll[2]); assertTrue(actualTransform.hasRotation()); assertTrue(actualTransform.hasTranslation()); EuclidCoreTestTools.assertTuple3DEquals(expectedTranslation, actualTransform.getTranslationVector(), 0.0); actualTransform.setRotationYawPitchRoll(0.0, 0.0, 0.0); assertFalse(actualTransform.hasRotation()); Vector3D expectedTranslation = new Vector3D(); actualTransform.getTranslation(expectedTranslation); actualTransform.setRotationYawPitchRoll(yawPitchRoll); assertTrue(actualTransform.hasRotation()); assertTrue(actualTransform.hasTranslation()); EuclidCoreTestTools.assertTuple3DEquals(expectedTranslation, actualTransform.getTranslationVector(), 0.0); actualTransform.setRotationYawPitchRoll(new double[3]); assertFalse(actualTransform.hasRotation());
public static RigidBodyTransform yawPitchDegreesTransform(Vector3D center, double yawCCWDegrees, double pitchDownDegrees) { RigidBodyTransform location = new RigidBodyTransform(); location.setRotationYawPitchRoll(Math.toRadians(yawCCWDegrees), Math.toRadians(pitchDownDegrees), 0.0); location.setTranslation(center); return location; }
transformToParent.setRotationYawPitchRoll(yawPitchRoll);
handTransform.setRotationYawPitchRoll(yoYawHand.getDoubleValue(), yoPitchHand.getDoubleValue(), yoRollHand.getDoubleValue());
double pitch = EuclidCoreRandomTools.nextDouble(random, Math.PI); double roll = EuclidCoreRandomTools.nextDouble(random, Math.PI); rigidBodyTransform.setRotationYawPitchRoll(yaw, pitch, roll); QuaternionBasedTransform expectedTransform = new QuaternionBasedTransform(rigidBodyTransform); actualTransform.setRotationYawPitchRoll(yaw, pitch, roll);