@@ -180,11 +180,19 @@ void ThrusterDynamicEffector::ConfigureThrustRequests(double currentTime)
180
180
void ThrusterDynamicEffector::UpdateThrusterProperties ()
181
181
{
182
182
// Save hub variables
183
- Eigen::Vector3d r_BN_N = (Eigen::Vector3d)*this ->inertialPositionProperty ;
184
- Eigen::Vector3d omega_BN_B = this ->hubOmega ->getState ();
185
183
Eigen::MRPd sigma_BN;
186
- sigma_BN = (Eigen::Vector3d)this ->hubSigma ->getState ();
184
+ Eigen::Vector3d omega_BN_B;
185
+ if (!this ->stateNameOfSigma .empty ()) {
186
+ omega_BN_B = this ->hubOmega ->getState ();
187
+ sigma_BN = (Eigen::Vector3d)this ->hubSigma ->getState ();
188
+ }
189
+ else {
190
+ omega_BN_B = *this ->inertialAngVelocityProperty ;
191
+ sigma_BN = (Eigen::Vector3d)*this ->inertialAttitudeProperty ;
192
+ }
193
+
187
194
Eigen::Matrix3d dcm_BN = (sigma_BN.toRotationMatrix ()).transpose ();
195
+ Eigen::Vector3d r_BN_N = (Eigen::Vector3d)*this ->inertialPositionProperty ;
188
196
189
197
// Define the variables related to which body the thruster is attached to. The F frame represents the platform body where the thruster attaches to
190
198
Eigen::MRPd sigma_FN;
@@ -242,6 +250,16 @@ void ThrusterDynamicEffector::linkInStates(DynParamManager& states){
242
250
}
243
251
}
244
252
253
+ /* ! This method is used to link properties to the thrusters
254
+ @return void
255
+ @param properties The parameter manager to collect from
256
+ */
257
+ void ThrusterDynamicEffector::linkInProperties (DynParamManager& properties){
258
+ this ->inertialAttitudeProperty = properties.getPropertyReference (this ->propName_inertialAttitude );
259
+ this ->inertialAngVelocityProperty = properties.getPropertyReference (this ->propName_inertialAngVelocity );
260
+ this ->inertialPositionProperty = properties.getPropertyReference (this ->propName_inertialPosition );
261
+ }
262
+
245
263
/* ! This method computes the Forces on Torque on the Spacecraft Body.
246
264
247
265
@param integTime Integration time
@@ -250,7 +268,13 @@ void ThrusterDynamicEffector::linkInStates(DynParamManager& states){
250
268
void ThrusterDynamicEffector::computeForceTorque (double integTime, double timeStep)
251
269
{
252
270
// Save omega_BN_B
253
- Eigen::Vector3d omegaLocal_BN_B = this ->hubOmega ->getState ();
271
+ Eigen::Vector3d omegaLocal_BN_B;
272
+ if (!this ->stateNameOfSigma .empty ()) {
273
+ omegaLocal_BN_B = this ->hubOmega ->getState ();
274
+ }
275
+ else {
276
+ omegaLocal_BN_B = *this ->inertialAngVelocityProperty ;
277
+ }
254
278
255
279
// Force and torque variables
256
280
Eigen::Vector3d SingleThrusterForce;
0 commit comments