Problems with vizSupport

39 views
Skip to first unread message

Daria Andrievskaia

unread,
Jun 22, 2022, 5:22:45 AM6/22/22
to Basilisk Forum
Hi BSK people!

I encountered a problem with Vizard visualization. Everything works fine untill vizSupport.. is met.
For example, the following part of the code results in the default spacecraft model (not the one I stated) with transceiver and reaction wheels depicted. Yet there's no rw's panel nor location of the ground station. I've repeated the algorithm from the tutorials but even when I run them, vizSupport settings stated after viz = vizSupport.enableUnityVisualization() are not taken into account in Vizard.

 if vizSupport.vizFound:
            self.transceiverHUD.r_SB_B = [0.0, 0., 0.2]
            self.transceiverHUD.fieldOfView = 40.0 * macros.D2R
            self.transceiverHUD.normalVector = [0.0, 0., 1.0]
            self.transceiverHUD.color = vizInterface.IntVector(vizSupport.toRGBA255("cyan"))
            self.transceiverHUD.label = "antenna"
            self.transceiverHUD.animationSpeed = 1
   
            # Configure vizard settings
            vizFile = os.path.realpath(__file__).strip(".py") + ".py"
            viz = vizSupport.enableUnityVisualization(self, DynModels.taskName,     DynModels.scObject                                                
                                                       ,  saveFile=vizFile
                                                       , liveStream=self.options.live
                                                      , transceiverList=self.transceiverHUD
                                                      , rwEffectorList=DynModels.rwStateEffector
                                                      )
            vizSupport.createCustomModel(viz,
                            modelPath="/home/daria/Téléchargements/blender/export_relative_obj/nanosat_279.obj")
            vizSupport.addLocation(viz, stationName="Isae Station"
                               , parentBodyName=DynModels.Earth.planetName
                               , r_GP_P=DynModels.groundStation.r_LP_P_Init
                               , fieldOfView=np.radians(160.)
                               , color='pink'
                               , range=2000.0*1000  # meters
                               )
            vizSupport.setActuatorGuiSetting(viz, viewRWPanel=True, viewRWHUD=True)
            viz.settings.showLocationCommLines = 1
            viz.settings.showLocationCones = 1
            viz.settings.showLocationLabels = 1
            viz.epochInMsg.subscribeTo(DynModels.gravFactory.epochMsg)

Thank you in advance!

Daria
Reply all
Reply to author
Forward
0 new messages