Skip to content

Commit b75d464

Browse files
DavilaDawgandrewmorell
authored andcommitted
add notation for r vector to hinge point
1 parent e4751ba commit b75d464

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

src/simulation/dynamics/HingedRigidBodies/hingedRigidBodyStateEffector.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
156156
void 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
}

src/simulation/dynamics/HingedRigidBodies/hingedRigidBodyStateEffector.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,12 @@ class HingedRigidBodyStateEffector : public StateEffector, public SysModel {
103103
Eigen::MRPd sigma_BN{0.0, 0.0, 0.0}; //!< Hub/Inertial attitude represented by MRP
104104

105105
// Hinged rigid body properties
106-
Eigen::MatrixXd* r_SN_N; //!< [m] position vector of hinge CM S relative to inertial frame N
107-
Eigen::MatrixXd* v_SN_N; //!< [m/s] inertial velocity vector of S relative to inertial frame N
106+
Eigen::Vector3d r_SN_N; //!< [m] position vector of hinge CM S relative to inertial frame N
107+
Eigen::Vector3d v_SN_N; //!< [m/s] inertial velocity vector of S relative to inertial frame N
108+
109+
Eigen::MatrixXd* r_HN_N; //!< [m] position vector of hinge point H relative to inertial frame
110+
Eigen::MatrixXd* v_HN_N; //!< [m/s] inertial velocity vector of H relative to inertial frame
111+
108112
Eigen::MatrixXd* sigma_SN; //!< -- MRP attitude of panel frame S relative to inertial frame
109113
Eigen::MatrixXd* omega_SN_S; //!< [rad/s] inertial panel frame angular velocity vector
110114

0 commit comments

Comments
 (0)