本文整理了Java中us.ihmc.euclid.rotationConversion.YawPitchRollConversion.convertQuaternionToYawPitchRoll()
方法的一些代码示例,展示了YawPitchRollConversion.convertQuaternionToYawPitchRoll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YawPitchRollConversion.convertQuaternionToYawPitchRoll()
方法的具体详情如下:
包路径:us.ihmc.euclid.rotationConversion.YawPitchRollConversion
类名称:YawPitchRollConversion
方法名:convertQuaternionToYawPitchRoll
暂无
代码示例来源:origin: us.ihmc/ihmc-kalman-project
/**
* Updates the IMU given the rate gyro inputs.
*
* @param pqr Matrix Gyro Rate values in order of qd_wy, qd_wx, qd_wz???
*/
public void imuUpdate(DenseMatrix64F pqr)
{
CommonOps.subtractEquals(pqr, bias);
unpackQuaternion(q);
makeAMatrix(pqr);
propagateState(pqr);
propagateCovariance(A);
/* compute angles from quaternions */
Quaternion quaternion = new Quaternion();
quaternion.set(q);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, eulerAngles);
}
代码示例来源: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
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, actualYawPitchRoll);
EuclidCoreTestTools.assertAngleEquals(yaw, actualYawPitchRoll[0], EPSILON);
assertEquals(pitch, actualYawPitchRoll[1], EPSILON);
EuclidCoreTestTools.assertAngleEquals(roll, actualYawPitchRoll[2], EPSILON);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, actualEulerAngles);
EuclidCoreTestTools.assertAngleEquals(yaw, actualEulerAngles.getZ(), EPSILON);
assertEquals(pitch, actualEulerAngles.getY(), EPSILON);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, actualYawPitchRoll);
assertTrue(actualYawPitchRoll[0] == 0.0);
assertTrue(actualYawPitchRoll[1] == 0.0);
assertTrue(actualYawPitchRoll[2] == 0.0);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, actualEulerAngles);
EuclidCoreTestTools.assertTuple3DIsSetToZero(actualEulerAngles);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, actualYawPitchRoll);
assertTrue(Double.isNaN(actualYawPitchRoll[0]));
assertTrue(Double.isNaN(actualYawPitchRoll[1]));
assertTrue(Double.isNaN(actualYawPitchRoll[2]));
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, actualEulerAngles);
EuclidCoreTestTools.assertTuple3DContainsOnlyNaN(actualEulerAngles);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, actualYawPitchRoll);
assertTrue(Double.isNaN(actualYawPitchRoll[0]));
assertTrue(Double.isNaN(actualYawPitchRoll[1]));
assertTrue(Double.isNaN(actualYawPitchRoll[2]));
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
private void setPelvisYoVariables(RigidBodyTransform pelvisTransform)
{
Vector3D pelvisTranslation = new Vector3D();
double[] yawPitchRoll = new double[3];
pelvisTransform.getTranslation(pelvisTranslation);
Quaternion pelvisRotation = new Quaternion();
pelvisTransform.getRotation(pelvisRotation);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(pelvisRotation, yawPitchRoll);
computedPelvisPositionX.set(pelvisTranslation.getX());
computedPelvisPositionY.set(pelvisTranslation.getY());
computedPelvisPositionZ.set(pelvisTranslation.getZ());
computedPelvisYaw.set(yawPitchRoll[0]);
computedPelvisPitch.set(yawPitchRoll[1]);
computedPelvisRoll.set(yawPitchRoll[2]);
}
代码示例来源:origin: us.ihmc/euclid-test
quaternion.getYawPitchRoll(yawPitchRoll);
double[] expectedYawPitchRoll = new double[4];
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, expectedYawPitchRoll);
quaternion.getEuler(eulerAngles);
Vector3DBasics expectedEulerAngles = new Vector3D();
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, expectedEulerAngles);
EuclidCoreTestTools.assertTuple3DEquals(expectedEulerAngles, eulerAngles, getEpsilon());
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
targets[i].getRotation(targetQuat);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(targetQuat, yawPitchRoll);
target.setYawPitchRoll(yawPitchRoll);
target.setXYZ(targetTranslation.getX(), targetTranslation.getY(), targetTranslation.getZ());
代码示例来源:origin: us.ihmc/acsell
public void update()
{
read();
accel2quaternions(accel, pYawMagnet.getDoubleValue());
xsens.getQuaternion(xsensQuat);
xsensMatrix.set(xsensQuat);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(xsensQuat, yawPitchRoll);
xsens_yaw.update(yawPitchRoll[0]);
xsens_pitch.update(yawPitchRoll[1]);
xsens_roll.update(yawPitchRoll[2]);
q_calc_torso_x.set(torso_roll.getDoubleValue() - xsens_roll.getDoubleValue());
q_calc_torso_y.set(torso_pitch.getDoubleValue() - xsens_pitch.getDoubleValue());
q_calc_torso_z.set(0.0);
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
targets[i].getRotation(targetQuat);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(targetQuat, yawPitchRoll);
target.setYawPitchRoll(yawPitchRoll);
target.setXYZ(targetTranslation.getX(), targetTranslation.getY(), targetTranslation.getZ());
代码示例来源:origin: us.ihmc/euclid-test
EuclidCoreTestTools.assertAngleEquals(roll, actualRoll, epsilon);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, actualYawPitchRoll);
EuclidCoreTestTools.assertAngleEquals(yaw, actualYawPitchRoll[0], epsilon);
assertEquals(pitch, actualYawPitchRoll[1], epsilon);
EuclidCoreTestTools.assertAngleEquals(roll, actualYawPitchRoll[2], epsilon);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, actualEulerAngles);
EuclidCoreTestTools.assertAngleEquals(yaw, actualEulerAngles.getZ(), epsilon);
assertEquals(pitch, actualEulerAngles.getY(), epsilon);
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
private void computeDriftTransform()
{
RigidBodyTransform driftTransform = new RigidBodyTransform();
pelvisFrameFromMocap.update();
pelvisFrameFromRobotConfigurationDataPacket.update();
pelvisFrameFromMocap.getTransformToDesiredFrame(driftTransform, pelvisFrameFromRobotConfigurationDataPacket);
Vector3D driftTranslation = new Vector3D();
driftTransform.getTranslation(driftTranslation);
Quaternion driftRotation = new Quaternion();
driftTransform.getRotation(driftRotation);
double[] driftRotationYPR = new double[3];
YawPitchRollConversion.convertQuaternionToYawPitchRoll(driftRotation, driftRotationYPR);
mocapWorldToRobotWorldTransformX.set(driftTranslation.getX());
mocapWorldToRobotWorldTransformY.set(driftTranslation.getY());
mocapWorldToRobotWorldTransformZ.set(driftTranslation.getZ());
mocapWorldToRobotWorldTransformYaw.set(driftRotationYPR[0]);
mocapWorldToRobotWorldTransformPitch.set(driftRotationYPR[1]);
mocapWorldToRobotWorldTransformRoll.set(driftRotationYPR[2]);
}
代码示例来源:origin: us.ihmc/ihmc-manipulation-planning
randomQuat.norm();
YawPitchRollConversion.convertQuaternionToYawPitchRoll(randomQuat, randomYPR);
代码示例来源:origin: us.ihmc/ihmc-kalman-project
void doKalman(DenseMatrix64F C, DenseMatrix64F R, DenseMatrix64F error)
{
// We throw away the K result
// Kalman() wants a vector, not an object. Serialize the
// state data into this vector, then extract it out again
// once we're done with the loop.
double[][] x_vect =
{
{q.get(0, 0)}, {q.get(1, 0)}, {q.get(2, 0)}, {q.get(3, 0)}, {bias.get(0, 0)}, {bias.get(1, 0)}, {bias.get(2, 0)}
};
DenseMatrix64F X_vect = new DenseMatrix64F(x_vect);
Kalman(P, X_vect, C, R, error, K);
q.set(0, 0, X_vect.get(0, 0));
q.set(1, 0, X_vect.get(1, 0));
q.set(2, 0, X_vect.get(2, 0));
q.set(3, 0, X_vect.get(3, 0));
bias.set(0, 0, X_vect.get(4, 0));
bias.set(1, 0, X_vect.get(5, 0));
bias.set(2, 0, X_vect.get(6, 0));
normalize(q);
Quaternion quaternion = new Quaternion();
quaternion.set(q);
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, eulerAngles);
}
代码示例来源:origin: us.ihmc/euclid-test
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, expectedYPR);
EuclidCoreTestTools.assertYawPitchRollEquals(expectedYPR, actualYPR, getEpsilon());
代码示例来源:origin: us.ihmc/ihmc-kalman-project
YawPitchRollConversion.convertQuaternionToYawPitchRoll(quaternion, angles_e);
内容来源于网络,如有侵权,请联系作者删除!