@@ -86,8 +86,8 @@ void HingedRigidBodyStateEffector::writeOutputStateMessages(uint64_t CurrentCloc
8686 SCStatesMsgPayload configLogMsg;
8787 configLogMsg = this ->hingedRigidBodyConfigLogOutMsg .zeroMsgPayload ;
8888 // Note, logging the hinge frame S is the body frame B of that object
89- eigenMatrixXd2CArray (* this ->r_SN_N , configLogMsg.r_BN_N );
90- eigenMatrixXd2CArray (* this ->v_SN_N , configLogMsg.v_BN_N );
89+ eigenVector3d2CArray ( this ->r_SN_N , configLogMsg.r_BN_N );
90+ eigenVector3d2CArray ( this ->v_SN_N , configLogMsg.v_BN_N );
9191 eigenMatrixXd2CArray (*this ->sigma_SN , configLogMsg.sigma_BN );
9292 eigenMatrixXd2CArray (*this ->omega_SN_S , configLogMsg.omega_BN_B );
9393 this ->hingedRigidBodyConfigLogOutMsg .write (&configLogMsg, this ->moduleID , CurrentClock);
@@ -156,8 +156,8 @@ void HingedRigidBodyStateEffector::registerStates(DynParamManager& states)
156156void HingedRigidBodyStateEffector::registerProperties (DynParamManager& states)
157157{
158158 Eigen::Vector3d stateInit = Eigen::Vector3d::Zero ();
159- this ->r_SN_N = states.createProperty (this ->nameOfInertialPositionProperty , stateInit);
160- this ->v_SN_N = states.createProperty (this ->nameOfInertialVelocityProperty , stateInit);
159+ this ->r_HN_N = states.createProperty (this ->nameOfInertialPositionProperty , stateInit);
160+ this ->v_HN_N = states.createProperty (this ->nameOfInertialVelocityProperty , stateInit);
161161 this ->sigma_SN = states.createProperty (this ->nameOfInertialAttitudeProperty , stateInit);
162162 this ->omega_SN_S = states.createProperty (this ->nameOfInertialAngVelocityProperty , stateInit);
163163
@@ -286,7 +286,7 @@ void HingedRigidBodyStateEffector::updateContributions(double integTime, BackSub
286286 backSubContr.vecRot = -((this ->thetaDot *this ->omegaTildeLoc_PN_P + this ->cTheta *intermediateMatrix.Identity ())
287287 *(this ->IPntS_S (1 ,1 )*this ->sHat2_P + this ->mass *this ->d *this ->rTilde_SP_P *this ->sHat3_P )
288288 + this ->mass *this ->d *this ->thetaDot *this ->thetaDot *this ->rTilde_SP_P *this ->sHat1_P )
289- + (this ->dcm_SP .transpose () * attBodyTorquePntS_S) + eigenTilde (this ->r_SP_P ) * (this ->dcm_SP .transpose () * attBodyForce_S);
289+ + (this ->dcm_SP .transpose () * attBodyTorquePntS_S) + eigenTilde (this ->r_HP_P ) * (this ->dcm_SP .transpose () * attBodyForce_S);
290290
291291 return ;
292292}
@@ -434,12 +434,17 @@ void HingedRigidBodyStateEffector::computePanelInertialStates()
434434 *this ->omega_SN_S = this ->dcm_SP * ( omega_BN_B + this ->thetaDot *this ->sHat2_P );
435435
436436 // inertial position vector
437- *this ->r_SN_N = (dcm_NP * this ->r_SP_P ) + (Eigen::Vector3d)(*this ->inertialPositionProperty );
437+ this ->r_SN_N = (dcm_NP * this ->r_SP_P ) + (Eigen::Vector3d)(*this ->inertialPositionProperty );
438+
439+ *this ->r_HN_N = (dcm_NP * this ->r_HP_P ) + (Eigen::Vector3d)(*this ->inertialPositionProperty );
438440
439441 // inertial velocity vector
440- * this ->v_SN_N = (Eigen::Vector3d)(*this ->inertialVelocityProperty )
442+ this ->v_SN_N = (Eigen::Vector3d)(*this ->inertialVelocityProperty )
441443 + this ->d * this ->thetaDot * this ->sHat3_P - this ->d * (omega_BN_B.cross (this ->sHat1_P ))
442444 + omega_BN_B.cross (this ->r_HP_P );
443445
446+ *this ->v_HN_N = (Eigen::Vector3d)(*this ->inertialVelocityProperty )
447+ + omega_BN_B.cross (this ->r_HP_P );
448+
444449 return ;
445450}
0 commit comments