Skip to content

Commit

Permalink
Merge pull request #834 from AVSLab/feature/add_spice_to_scenario
Browse files Browse the repository at this point in the history
Add SPICE module to scenarioOrbitManeuver scenario
  • Loading branch information
jackfox25 authored Oct 22, 2024
2 parents c9e7dfb + b8a68fa commit d7d9f72
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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

0 comments on commit d7d9f72

Please sign in to comment.