本文整理了Java中us.ihmc.euclid.rotationConversion.YawPitchRollConversion.convertMatrixToYawPitchRoll()
方法的一些代码示例,展示了YawPitchRollConversion.convertMatrixToYawPitchRoll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YawPitchRollConversion.convertMatrixToYawPitchRoll()
方法的具体详情如下:
包路径:us.ihmc.euclid.rotationConversion.YawPitchRollConversion
类名称:YawPitchRollConversion
方法名:convertMatrixToYawPitchRoll
暂无
代码示例来源:origin: us.ihmc/euclid-test
@Test
public void testGetRotationYawPitchRoll() throws Exception
{
Random random = new Random(564651L);
{ // Test getRotationYawPitchRoll(double[] yawPitchRollToPack)
RotationScaleMatrix rotationScaleMatrix = EuclidCoreRandomTools.nextRotationScaleMatrix(random, 10.0);
double[] yawPitchRollActual = new double[3];
rotationScaleMatrix.getRotationYawPitchRoll(yawPitchRollActual);
double[] yawPitchRollExpected = new double[3];
YawPitchRollConversion.convertMatrixToYawPitchRoll(rotationScaleMatrix.getRotationMatrix(), yawPitchRollExpected);
EuclidCoreTestTools.assertYawPitchRollEquals(yawPitchRollExpected, yawPitchRollActual, EPS);
}
{ // Test getRotationYaw(), getRotationPitch(), and getRotationRoll()
RotationScaleMatrix rotationScaleMatrix = EuclidCoreRandomTools.nextRotationScaleMatrix(random, 10.0);
double[] yawPitchRollActual = {rotationScaleMatrix.getRotationYaw(), rotationScaleMatrix.getRotationPitch(), rotationScaleMatrix.getRotationRoll()};
double[] yawPitchRollExpected = new double[3];
YawPitchRollConversion.convertMatrixToYawPitchRoll(rotationScaleMatrix.getRotationMatrix(), yawPitchRollExpected);
EuclidCoreTestTools.assertYawPitchRollEquals(yawPitchRollExpected, yawPitchRollActual, EPS);
}
}
代码示例来源:origin: us.ihmc/euclid-test
@Test
public void testGetEuler()
{
Random random = new Random(65466L);
RotationMatrix yawPitchRoll = new RotationMatrix(), expected;
Vector3D eulerAngles = new Vector3D();
Vector3D eulerAnglesCopy = new Vector3D();
for (int i = 0; i < ITERATIONS; i++)
try
{
expected = yawPitchRoll = EuclidCoreRandomTools.nextRotationMatrix(random);
yawPitchRoll.getEuler(eulerAngles);
YawPitchRollConversion.convertMatrixToYawPitchRoll(expected, eulerAnglesCopy);
EuclidCoreTestTools.assertRotationVectorGeometricallyEquals(eulerAngles, eulerAnglesCopy, EPS);
EuclidCoreTestTools.assertMatrix3DEquals(yawPitchRoll, expected, EPS);
}
catch (AssertionError e)
{
double pitch = YawPitchRollConversion.computePitch(yawPitchRoll);
if (!Double.isNaN(pitch))
throw e;
}
}
代码示例来源:origin: us.ihmc/euclid-test
YawPitchRollReadOnly convertToYawPitchRoll()
{
YawPitchRoll yawPitchRoll = new YawPitchRoll();
switch (this)
{
case MATRIX:
YawPitchRollConversion.convertMatrixToYawPitchRoll((RotationMatrixReadOnly) rotationHolder, yawPitchRoll);
break;
case AXISANGLE:
YawPitchRollConversion.convertAxisAngleToYawPitchRoll((AxisAngleReadOnly) rotationHolder, yawPitchRoll);
break;
case QUATERNION:
YawPitchRollConversion.convertQuaternionToYawPitchRoll((QuaternionReadOnly) rotationHolder, yawPitchRoll);
break;
case VECTOR:
YawPitchRollConversion.convertRotationVectorToYawPitchRoll((Vector3DReadOnly) rotationHolder, yawPitchRoll);
break;
case YAW_PITCH_ROLL:
yawPitchRoll.set((YawPitchRollReadOnly) rotationHolder);
break;
default:
throw exception(this);
}
return yawPitchRoll;
}
代码示例来源:origin: us.ihmc/euclid-test
assertEquals(roll, actualRoll, EPSILON);
YawPitchRollConversion.convertMatrixToYawPitchRoll(matrix, actualYawPitchRoll);
assertEquals(yaw, actualYawPitchRoll[0], EPSILON);
assertEquals(pitch, actualYawPitchRoll[1], EPSILON);
assertEquals(roll, actualYawPitchRoll[2], EPSILON);
YawPitchRollConversion.convertMatrixToYawPitchRoll(matrix, actualEulerAngles);
assertEquals(yaw, actualEulerAngles.getZ(), EPSILON);
assertEquals(pitch, actualEulerAngles.getY(), EPSILON);
代码示例来源:origin: us.ihmc/euclid-test
assertEquals(roll, actualRoll, EPSILON);
YawPitchRollConversion.convertMatrixToYawPitchRoll(matrix, actualYawPitchRoll);
assertEquals(yaw, actualYawPitchRoll[0], EPSILON);
assertEquals(pitch, actualYawPitchRoll[1], EPSILON);
assertEquals(roll, actualYawPitchRoll[2], EPSILON);
YawPitchRollConversion.convertMatrixToYawPitchRoll(matrix, actualEulerAngles);
assertEquals(yaw, actualEulerAngles.getZ(), EPSILON);
assertEquals(pitch, actualEulerAngles.getY(), EPSILON);
代码示例来源:origin: us.ihmc/ihmc-manipulation-planning
YawPitchRollConversion.convertMatrixToYawPitchRoll(closestTransform.getRotationMatrix(), closestYPR);
代码示例来源:origin: us.ihmc/euclid-test
YawPitchRollConversion.convertMatrixToYawPitchRoll(matrix, expectedYPR);
EuclidCoreTestTools.assertYawPitchRollEquals(expectedYPR, actualYPR, getEpsilon());
内容来源于网络,如有侵权,请联系作者删除!