From af0155d3579d5a1d9a1c4c51ada9b2c921677a4f Mon Sep 17 00:00:00 2001 From: Vishwa Shah Date: Fri, 20 Sep 2024 14:34:59 -0700 Subject: [PATCH] fix: state frame conversion in ComputeTargetDirectionVector (#438) --- src/OpenSpaceToolkit/Astrodynamics/Flight/Profile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenSpaceToolkit/Astrodynamics/Flight/Profile.cpp b/src/OpenSpaceToolkit/Astrodynamics/Flight/Profile.cpp index d358fc869..7b0587c9b 100644 --- a/src/OpenSpaceToolkit/Astrodynamics/Flight/Profile.cpp +++ b/src/OpenSpaceToolkit/Astrodynamics/Flight/Profile.cpp @@ -407,7 +407,7 @@ Vector3d Profile::ComputeTargetDirectionVector(const State& aState, const Trajec } const Vector3d targetPositionCoordinates = - aTrajectory.getStateAt(aState.accessInstant()).getPosition().accessCoordinates(); + aTrajectory.getStateAt(aState.accessInstant()).inFrame(Frame::GCRF()).getPosition().accessCoordinates(); const Vector3d satellitePositionCoordinates = aState.getPosition().accessCoordinates(); return (targetPositionCoordinates - satellitePositionCoordinates).normalized();