[Gmat-developers] GMAT-R2020a Python API

7 views
Skip to first unread message

Ghassan Atmeh

unread,
Sep 21, 2020, 9:52:31 PM9/21/20
to gmat-de...@lists.sourceforge.net
Hello, 

Using the python API to run a mission with a Spacecraft and an ImpulsiveBurn results in the following API exception

~/gmat-git/application/bin/gmatpy/gmat_py.py in Initialize(*args)
  23606 
  23607 def Initialize(*args):
> 23608     return _gmat_py.Initialize(*args)
  23609 
  23610 def Clear(*args):

APIException: The following objects were not initialized:
   TOI

See the script below to reproduce this issue. 

Does the API support using the ImpulsiveBurn object? Does it require to be connected to another object or some other trick to get it to work? 

#=============================
# begin script
#=============================
from load_gmat import *

# spacecraft
sat = gmat.Construct("Spacecraft", "Sat")

# force model
force_model = gmat.Construct("ForceModel")

# An 8x8 JGM-3 Gravity Model for Earth
earthgrav = gmat.Construct("GravityField")
earthgrav.SetField("BodyName","Earth")
earthgrav.SetField("Degree",4)
earthgrav.SetField("Order",4)
earthgrav.SetField("PotentialFile","JGM2.cof")
force_model.AddForce(earthgrav)

# propagation container
pdprop = gmat.Construct("Propagator","PDProp")

# Assign a numerical integrator
gator = gmat.Construct("PrinceDormand78", "Gator")
pdprop.SetReference(gator)

# Burn
toi = gmat.Construct("ImpulsiveBurn","TOI")

# Assign the force model to the propagator
pdprop.SetReference(force_model)
pdprop.AddPropObject(sat)

# Perform top level initialization
gmat.Initialize()  # <- line where the API exception is thrown 

Reply all
Reply to author
Forward
0 new messages