Skip to content

Commit

Permalink
adapt cobconverter to new camera msg
Browse files Browse the repository at this point in the history
  • Loading branch information
tteil committed Oct 18, 2024
1 parent 1eeb1fe commit 9dc25e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void CobConverter::Reset(uint64_t CurrentSimNanos)
*/
void CobConverter::UpdateState(uint64_t CurrentSimNanos)
{
CameraConfigMsgPayload cameraSpecs = this->cameraConfigInMsg();
CameraModelMsgPayload cameraSpecs = this->cameraConfigInMsg();
OpNavCOBMsgPayload cobMsgBuffer = this->opnavCOBInMsg();
NavAttMsgPayload navAttBuffer = this->navAttInMsg();
EphemerisMsgPayload ephemBuffer = this->ephemInMsg();
Expand All @@ -83,7 +83,7 @@ void CobConverter::UpdateState(uint64_t CurrentSimNanos)
/*! - Extract rotations from relevant messages */
double CB[3][3];
double BN[3][3];
MRP2C(cameraSpecs.sigma_CB, CB);
MRP2C(cameraSpecs.bodyToCameraMrp, CB);
Eigen::Matrix3d dcm_CB = c2DArray2EigenMatrix3d(CB);
MRP2C(navAttBuffer.sigma_BN, BN);
Eigen::Matrix3d dcm_BN = c2DArray2EigenMatrix3d(BN);
Expand All @@ -92,7 +92,7 @@ void CobConverter::UpdateState(uint64_t CurrentSimNanos)

/*! - camera parameters */
double alpha = 0;
double fieldOfView = cameraSpecs.fieldOfView;
double fieldOfView = cameraSpecs.fieldOfView[0];
double resolutionX = cameraSpecs.resolution[0];
double resolutionY = cameraSpecs.resolution[1];
double pX = 2.*tan(fieldOfView/2.0);
Expand Down Expand Up @@ -234,7 +234,7 @@ void CobConverter::UpdateState(uint64_t CurrentSimNanos)
comMsgBuffer.objectPixelRadius = int(Rc);
comMsgBuffer.phaseAngle = alphaPA;
comMsgBuffer.sunDirection = phi;
comMsgBuffer.cameraID = cameraSpecs.cameraID;
comMsgBuffer.cameraID = cameraSpecs.cameraId;
comMsgBuffer.timeTag = cobMsgBuffer.timeTag;
comMsgBuffer.valid = validCOM;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "architecture/utilities/avsEigenSupport.h"
#include "architecture/messaging/messaging.h"

#include "architecture/msgPayloadDefC/CameraConfigMsgPayload.h"
#include "architecture/msgPayloadDefCpp/CameraModelMsgPayload.h"
#include "architecture/msgPayloadDefC/NavAttMsgPayload.h"
#include "architecture/msgPayloadDefC/EphemerisMsgPayload.h"
#include "architecture/msgPayloadDefCpp/OpNavCOBMsgPayload.h"
Expand All @@ -38,6 +38,7 @@
#include "architecture/utilities/linearAlgebra.h"
#include "architecture/utilities/avsEigenMRP.h"
#include "architecture/utilities/bskLogging.h"
#include "architecture/utilities/macroDefinitions.h"

enum class PhaseAngleCorrectionMethod {NoCorrection, Lambertian, Binary};

Expand Down Expand Up @@ -78,7 +79,7 @@ class CobConverter: public SysModel {
Message<OpNavCOMMsgPayload> opnavCOMOutMsg;
ReadFunctor<OpNavCOBMsgPayload> opnavCOBInMsg;
ReadFunctor<FilterMsgPayload> opnavFilterInMsg;
ReadFunctor<CameraConfigMsgPayload> cameraConfigInMsg;
ReadFunctor<CameraModelMsgPayload> cameraConfigInMsg;
ReadFunctor<NavAttMsgPayload> navAttInMsg;
ReadFunctor<EphemerisMsgPayload> ephemInMsg;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ from Basilisk.architecture.swig_common_model import *

%include "cobConverter.h"

%include "architecture/msgPayloadDefC/CameraConfigMsgPayload.h"
struct CameraConfigMsg_C;
%include "architecture/msgPayloadDefCpp/CameraModelMsgPayload.h"
%include "architecture/msgPayloadDefC/NavAttMsgPayload.h"
struct NavAttMsg_C;
%include "architecture/msgPayloadDefC/EphemerisMsgPayload.h"
struct EphemerisMsg_C;

%include "architecture/msgPayloadDefCpp/OpNavUnitVecMsgPayload.h"
%include "architecture/msgPayloadDefCpp/OpNavCOBMsgPayload.h"
Expand Down

0 comments on commit 9dc25e8

Please sign in to comment.