Skip to content

Commit

Permalink
fix Z drift rate sign
Browse files Browse the repository at this point in the history
  • Loading branch information
n7275 committed Aug 1, 2023
1 parent 344a099 commit 308cf41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Orbitersdk/samples/ProjectApollo/src_sys/imu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,15 +458,15 @@ void IMU::Timestep(double simdt)
// convert drift rates to rotation matrices
MATRIX3 DriftXRot = getRotationMatrixX(DriftX);
MATRIX3 DriftYRot = getRotationMatrixY(DriftY);
MATRIX3 DriftZRot = getRotationMatrixZ(DriftZ);
MATRIX3 DriftZRot = getRotationMatrixZ(-DriftZ);

MATRIX3 DriftXYZRot = mul(DriftZRot, mul(DriftYRot, DriftXRot));

// Gimbals
MATRIX3 t = Orbiter.AttitudeReference;
t = mul(Orbiter.Attitude_g2v, t);
t = mul(getOrbiterLocalToNavigationBaseTransformation(), t);
t = mul(DriftXYZRot,t);
t = mul(t,DriftXYZRot);
VECTOR3 newAngles = getRotationAnglesXZY(t);

//Calculate resolver outputs before the gimbals get moved to their new position
Expand Down

0 comments on commit 308cf41

Please sign in to comment.