Skip to content

Commit 6a21d31

Browse files
committed
feat: add python
1 parent 16d4ed1 commit 6a21d31

File tree

3 files changed

+33
-26
lines changed

3 files changed

+33
-26
lines changed

bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Flight/Profile.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Flight_Profile(pybind11::module& aMo
5858
.value("Trajectory", Profile::TargetType::Trajectory, "Trajectory") // Deprecated in favor of TargetPosition
5959
.value("TargetPosition", Profile::TargetType::TargetPosition, "Target position")
6060
.value("TargetVelocity", Profile::TargetType::TargetVelocity, "Target velocity")
61+
.value(
62+
"TargetSlidingGroundVelocity",
63+
Profile::TargetType::TargetSlidingGroundVelocity,
64+
"Target sliding ground velocity"
65+
)
6166
.value("Sun", Profile::TargetType::Sun, "Sun")
6267
.value("Moon", Profile::TargetType::Moon, "Moon")
6368
.value("VelocityECI", Profile::TargetType::VelocityECI, "Velocity in ECI")
@@ -138,7 +143,19 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Flight_Profile(pybind11::module& aMo
138143
"target_velocity",
139144
&Profile::TrajectoryTarget::TargetVelocity,
140145
R"doc(
141-
Create a target, which produces a vector pointing along the target velocity.
146+
Create a target, which produces a vector pointing along the scan direction.
147+
When choosing this as a clocking target, the resulting profile will not be yaw compensated.
148+
)doc",
149+
arg("trajectory"),
150+
arg("axis"),
151+
arg("anti_direction") = false
152+
)
153+
.def_static(
154+
"target_sliding_ground_velocity",
155+
&Profile::TrajectoryTarget::TargetSlidingGroundVelocity,
156+
R"doc(
157+
Create a target, which produces a vector pointing along the ground velocity vector (aka the scan direction of the point sliding across the ground).
158+
When choosing this as a clocking target, the resulting profile will be yaw compensated.
142159
)doc",
143160
arg("trajectory"),
144161
arg("axis"),

include/OpenSpaceToolkit/Astrodynamics/Flight/Profile.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ class Profile
145145
const ostk::astrodynamics::Trajectory& aTrajectory, const Axis& anAxis, const bool& isAntiDirection = false
146146
);
147147

148-
/// @brief Constructs a TrajectoryTarget object of type TargetVelocity, pointing along the scan direction.
148+
/// @brief Constructs a TrajectoryTarget object of type TargetVelocity, pointing along the scan direction. When
149+
/// choosing this as a clocking target, the resulting profile will not be yaw compensated.
149150
///
150151
/// @param aTrajectory The trajectory to point towards.
151152
/// @param anAxis The axis of the target.

test/OpenSpaceToolkit/Astrodynamics/Flight/Profile.test.cpp

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,10 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, GetStatesAt)
246246
}
247247

248248
{
249-
EXPECT_ANY_THROW(
250-
Profile::Undefined().getStatesAt(
251-
{Instant::DateTime(DateTime(2018, 1, 1, 0, 0, 0), Scale::UTC),
252-
Instant::DateTime(DateTime(2018, 1, 1, 0, 0, 1), Scale::UTC)}
253-
)
254-
);
249+
EXPECT_ANY_THROW(Profile::Undefined().getStatesAt(
250+
{Instant::DateTime(DateTime(2018, 1, 1, 0, 0, 0), Scale::UTC),
251+
Instant::DateTime(DateTime(2018, 1, 1, 0, 0, 1), Scale::UTC)}
252+
));
255253
}
256254
}
257255

@@ -308,12 +306,9 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, InertialPointing)
308306

309307
// Reference data setup
310308

311-
const File referenceDataFile = File::Path(
312-
Path::Parse(
313-
"/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/InertialPointing/Satellite "
314-
"t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv"
315-
)
316-
);
309+
const File referenceDataFile =
310+
File::Path(Path::Parse("/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/InertialPointing/Satellite "
311+
"t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv"));
317312

318313
const Table referenceData = Table::Load(referenceDataFile, Table::Format::CSV, true);
319314

@@ -426,10 +421,8 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, LocalOrbitalFramePointing_
426421
// Reference data setup
427422

428423
const File referenceDataFile = File::Path(
429-
Path::Parse(
430-
"/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/LocalOrbitalFramePointing/VVLH/"
431-
"Satellite_1 t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv"
432-
)
424+
Path::Parse("/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/LocalOrbitalFramePointing/VVLH/"
425+
"Satellite_1 t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv")
433426
);
434427

435428
const Table referenceData = Table::Load(referenceDataFile, Table::Format::CSV, true);
@@ -539,10 +532,8 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, LocalOrbitalFramePointing_
539532
// Reference data setup
540533

541534
const File referenceDataFile = File::Path(
542-
Path::Parse(
543-
"/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/LocalOrbitalFramePointing/VVLH/"
544-
"Satellite_2 t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv"
545-
)
535+
Path::Parse("/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/LocalOrbitalFramePointing/VVLH/"
536+
"Satellite_2 t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv")
546537
);
547538

548539
const Table referenceData = Table::Load(referenceDataFile, Table::Format::CSV, true);
@@ -652,10 +643,8 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, LocalOrbitalFramePointing_
652643
// Reference data setup
653644

654645
const File referenceDataFile = File::Path(
655-
Path::Parse(
656-
"/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/LocalOrbitalFramePointing/VVLH/"
657-
"Satellite_3 t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv"
658-
)
646+
Path::Parse("/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/LocalOrbitalFramePointing/VVLH/"
647+
"Satellite_3 t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv")
659648
);
660649

661650
const Table referenceData = Table::Load(referenceDataFile, Table::Format::CSV, true);

0 commit comments

Comments
 (0)