-
Couldn't load subscription status.
- Fork 14
feat: add constant-local-orbital-frame-direction Maneuvering Segments #591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
phc1990
merged 4 commits into
main
from
feat/solve-sequences-with-constant-attitude-bias-maneuvers
Oct 21, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
104 changes: 104 additions & 0 deletions
104
bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/GuidanceLaw/HeterogeneousGuidanceLaw.cpp
This file contains hidden or 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,104 @@ | ||
| /// Apache License 2.0 | ||
|
|
||
| #include <OpenSpaceToolkit/Astrodynamics/GuidanceLaw/HeterogeneousGuidanceLaw.hpp> | ||
|
|
||
| using namespace pybind11; | ||
|
|
||
| using ostk::core::container::Array; | ||
| using ostk::core::container::Pair; | ||
| using ostk::core::type::Shared; | ||
|
|
||
| using ostk::mathematics::object::Vector3d; | ||
|
|
||
| using ostk::physics::coordinate::Frame; | ||
| using ostk::physics::time::Instant; | ||
| using ostk::physics::time::Interval; | ||
|
|
||
| using ostk::astrodynamics::GuidanceLaw; | ||
| using ostk::astrodynamics::guidancelaw::HeterogeneousGuidanceLaw; | ||
|
|
||
| inline void OpenSpaceToolkitAstrodynamicsPy_GuidanceLaw_HeterogeneousGuidanceLaw(pybind11::module& aModule) | ||
| { | ||
| class_<HeterogeneousGuidanceLaw, GuidanceLaw, Shared<HeterogeneousGuidanceLaw>>( | ||
| aModule, | ||
| "HeterogeneousGuidanceLaw", | ||
| R"doc( | ||
| A guidance law that sequences multiple guidance laws over specific time intervals. | ||
|
|
||
| At each point in time, the applicable guidance law is selected and used to calculate | ||
| the thrust acceleration. Guidance laws don't need to be contiguous, and can be added | ||
| in any order. If the instant does not fall within any of the intervals, the thrust | ||
| acceleration is zero. The guidance law intervals must not intersect each other. | ||
| )doc" | ||
| ) | ||
|
|
||
| .def( | ||
| init<const Array<Pair<Shared<GuidanceLaw>, Interval>>&>(), | ||
| arg_v("guidance_laws_with_intervals", Array<Pair<Shared<GuidanceLaw>, Interval>>::Empty(), "[]"), | ||
| R"doc( | ||
| Constructor. | ||
|
|
||
| Args: | ||
| guidance_laws_with_intervals (list[tuple[GuidanceLaw, Interval]], optional): Array of tuples containing the guidance laws and their corresponding intervals. Defaults to empty array. | ||
|
|
||
| Raises: | ||
| RuntimeError: If any interval is undefined, if the guidance law is null or if the interval intersects with an existing interval. | ||
| )doc" | ||
| ) | ||
|
|
||
| .def( | ||
| "get_guidance_laws_with_intervals", | ||
| &HeterogeneousGuidanceLaw::getGuidanceLawsWithIntervals, | ||
| R"doc( | ||
| Get the guidance laws with their corresponding intervals. | ||
|
|
||
| Returns: | ||
| list[tuple[GuidanceLaw, Interval]]: Array of tuples containing the guidance laws and their corresponding intervals. | ||
| )doc" | ||
| ) | ||
|
|
||
| .def( | ||
| "add_guidance_law", | ||
| &HeterogeneousGuidanceLaw::addGuidanceLaw, | ||
| arg("guidance_law"), | ||
| arg("interval"), | ||
| R"doc( | ||
| Add a guidance law with its corresponding interval. | ||
|
|
||
| Args: | ||
| guidance_law (GuidanceLaw): The guidance law to add. | ||
| interval (Interval): The interval during which the guidance law is active. | ||
|
|
||
| Raises: | ||
| RuntimeError: If the interval is undefined, if the guidance law is null or if the interval intersects with an existing interval. | ||
| )doc" | ||
| ) | ||
|
|
||
| .def( | ||
| "calculate_thrust_acceleration_at", | ||
| &HeterogeneousGuidanceLaw::calculateThrustAccelerationAt, | ||
| arg("instant"), | ||
| arg("position_coordinates"), | ||
| arg("velocity_coordinates"), | ||
| arg("thrust_acceleration"), | ||
| arg("output_frame"), | ||
| R"doc( | ||
| Calculate thrust acceleration at a given instant and state. | ||
|
|
||
| Args: | ||
| instant (Instant): The instant. | ||
| position_coordinates (numpy.ndarray): The position coordinates. | ||
| velocity_coordinates (numpy.ndarray): The velocity coordinates. | ||
| thrust_acceleration (float): The thrust acceleration magnitude. | ||
| output_frame (Frame): The frame in which the acceleration is expressed. | ||
|
|
||
| Returns: | ||
| numpy.ndarray: The acceleration vector at the provided coordinates. | ||
| )doc" | ||
| ) | ||
|
|
||
| .def("__str__", &(shiftToString<HeterogeneousGuidanceLaw>)) | ||
| .def("__repr__", &(shiftToString<HeterogeneousGuidanceLaw>)) | ||
|
|
||
| ; | ||
| } |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.