Skip to content

Commit 0fcd2d3

Browse files
committed
Record illumination status in access messages
1 parent 03e3eb4 commit 0fcd2d3

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/architecture/msgPayloadDefC/AccessMsgPayload.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#define ACCESSSIMMSG_H
2222

2323
/*! @brief Message that defines access to spacecraft from a groundLocation, providing access, range, and elevation with
24-
* repect to a ground location.
24+
* respect to a ground location.
2525
*/
2626
typedef struct {
2727
uint64_t hasAccess;//!< [-] 1 when the writer has access to a spacecraft; 0 otherwise.
@@ -33,6 +33,7 @@ typedef struct {
3333
double az_dot; //!< [rad/s] Azimuth angle rate for a given spacecraft in the SEZ rotating frame.
3434
double r_BL_L[3]; //!<[m] Spacecraft position relative to the groundLocation in the SEZ frame.
3535
double v_BL_L[3]; //!<[m/s] SEZ relative time derivative of r_BL vector in SEZ vector components.
36+
uint64_t hasIllumination;//!< [-] 1 when illumination constraints are met; 0 otherwise.
3637
double sunIncidenceAngle; //!<[rad] Angle between bore-sight and Sun vector
3738
double scViewAngle; //!<[rad] Angle between bore-sight and deputy SC vector
3839
}AccessMsgPayload;

src/simulation/environment/spacecraftLocation/spacecraftLocation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,11 @@ SpacecraftLocation::computeAccess()
243243
}
244244
}
245245

246+
this->accessMsgBuffer.at(c).hasIllumination = 0; // default to no illumination
247+
248+
// Check illumination if sun message is present
246249
if (this->sunInMsg.isLinked()) {
250+
this->accessMsgBuffer.at(c).hasIllumination = 1;
247251
// aHat vector in inertial frame
248252
Eigen::Vector3d aHat_N = dcm_NB * this->aHat_B;
249253

@@ -262,6 +266,7 @@ SpacecraftLocation::computeAccess()
262266
if (this->theta_solar >= 0.0) {
263267
if (sunIncidenceAngle > this->theta_solar) {
264268
this->accessMsgBuffer.at(c).hasAccess = 0; // outside solar cone
269+
this->accessMsgBuffer.at(c).hasIllumination = 0;
265270
}
266271
}
267272
}

0 commit comments

Comments
 (0)