You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm having some trouble understanding the notation and sign conventions in the file gravityEffector.cpp.
In the following function:
Eigen::Vector3d GravBodyData::computeGravityInertial(Eigen::Vector3d r_I, uint64_t simTimeNanos)
{
double dt = diffNanoToSec(simTimeNanos, this->timeWritten);
Eigen::Matrix3d dcm_PfixN = c2DArray2EigenMatrix3d(this->localPlanet.J20002Pfix).transpose();
if (dcm_PfixN.isZero()) {
dcm_PfixN = Eigen::Matrix3d::Identity();
}
Eigen::Matrix3d dcm_PfixN_dot =
c2DArray2EigenMatrix3d(this->localPlanet.J20002Pfix_dot).transpose();
dcm_PfixN += dcm_PfixN_dot * dt;
// store the current planet orientation and rates
*this->J20002Pfix = dcm_PfixN;
*this->J20002Pfix_dot = dcm_PfixN_dot;
// Compute position in the body-fixed reference frame and compute the gravity
Eigen::Matrix3d dcm_NPfix = dcm_PfixN.transpose();
Eigen::Vector3d r_Pfix = dcm_NPfix * r_I;
Eigen::Vector3d grav_Pfix = this->gravityModel->computeField(r_Pfix);
return dcm_PfixN * grav_Pfix;
}
My confusion is about the handling of the DCM:
On line 4, dcm_PfixN is defined as the transpose of J20002Pfix, meaning it's actually Pfix2J2000 (from planet-fixed frame to inertial).
But then, on line 15, this->J20002Pfix is assigned the value of dcm_PfixN, which appears to contradict the naming, as it should be J20002Pfix (from inertial to Pfix), not Pfix2J2000.
So my question is:
Is there a missing transpose in the assignment to this->J20002Pfix? Or is J20002Pfix actually storing the DCM from Pfix to J2000 despite the name?
Any clarification would be greatly appreciated. Thanks for the awesome work on Basilisk!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm having some trouble understanding the notation and sign conventions in the file gravityEffector.cpp.
In the following function:
My confusion is about the handling of the DCM:
So my question is:
Any clarification would be greatly appreciated. Thanks for the awesome work on Basilisk!
Beta Was this translation helpful? Give feedback.
All reactions