Skip to content
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

Add SPICE module to scenarioOrbitManeuver scenario #834

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/Support/bskReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Version |release|
on the AVS lab web page that used to host the documentation.
- Updated :ref:`scenarioBasicOrbitStream` to add the ability to pause and resume the live BSK stream
- Added documenation on installing with ``pip`` via source code in :ref:`pipInstall`
- Updated :ref:`scenarioOrbitManeuver` to include a SPICE module that rotates the Earth


Version 2.5.0 (Sept. 30, 2024)
Expand Down
13 changes: 12 additions & 1 deletion examples/scenarioOrbitManeuver.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,22 @@ def run(show_plots, maneuverCase):
# add spacecraft object to the simulation process
scSim.AddModelToTask(simTaskName, scObject)

# setup Gravity Body
# setup Gravity Body and SPICE definitions
gravFactory = simIncludeGravBody.gravBodyFactory()
earth = gravFactory.createEarth()
earth.isCentralBody = True # ensure this is the central gravitational body

# attach gravity model to spacecraft
gravFactory.addBodiesTo(scObject)

# setup spice library for Earth ephemeris
timeInitString = "2024 September 21, 21:00:00.0 TDB"
spiceObject = gravFactory.createSpiceInterface(time=timeInitString, epochInMsg=True)
spiceObject.zeroBase = 'Earth'

# need spice to run before spacecraft module as it provides the spacecraft translational states
scSim.AddModelToTask(simTaskName, spiceObject)

#
# setup orbit and simulation time
#
Expand Down Expand Up @@ -291,6 +299,9 @@ def run(show_plots, maneuverCase):
scSim.ConfigureStopTime(simulationTime + T2 + T3)
scSim.ExecuteSimulation()

# unload Spice kernel
gravFactory.unloadSpiceKernels()

#
# retrieve the logged data
#
Expand Down
Loading