Hello everyone, I am having a hard time creating a visual-contact cone and a ContactLocator within a python script that sets a mission simulation. The function is needed there to count and measure duration of the visual contact between a ground station and a few satellites.
For the cone, the lines *cone1 = gmat.Construct("ConicalFOV","conic1")cone1.SetField("FieldOfViewAngle", 70.9999)* produce an error message: > GMAT/R2022a/bin/gmatpy/_py310/gmat_py.py > <http://localhost:8888/mnt/linux_storage/Software/Space_Engineering/Space_Flight/GMAT/R2022a/bin/gmatpy/_py310/gmat_py.py> > in ?(self, *args) 7223 def SetField(self, *args):-> 7224 > return _gmat_py.GmatBase_SetField(self, *args) > APIException: GmatBase Exception Thrown: > > However, a line *cone1.GetGeneratingString() *run right after it shows a successful (?) creation of the "cone"-object: > 'Create ConicalFOV conic1;\nGMAT conic1.Color = [0 0 0];\nGMAT conic1.Alpha = > 255;\nGMAT conic1.FieldOfViewAngle = 70.9999;\n'. > > And while it's partially possible to create a ContactLocator, *gmat.Construct("ContactLocator", "ContactLocator1")* and adding optional fields like WriteReport, File, etc., I still get an error message, after running *gmat.Initialize()*: > GMAT/R2022a/bin/gmatpy/_py310/gmat_py.py > <http://localhost:8888/mnt/linux_storage/Software/Space_Engineering/Space_Flight/GMAT/R2022a/bin/gmatpy/_py310/gmat_py.py> > in ?(*args) 23934 def Initialize(*args):> 23935 return > _gmat_py.Initialize(*args) > APIException: Event Exception Thrown: Error setting observers on > > ContactLocator ContactLocator1. All observers must be either ground stations > or spacecraft. > > An observer was set by *contact_GS1.SetField("Observers", str(gsts['GroundStation_1'].GetName()))* here, a *GroundStation_1* is one of a finite number of keys in a dictionary *gsts* - it's a dictionary for the groundstations that would be in the sim. I cannot figure out how to properly set this string, so that the gmat-object *gsts['GroundStation_1']*. Tried the gmat.GetObject( *gsts['GroundStation_1']*) and gmat.GetObject(*"gsts['GroundStation_1']*") to no avail. Got lost both in the functions defined in the gmat_py and the C source code while trying to determine the natures of those functions... Would really appreciate some advice, pointers, and mentorship! Best regards, Mike
_______________________________________________ GMAT-users mailing list GMAT-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gmat-users