-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add Orbit::generateFrameName * refactor: add minor improvements * chore: improve helpers * feat!: add Tabulated model support to flight Profile * fix: apply suggestions * fix: re-add Profile copy constructor and copy assignment operator * fix: segfault * build: update deps Co-authored-by: Lucas Brémond <lucas@loftorbital.com>
- Loading branch information
1 parent
5506b5d
commit 5a33a87
Showing
30 changed files
with
1,756 additions
and
486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Flight/Profile/Model.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
/// @project Open Space Toolkit ▸ Astrodynamics | ||
/// @file bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Flight/Profile/Model.cpp | ||
/// @author Lucas Brémond <lucas@loftorbital.com> | ||
/// @license Apache License 2.0 | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#include <OpenSpaceToolkit/Astrodynamics/Flight/Profile/Model.hpp> | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
inline void OpenSpaceToolkitAstrodynamicsPy_Flight_Profile_Model ( pybind11::module& aModule ) | ||
{ | ||
|
||
using namespace pybind11 ; | ||
|
||
using ostk::astro::flight::profile::Model ; | ||
|
||
class_<Model>(aModule, "Model") | ||
|
||
.def("__eq__", [] (const Model &self, const Model &other){ return self == other; }) | ||
.def("__ne__", [] (const Model &self, const Model &other){ return self != other; }) | ||
|
||
.def("__str__", &(shiftToString<Model>)) | ||
.def("__repr__", &(shiftToString<Model>)) | ||
|
||
.def("is_defined", &Model::isDefined) | ||
|
||
.def("calculate_state_at", &Model::calculateStateAt, arg("instant")) | ||
.def("calculate_states_at", &Model::calculateStatesAt, arg("instants")) | ||
.def("get_axes_at", &Model::getAxesAt, arg("instant")) | ||
.def("get_body_frame", &Model::getBodyFrame, arg("frame_name")) | ||
|
||
; | ||
|
||
} | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
30 changes: 30 additions & 0 deletions
30
bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Flight/Profile/Models.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
/// @project Open Space Toolkit ▸ Astrodynamics | ||
/// @file bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Flight/Profile/Models.cpp | ||
/// @author Lucas Brémond <lucas@loftorbital.com> | ||
/// @license Apache License 2.0 | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#include <OpenSpaceToolkitAstrodynamicsPy/Flight/Profile/Models/Tabulated.cpp> | ||
#include <OpenSpaceToolkitAstrodynamicsPy/Flight/Profile/Models/Transform.cpp> | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
inline void OpenSpaceToolkitAstrodynamicsPy_Flight_Profile_Models ( pybind11::module& aModule ) | ||
{ | ||
|
||
// Create "models" python submodule | ||
auto models = aModule.def_submodule("models") ; | ||
|
||
// Add __path__ attribute for "models" submodule | ||
models.attr("__path__") = "ostk.astrodynamics.flight.profile.models" ; | ||
|
||
// add objects to "models" submodule | ||
OpenSpaceToolkitAstrodynamicsPy_Flight_Profile_Models_Transform(models) ; | ||
OpenSpaceToolkitAstrodynamicsPy_Flight_Profile_Models_Tabulated(models) ; | ||
|
||
} | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
45 changes: 45 additions & 0 deletions
45
bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Flight/Profile/Models/Tabulated.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
/// @project Open Space Toolkit ▸ Astrodynamics | ||
/// @file bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Flight/Profile/Models/Tabulated.cpp | ||
/// @author Lucas Brémond <lucas@loftorbital.com> | ||
/// @license Apache License 2.0 | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#include <OpenSpaceToolkit/Astrodynamics/Flight/Profile/Models/Tabulated.hpp> | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
inline void OpenSpaceToolkitAstrodynamicsPy_Flight_Profile_Models_Tabulated ( pybind11::module& aModule ) | ||
{ | ||
|
||
using namespace pybind11 ; | ||
|
||
using ostk::core::ctnr::Array ; | ||
|
||
using ostk::astro::flight::profile::State ; | ||
using ostk::astro::flight::profile::Model ; | ||
using ostk::astro::flight::profile::models::Tabulated ; | ||
|
||
class_<Tabulated, Model>(aModule, "Tabulated") | ||
|
||
.def(init<Array<State>&>(), arg("states")) | ||
|
||
.def("__str__", &(shiftToString<State>)) | ||
.def("__repr__", &(shiftToString<State>)) | ||
|
||
.def("is_defined", &Tabulated::isDefined) | ||
|
||
.def("get_interval", &Tabulated::getInterval) | ||
.def("calculate_state_at", &Tabulated::calculateStateAt, arg("instant")) | ||
.def("get_axes_at", &Tabulated::getAxesAt, arg("instant")) | ||
.def("get_body_frame", &Tabulated::getBodyFrame, arg("frame_name")) | ||
|
||
// .def_static("load", &Tabulated::Load, arg("file")) | ||
|
||
; | ||
|
||
} | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
50 changes: 50 additions & 0 deletions
50
bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Flight/Profile/Models/Transform.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
/// @project Open Space Toolkit ▸ Astrodynamics | ||
/// @file bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Flight/Profile/Models/Transform.cpp | ||
/// @author Lucas Brémond <lucas@loftorbital.com> | ||
/// @license Apache License 2.0 | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#include <OpenSpaceToolkit/Astrodynamics/Flight/Profile/Models/Transform.hpp> | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
inline void OpenSpaceToolkitAstrodynamicsPy_Flight_Profile_Models_Transform ( pybind11::module& aModule ) | ||
{ | ||
|
||
using namespace pybind11 ; | ||
|
||
using ostk::core::types::Shared ; | ||
using ostk::core::ctnr::Array ; | ||
|
||
using ostk::physics::coord::Frame ; | ||
using DynamicProvider = ostk::physics::coord::frame::provider::Dynamic ; | ||
|
||
using ostk::astro::flight::profile::State ; | ||
using ostk::astro::flight::profile::Model ; | ||
using ostk::astro::flight::profile::models::Transform ; | ||
|
||
class_<Transform, Model>(aModule, "Transform") | ||
|
||
.def(init<const DynamicProvider&, const Shared<const Frame>&>(), arg("dynamic_provider"), arg("frame")) | ||
|
||
.def("__str__", &(shiftToString<State>)) | ||
.def("__repr__", &(shiftToString<State>)) | ||
|
||
.def("is_defined", &Transform::isDefined) | ||
|
||
.def("calculate_state_at", &Transform::calculateStateAt, arg("instant")) | ||
.def("get_axes_at", &Transform::getAxesAt, arg("instant")) | ||
.def("get_body_frame", &Transform::getBodyFrame, arg("frame_name")) | ||
|
||
.def_static("undefined", &Transform::Undefined) | ||
.def_static("inertial_pointing", &Transform::InertialPointing, arg("trajectory"), arg("quaternion")) | ||
.def_static("nadir_pointing", &Transform::NadirPointing, arg("orbit"), arg("orbital_frame_type")) | ||
|
||
; | ||
|
||
} | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.