|
44 | 44 | if TYPE_CHECKING: # pragma: no cover |
45 | 45 | from bsk_rl.sim import Simulator |
46 | 46 |
|
47 | | -logger = logging.getLogger(__name__) |
| 47 | +try: |
| 48 | + from Basilisk.utilities.supportDataTools.dataFetcher import DataFile, get_path |
| 49 | + |
| 50 | + _DATA_FETCHER_API = True |
| 51 | +except ImportError: |
| 52 | + bskPath = __path__[0] |
| 53 | + _DATA_FETCHER_API = False |
48 | 54 |
|
49 | | -bsk_path = __path__[0] |
| 55 | +logger = logging.getLogger(__name__) |
50 | 56 |
|
51 | 57 |
|
52 | 58 | class WorldModelABC(ABC, Resetable): |
@@ -169,14 +175,19 @@ def setup_gravity_bodies( |
169 | 175 | self.planet.isCentralBody = ( |
170 | 176 | True # ensure this is the central gravitational body |
171 | 177 | ) |
172 | | - self.planet.useSphericalHarmonicsGravityModel( |
173 | | - bsk_path + "/supportData/LocalGravData/GGM03S.txt", 10 |
174 | | - ) |
| 178 | + if _DATA_FETCHER_API: |
| 179 | + path_grav_data = str(get_path(DataFile.LocalGravData.GGM03S)) |
| 180 | + path_ephem_data = str(get_path(DataFile.EphemerisData.de430).parent) |
| 181 | + else: |
| 182 | + path_grav_data = bsk_path + "/supportData/LocalGravData/GGM03S.txt" |
| 183 | + path_ephem_data = bsk_path + "/supportData/EphemerisData/" |
| 184 | + |
| 185 | + self.planet.useSphericalHarmonicsGravityModel(path_grav_data, 10) |
175 | 186 |
|
176 | 187 | # setup Spice interface for some solar system bodies |
177 | 188 | timeInitString = utc_init |
178 | 189 | self.gravFactory.createSpiceInterface( |
179 | | - bsk_path + "/supportData/EphemerisData/", timeInitString, epochInMsg=True |
| 190 | + path_ephem_data, timeInitString, epochInMsg=True |
180 | 191 | ) |
181 | 192 | self.gravFactory.spiceObject.zeroBase = "earth" |
182 | 193 |
|
|
0 commit comments