Skip to content

Commit

Permalink
feat: add backward propagation get pass with rev number (#410)
Browse files Browse the repository at this point in the history
* feat: add reverse proapgation for orbit.getPassWithNumber

* feat: ensure it works with a seeded pass

* refactor: simplify forward backward propagation

* feat: address remaining feedback

* feat: simplify further

* feat: cleanup

* feat: python bindings

* chore: fix pass test

* Apply suggestions from code review

Co-authored-by: kyle-cochran <kyle.ray.cochran@gmail.com>

* feat: address comments

---------

Co-authored-by: kyle-cochran <kyle.ray.cochran@gmail.com>
  • Loading branch information
vishwa2710 and kyle-cochran authored Jun 13, 2024
1 parent 8986e16 commit 33fabf4
Show file tree
Hide file tree
Showing 7 changed files with 494 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,28 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Trajectory_Orbit_Pass(pybind11::modu
)doc"
)
.def(
"get_start_instant",
&Pass::getStartInstant,
R"doc(
Get the start instant of the pass. For partial passes, this is the minimum defined instant.
Returns:
Instant: The start instant of the pass.
)doc"
)
.def(
"get_end_instant",
&Pass::getEndInstant,
R"doc(
Get the end instant of the pass. For partial passes, this is the maximum defined instant.
Returns:
Instant: The end instant of the pass.
)doc"
)
.def(
"get_instant_at_ascending_node",
&Pass::accessInstantAtAscendingNode,
Expand Down
6 changes: 6 additions & 0 deletions bindings/python/test/trajectory/orbit/test_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ def test_get_revolution_number(self, pass_: Pass):
def test_get_duration(self, pass_: Pass):
assert pass_.get_duration() is not None

def test_get_start_instant(self, pass_: Pass):
assert pass_.get_start_instant() is not None

def test_get_end_instant(self, pass_: Pass):
assert pass_.get_end_instant() is not None

def test_get_instant_at_ascending_node(self, pass_: Pass):
assert pass_.get_instant_at_ascending_node() is not None

Expand Down
10 changes: 10 additions & 0 deletions include/OpenSpaceToolkit/Astrodynamics/Trajectory/Orbit/Pass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ class Pass
/// @return The duration of the pass.
Duration getDuration() const;

/// @brief Get the start instant of the pass. For partial passes, this is the minimum defined instant.
///
/// @return The start instant of the pass.
Instant getStartInstant() const;

/// @brief Get the end instant of the pass. For partial passes, this is the maximum defined instant.
///
/// @return The end instant of the pass.
Instant getEndInstant() const;

/// @brief Accesses the instant at the ascending node of the pass.
///
/// @return The instant at the ascending node of the pass.
Expand Down
Loading

0 comments on commit 33fabf4

Please sign in to comment.