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

Refactor simIncludeGravBody #332

Open
juan-g-bonilla opened this issue May 18, 2023 · 0 comments
Open

Refactor simIncludeGravBody #332

juan-g-bonilla opened this issue May 18, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@juan-g-bonilla
Copy link
Contributor

juan-g-bonilla commented May 18, 2023

Describe your use case

Current syntax for adding gravity to the simulation is slightly clunky, and we could do better. I propose the following changes:


scObject.gravField.gravBodies = spacecraft.GravBodyVector(list(gravFactory.gravBodies.values()))

to

gravFactory.addBodiesTo(scObject)

from Basilisk import __path__
bskPath = __path__[0]
gravFactory.createSpiceInterface(bskPath +'/supportData/EphemerisData/', timeInitString, epochInMsg=True)
gravFactory.spiceObject.zeroBase = 'Earth'

to

spiceObject = gravFactory.createSpiceInterface(time=timeInitString, epochInMsg=True)
spiceObject.zeroBase = 'Earth'

Explanation: Have bskPath +'/supportData/EphemerisData/' be the default path for createSpiceInterface (with the ability to still set your own path). Also, return spiceObject (keep it accesible through gravFactory.spiceObject too).


from Basilisk import __path__
bskPath = __path__[0]
asteroid.useSphericalHarmonicsGravityModel(bskPath + '/supportData/LocalGravData/VESTA20H.txt', 20)

to

asteroid.useSphericalHarmonicsGravityModel("%BSK_PATH%/supportData/LocalGravData/VESTA20H.txt", nSpherHarm)

Explanation: Make %BSK_PATH% a stand-in for Basilisk.__path__[0].


All these changes can be implemented while keeping the old syntax functional.

Additional context
Some of these changes assume that the syntax allowed by #331 is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant