Skip to content

Commit

Permalink
feat: apply feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
vishwa2710 committed Jan 6, 2025
1 parent 4e5a553 commit 63ce283
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +321,17 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Flight_Profile(pybind11::module& aMo
)

.def_static(
"local_orbital_frame",
&Profile::LocalOrbitalFrame,
"local_orbital_frame_pointing",
&Profile::LocalOrbitalFramePointing,
R"doc(
Create a nadir pointing profile.
Create a profile aligned with the provided local orbital frame type.
Args:
orbit (Orbit): The orbit.
orbital_frame_type (OrbitalFrameType): The type of the orbital frame.
Returns:
Profile: The nadir pointing profile.
Profile: The profile aligned with the local orbital frame.
)doc",
arg("orbit"),
arg("orbital_frame_type")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Flight_Profile_Model_Transform(pybin
Create a transform for inertial pointing.
Args:
trajectory (Trajectory): The trajectory to point at.
trajectory (Trajectory): The trajectory of the satellite.
quaternion (Quaternion): The quaternion to rotate the axes by.
Returns:
Expand All @@ -127,17 +127,17 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Flight_Profile_Model_Transform(pybin
)

.def_static(
"local_orbital_frame",
&Transform::LocalOrbitalFrame,
"local_orbital_frame_pointing",
&Transform::LocalOrbitalFramePointing,
R"doc(
Create a transform for nadir pointing.
Create a profile aligned with the provided local orbital frame type.
Args:
orbit (Orbit): The orbit to point at.
orbit (Orbit): The orbit of the satellite.
orbital_frame_type (OrbitalFrameType): The type of the orbital frame.
Returns:
Transform: The transform for nadir pointing.
Transform: The transform for the local orbital frame pointing.
)doc",
arg("orbit"),
arg("orbital_frame_type")
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/test/test_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def orbit(environment: Environment) -> Orbit:

@pytest.fixture
def profile(orbit: Orbit) -> Profile:
return Profile.local_orbital_frame(
return Profile.local_orbital_frame_pointing(
orbit=orbit,
orbital_frame_type=Orbit.FrameType.VVLH,
)
Expand Down
4 changes: 2 additions & 2 deletions include/OpenSpaceToolkit/Astrodynamics/Flight/Profile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@ class Profile
/// @return Flight profile
static Profile InertialPointing(const Trajectory& aTrajectory, const Quaternion& aQuaternion);

/// @brief Constructs a flight profile with nadir pointing
/// @brief Constructs a flight profile with local orbital frame pointing
///
/// @param anOrbit An orbit
/// @param anOrbitalFrameType An orbital frame type
/// @return Flight profile
static Profile LocalOrbitalFrame(
static Profile LocalOrbitalFramePointing(
const trajectory::Orbit& anOrbit, const trajectory::Orbit::FrameType& anOrbitalFrameType
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ class Transform : public virtual Model
/// @return Flight profile
static Transform InertialPointing(const Trajectory& aTrajectory, const Quaternion& aQuaternion);

/// @brief Constructs a flight profile with nadir pointing
/// @brief Constructs a flight profile with local orbital frame pointing
///
/// @param anOrbit An orbit
/// @param anOrbitalFrameType An orbital frame type
/// @return Flight profile
static Transform LocalOrbitalFrame(
static Transform LocalOrbitalFramePointing(
const trajectory::Orbit& anOrbit, const trajectory::Orbit::FrameType& anOrbitalFrameType
);

Expand Down
4 changes: 2 additions & 2 deletions src/OpenSpaceToolkit/Astrodynamics/Flight/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ Profile Profile::InertialPointing(const Trajectory& aTrajectory, const Quaternio
return {TransformModel::InertialPointing(aTrajectory, aQuaternion)};
}

Profile Profile::LocalOrbitalFrame(
Profile Profile::LocalOrbitalFramePointing(
const trajectory::Orbit& anOrbit, const trajectory::Orbit::FrameType& anOrbitalFrameType
)
{
return {TransformModel::LocalOrbitalFrame(anOrbit, anOrbitalFrameType)};
return {TransformModel::LocalOrbitalFramePointing(anOrbit, anOrbitalFrameType)};
}

Profile Profile::CustomPointing(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Transform Transform::InertialPointing(const Trajectory& aTrajectory, const Quate
return {dynamicTransformProvider, Frame::GCRF()};
}

Transform Transform::LocalOrbitalFrame(
Transform Transform::LocalOrbitalFramePointing(
const trajectory::Orbit& anOrbit, const trajectory::Orbit::FrameType& anOrbitalFrameType
)
{
Expand Down
33 changes: 18 additions & 15 deletions test/OpenSpaceToolkit/Astrodynamics/Flight/Profile.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class OpenSpaceToolkit_Astrodynamics_Flight_Profile : public ::testing::Test

this->orbit_ = {keplerianModel, environment.accessCelestialObjectWithName("Earth")};

this->profile_ = Profile::LocalOrbitalFrame(this->orbit_, Orbit::FrameType::VVLH);
this->profile_ = Profile::LocalOrbitalFramePointing(this->orbit_, Orbit::FrameType::VVLH);
}

Orbit orbit_ = Orbit::Undefined();
Expand Down Expand Up @@ -382,7 +382,7 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, InertialPointing)
}

// TBI: Should move these tests to the Transform test suite and only test interface here
TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, NadirPointing_VVLH)
TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, LocalOrbitalFramePointing_VVLH)
{
// VVLH #1

Expand Down Expand Up @@ -410,7 +410,7 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, NadirPointing_VVLH)

const Orbit orbit = {keplerianModel, environment.accessCelestialObjectWithName("Earth")};

const Profile profile = Profile::LocalOrbitalFrame(orbit, Orbit::FrameType::VVLH);
const Profile profile = Profile::LocalOrbitalFramePointing(orbit, Orbit::FrameType::VVLH);

const Real positionTolerance_m = 1e-3;
const Real velocityTolerance_meterPerSec = 1e-6;
Expand All @@ -419,9 +419,10 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, NadirPointing_VVLH)

// Reference data setup

const File referenceDataFile =
File::Path(Path::Parse("/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/LocalOrbitalFrame/VVLH/"
"Satellite_1 t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv"));
const File referenceDataFile = File::Path(
Path::Parse("/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/LocalOrbitalFramePointing/VVLH/"
"Satellite_1 t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv")
);

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

Expand Down Expand Up @@ -520,7 +521,7 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, NadirPointing_VVLH)

const Orbit orbit = {keplerianModel, environment.accessCelestialObjectWithName("Earth")};

const Profile profile = Profile::LocalOrbitalFrame(orbit, Orbit::FrameType::VVLH);
const Profile profile = Profile::LocalOrbitalFramePointing(orbit, Orbit::FrameType::VVLH);

const Real positionTolerance_m = 1e-3;
const Real velocityTolerance_meterPerSec = 1e-6;
Expand All @@ -529,9 +530,10 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, NadirPointing_VVLH)

// Reference data setup

const File referenceDataFile =
File::Path(Path::Parse("/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/LocalOrbitalFrame/VVLH/"
"Satellite_2 t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv"));
const File referenceDataFile = File::Path(
Path::Parse("/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/LocalOrbitalFramePointing/VVLH/"
"Satellite_2 t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv")
);

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

Expand Down Expand Up @@ -630,7 +632,7 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, NadirPointing_VVLH)

const Orbit orbit = {keplerianModel, environment.accessCelestialObjectWithName("Earth")};

const Profile profile = Profile::LocalOrbitalFrame(orbit, Orbit::FrameType::VVLH);
const Profile profile = Profile::LocalOrbitalFramePointing(orbit, Orbit::FrameType::VVLH);

const Real positionTolerance_m = 1e-3;
const Real velocityTolerance_meterPerSec = 1e-6;
Expand All @@ -639,9 +641,10 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, NadirPointing_VVLH)

// Reference data setup

const File referenceDataFile =
File::Path(Path::Parse("/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/LocalOrbitalFrame/VVLH/"
"Satellite_3 t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv"));
const File referenceDataFile = File::Path(
Path::Parse("/app/test/OpenSpaceToolkit/Astrodynamics/Flight/Profile/LocalOrbitalFramePointing/VVLH/"
"Satellite_3 t_UTC x_GCRF v_GCRF q_B_GCRF w_B_GCRF_in_GCRF.csv")
);

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

Expand Down Expand Up @@ -988,7 +991,7 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile, CustomPointing)

// Compare against Orbit VNC frame which has been validated

const Profile expectedProfile = Profile::LocalOrbitalFrame(orbit, Orbit::FrameType::VNC);
const Profile expectedProfile = Profile::LocalOrbitalFramePointing(orbit, Orbit::FrameType::VNC);

for (const auto instant :
Interval::Closed(epoch, epoch + Duration::Hours(1.0)).generateGrid(Duration::Minutes(5.0)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class OpenSpaceToolkit_Astrodynamics_Flight_Profile_Models_Transform : public ::

this->orbit_ = {keplerianModel, environment.accessCelestialObjectWithName("Earth")};

this->transform_ = Transform::LocalOrbitalFrame(this->orbit_, Orbit::FrameType::VVLH);
this->transform_ = Transform::LocalOrbitalFramePointing(this->orbit_, Orbit::FrameType::VVLH);
}

Orbit orbit_ = Orbit::Undefined();
Expand Down Expand Up @@ -209,9 +209,9 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile_Models_Transform, InertialP
}
}

TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile_Models_Transform, LocalOrbitalFrame)
TEST_F(OpenSpaceToolkit_Astrodynamics_Flight_Profile_Models_Transform, LocalOrbitalFramePointing)
{
{
EXPECT_TRUE(Transform::LocalOrbitalFrame(orbit_, Orbit::FrameType::VVLH).isDefined());
EXPECT_TRUE(Transform::LocalOrbitalFramePointing(orbit_, Orbit::FrameType::VVLH).isDefined());
}
}

0 comments on commit 63ce283

Please sign in to comment.