vizSupport
- vizSupport.addLocation(viz, stationName: str, parentBodyName: str, r_GP_P=None, lla_GP=None, gHat_P=None, fieldOfView=None, color=None, range=None, markerScale=None, isHidden=None, label=None)[source]
This method creates a Location instance on a parent body.
- Parameters:
viz – copy of the vizInterface module
- Returns:
void
- Keyword Arguments:
stationName (str) – Location text label
parentBodyName (str) – Name of the parent body P (spacecraft or planet) on which the location G is positioned.
r_GP_P (3-element double-list) – Position of G relative to parent body frame P. Required, if lla_GP not provided
lla_GP (3-element double-list) – Position of G relative to parent body in lat/lon/alt coordinates. Required, if r_GP_P not provided
gHat_P (3-element double-list) – Location normal relative to parent body frame.
fieldOfView (double) – [rad] FOV angle measured edge-to-edge.
color (int-list) – Color of the Location. Can be 4 RGBA integer value (0-255) or a color string.
range (double) – [m] Range of the ground Location.
markerScale (double) – Value will be multiplied by default marker scale, values less than 1.0 will decrease size, greater will increase.
isHidden (bool) – True to hide Location, false to show (vizDefault)
label (string) – string to display on location label, if empty, then stationName is used. Send “NOLABEL” to delete label
- vizSupport.addQuadMap(viz, ID, parentBodyName, vertices, color, isHidden=None, label=None)[source]
This method creates a QuadMap element for displaying shaded regions in Vizard.
- Parameters:
viz – copy of the vizInterface module
- Returns:
void
- Keyword Arguments:
ID (int) – The reference ID of the QuadMap instance. Once instantiated, can be used to change the QuadMap settings.
parentBodyName (str) – Name of the parent body to draw the QuadMap in reference to.
vertices (single or double-list) – Specifies the internal mesh coordinates of the QuadMap, in body-fixed frame.
color (int list) – Color of the QuadMap. Can be 4 RGBA integer value (0-255) or a color string.
isHidden (bool) – Flag if the QuadMap should be hidden (1) or shown (-1). Optional. Default: 0 - if not provided, then the Vizard default settings are used.
label (str) – Label to display in the center of QuadMap region. Optional. Send “NOLABEL” to delete label.
- vizSupport.assert_option(value, low, high, default=None)[source]
Check if the value is in [low, high] inclusive.
- vizSupport.assert_trinary(value, default=0)[source]
Check if the value is in [-1, 0, 1] and map False to -1 or 0 depending on default.
- vizSupport.changeLocation(viz, stationName: str, parentBodyName: str | None = None, r_GP_P: Sequence[float] | None = None, lla_GP: Sequence[float] | None = None, gHat_P: Sequence[float] | None = None, fieldOfView: Sequence[float] | None = None, color: Sequence[float] | None = None, range: float | None = None, markerScale: float | None = None, isHidden: bool | None = None, label: str | None = None)[source]
This method changes the information of a Location instance.
- Parameters:
viz – copy of the vizInterface module
- Returns:
void
- Keyword Arguments:
stationName (str) – Location text label Required
parentBodyName (str) – Name of the parent body P (spacecraft or planet) on which the location G is positioned.
r_GP_P (3-element double-list) – Position of G relative to parent body frame P. Required, if lla_GP not provided
lla_GP (3-element double-list) – Position of G relative to parent body in lat/lon/alt coordinates. Required, if r_GP_P not provided
gHat_P (3-element double-list) – Location normal relative to parent body frame.
fieldOfView (double) – [rad] FOV angle measured edge-to-edge.
color (int-list) – Color of the Location. Can be 4 RGBA integer value (0-255) or a color string.
range (double) – [m] Range of the ground Location.
markerScale (double) – Value will be multiplied by default marker scale, values less than 1.0 will decrease size, greater will increase.
isHidden (bool) – True to hide Location, false to show (vizDefault)
label (string) – string to display on location label, if empty, then stationName is used. Send “NOLABEL” to delete label
- vizSupport.createCameraConfigMsg(viz, cameraID, fieldOfView, resolution, cameraPos_B, sigma_CB, parentName=None, renderRate=None, skyBox='', postProcessingOn=0, ppFocusDistance=None, ppAperature=None, ppFocalLength=None, ppMaxBlurSize=None, updateCameraParameters=False, renderMode=False, depthMapClippingPlanes=None, showHUDElementsInImage=None)[source]
This method configures camera settings.
- Parameters:
viz – copy of the vizInterface module
- Returns:
camera instance
- Keyword Arguments:
cameraID (int) – ID of the camera that took the snapshot.
parentName (str) – Name of the parent body to which the camera should be attached Optional, default is
firstSpacecraftNamefieldOfView (double) – [rad] Camera FOV, edge-to-edge along camera y-axis.
resolution (2-element int-list) – Camera resolution, width/height in pixels.
renderRate (int) – [ns] Frame time interval at which to capture images.
cameraPos_B (3-element double-list) – [m] Camera position in body frame.
sigma_CB (3-element double-list) – MRP defining the orientation of the camera frame relative to the body frame.
skyBox (str) – String containing the star field preference.
postProcessingOn (int) – Enable post-processing of camera image. Value of 0 (protobuffer default) to use viz default which is off, -1 for false, 1 for true.
ppFocusDistance (double) – Distance to the point of focus, minimum value of 0.1, Value of 0 to turn off this parameter entirely.
ppAperature (double) – Ratio of the aperture (known as f-stop or f-number). The smaller the value is, the shallower the depth of field is. Valid Setting Range: 0.05 to 32. Value of 0 to turn off this parameter entirely.
ppFocalLength (double) – Valid setting range: 0.001m to 0.3m. Value of 0 to turn off this parameter entirely.
ppMaxBlurSize (int) – Convolution kernel size of the bokeh filter, which determines the maximum radius of bokeh. It also affects the performance (the larger the kernel is, the longer the GPU time is required). Depth textures Value of 1 for Small, 2 for Medium, 3 for Large, 4 for Extra Large. Value of 0 to turn off this parameter entirely.
updateCameraParameters (int) – If true, commands camera to update Instrument Camera to current message’s parameters.
renderMode (int) – Value of 0 to render visual image (default), value of 1 to render depth buffer to image.
depthMapClippingPlanes (2-element double-list) – [m] Set the bounds of rendered depth map by setting the near and far clipping planes when in renderMode=1 (depthMap mode). Default values of 0.1 and 100.
showHUDElementsInImage (int) – Value of 0 (protobuffer default) to use viz default, -1 for false, 1 for true
- vizSupport.createConeInOut(viz, toBodyName, coneColor, isKeepIn, normalVector_B, incidenceAngle, coneHeight, fromBodyName=None, position_B=None, coneName='')[source]
This method creates a
KeepOutInCone.- Parameters:
viz – copy of the vizInterface module
- Returns:
void
- Keyword Arguments:
fromBodyName (str) – Name of body to attach cone onto. Optional, default selects
firstSpacecraftNametoBodyName (str) – Detect changes if this body has impingement on cone.
coneColor (int list) – Color of the KeepOutInCone. Can be 4 RGBA integer value (0-255) or a color string.
isKeepIn (bool) – True -> keep-in cone created, False -> keep-out cone created
position_B (3-element double-list) – [m] Cone start relative to from-body coordinate frame. Optional, default [0.0, 0.0, 0.0]
normalVector_B (3-element double-list) – Cone normal direction vector
incidenceAngle (double) – [rad] Cone incidence angle
coneHeight (double) – [m] Sets height of visible cone (aesthetic only, does not impact function)
coneName (str) – Cone name, if unspecified, viz will autogenerate name
- vizSupport.createCustomModel(viz, modelPath, simBodiesToModify=None, offset=None, rotation=None, scale=None, customTexturePath='', normalMapPath='', shader=-1, color=None)[source]
This method creates a CustomModel.
- Parameters:
viz – copy of the vizInterface module
- Returns:
void
- Keyword Arguments:
modelPath (str) – Path to model obj -OR-
CUBE,CYLINDER, orSPHEREto use a primitive shapesimBodiesToModify (list) – Which bodies in scene to replace with this model, use
ALL_SPACECRAFTto apply custom model to all spacecraft in simulation Optional, default modifiesfirstSpacecraftNameoffset (3-element double-list) – [m] Offset to use to draw the model Optional, default is [0.0, 0.0, 0.0]
rotation (3-element double-list) – [rad] 3-2-1 Euler angles to rotate CAD about z, y, x axes Optional, default is [0.0, 0.0, 0.0]
scale (3-element double-list) – Desired model scaling factor along the body x, y, z, axes in spacecraft CS Optional, default is [1.0, 1.0, 1.0]
customTexturePath (str) – Path to texture to apply to model (note that a custom model’s .mtl will be automatically imported with its textures during custom model import) Optional
normalMapPath (str) – Path to the normal map for the customTexture
shader (int) – Value of -1 to use viz default, 0 for Unity Specular Standard Shader, 1 for Unity Standard Shader
color (int list) – Send desired RGBA as values between 0 and 255, default is gray, and will be applied to the albedo color setting
- vizSupport.createPointLine(viz, toBodyName, lineColor, fromBodyName=None)[source]
This method creates a PointLine between two bodies.
- Parameters:
viz – copy of the vizInterface module
- Returns:
void
- Keyword Arguments:
toBodyName (str) – Body which the PointLine points to.
lineColor (int list) – Color of the PointLine. Can be 4 RGBA integer value (0-255) or a color string.
fromBodyName (str) – Body from which PointLine originates. Optional, default selects
firstSpacecraftName
- vizSupport.createStandardCamera(viz, spacecraftName=None, setMode=None, showHUDElementsInImage=None, setView=None, fieldOfView=-1, bodyTarget='', pointingVector_B=None, position_B=None, displayName=None)[source]
This method creates a Standard Camera.
- Parameters:
viz – copy of the vizInterface module
- Returns:
camera instance
- Keyword Arguments:
spacecraftName (str) – Name of spacecraft to attach camera onto. Optional, default selects
firstSpacecraftNamesetMode (int) – 0 -> body targeting, 1 -> pointing vector (default).
showHUDElementsInImage (int) – Value of 0 (protobuffer default) to use viz default, -1 for false, 1 for true
setView (int) – 0 -> nadir (default), 1 -> orbit normal, 2 -> along track. This is a setting for body targeting mode.
fieldOfView (double) – [rad] FOV angle measured edge-to-edge, -1 to use viz default.
bodyTarget (str) – Name of body camera should point to (default to first celestial body in messages). This is a setting for body targeting mode.
pointingVector_B (3-element double-list) – Camera pointing vector in the spacecraft body frame. Optional, default [1.0, 0.0, 0.0]
position_B (3-element double-list) – If a non-zero vector, this determines the location of the camera. If a zero vector, then the camera is placed outside the spacecraft along the pointing vector direction. Optional, default [0.0, 0.0, 0.0]
displayName (str) – Name of the standard camera panel. Optional
- vizSupport.createTargetLine(viz, toBodyName, lineColor, fromBodyName=None)[source]
This method creates a TargetLine between two bodies.
- Parameters:
viz – copy of the vizInterface module
- Returns:
void
- Keyword Arguments:
toBodyName (str) – Body which the PointLine points to.
lineColor (int list) – Color of the PointLine. Can be 4 RGBA integer value (0-255) or a color string.
fromBodyName (str) – Body from which PointLine originates. Optional, default selects
firstSpacecraftName
- vizSupport.enableUnityVisualization(scSim, simTaskName, scList, saveFile=None, rwEffectorList=None, thrEffectorList=None, thrColors=None, cssList=None, genericSensorList=None, ellipsoidList=None, lightList=None, genericStorageList=None, transceiverList=None, spriteList=None, modelDictionaryKeyList=None, logoTextureList=None, oscOrbitColorList=None, trueOrbitColorList=None, msmInfoList=None, trueOrbitColorInMsgList=None, liveStream=False, broadcastStream=False, noDisplay=False)[source]
This method creates an instance of the vizInterface() modules and sets up associated Vizard configuration setting messages.
- Parameters:
scSim – variable with the simulationBaseClass copy
simTaskName – task to which to add the vizInterface module
scList – Module: spacecraft objects. Can be a single object or list of objects
- Keyword Arguments:
saveFile (str) – can be a single python file name, or a full path + file name. In both cases a local results are stored in a local sub-folder called
_VizFiles. If a data file name is provided directly (i.e. it ends with.bin), then the associated file path and name are used explicitly. Default: empty string resulting in the data not being saved to a filerwEffectorList (single or list of
ReactionWheelStateEffector) – The list must have the same lengthscList. Each entry is the Module: reactionWheelStateEffector instance for the spacecraft, orNoneif the spacecraft has no RW devices.thrEffectorList (single or double-list of Module: thrusterDynamicEffector) – The list must have the same length
scList. Each entry is a list of Module: reactionWheelStateEffector instances for the spacecraft denoting a thruster cluster, orNoneif the spacecraft has no thruster devices.thrColors (single or vector of int(4)) – array of RGBA color values for each thruster set. The list must have the same length as
scList. Each list entry is a list of RGBA array values for each cluster set.cssList – list of lists of Module: coarseSunSensor objects. The outer list length must match
scList.genericSensorList – list of lists of
GenericSensorstructures. The outer list length must matchscList.ellipsoidList – list of lists of
Ellipsoidstructures. The outer list length must matchscList.lightList – list of lists of
Lightstructures. The outer list length must matchscList.genericStorageList – list of lists of
GenericStoragestructures. The outer list length must matchscList.transceiverList – list of lists of
Transceiverobjects. The outer list length must matchscList.spriteList – list of sprite information for each spacecraft. The outer list length must match
scList.modelDictionaryKeyList – list of the spacecraft model dictionary. The outer list length must match
scList.logoTextureList – list of the spacecraft logo texture file paths. The outer list length must match
scList.oscOrbitColorList – list of spacecraft osculating orbit colors. Can be 4 RGBA integer value (0-255), a color string, or
Noneif default values should be used. The array must be of the length of the spacecraft listtrueOrbitColorList – list of spacecraft true or actual orbit colors. Can be 4 RGBA integer value (0-255), a color string, or
Noneif default values should be used. The array must be of the length of the spacecraft listtrueOrbitColorInMsgList – list of color messages to read and provide the true orbit color at each time step. This overwrites the values set with trueOrbitColorList.
msmInfoList – list of MSM configuration messages
liveStream (bool) – flag if live data streaming to Vizard should be used
broadcastStream (bool) – flag if messages should be broadcast for listener Vizards to pick up.
noDisplay (bool) – flag if Vizard should run performance opNav (no Vizard display)
- Returns:
copy of the vizInterface instance
- Return type:
Module: vizInterface object
- vizSupport.fixedframe2lla(r_GP_P, radEquator, radRatio)[source]
This method receives a cartesian point above a reference ellipsoid with equatorial radius and flattening ratio, then converts to lat/lon/alt.
- Parameters:
r_GP_P – [m] position vector of the location G relative to the parent body
radEquator – [m] equatorial radius of the parent body
radRatio – ratio of polar radius to equatorial radius
- Returns:
[rad,rad,m] lla_GP, position vector of the location G relative to parent body frame P in lat/lon/alt
- Return type:
3-element list
- vizSupport.lla2fixedframe(lla_GP, radEquator, radRatio)[source]
This method receives a latitude/longitude/altitude point above a reference ellipsoid with equatorial radius and flattening ratio, then converts to body-fixed frame coordinates.
- Parameters:
lla_GP – [rad,rad,m] position vector of the location G relative to the parent body in lat/lon/alt components
radEquator – [m] equatorial radius of the parent body
radRatio – ratio of polar radius to equatorial radius
- Returns:
[m] r_GP_P, position vector of the location G relative to parent body frame P in P frame components
- Return type:
3-element list
- vizSupport.setActuatorGuiSetting(viz, spacecraftName=None, viewThrusterPanel=None, viewThrusterHUD=None, viewRWPanel=None, viewRWHUD=None, showThrusterLabels=None, showRWLabels=None)[source]
This method sets the actuator GUI properties for a particular spacecraft. If no
spacecraftNameis provided, then the name of the first spacecraft in the simulation is assumed.- Parameters:
viz – copy of the vizInterface module
- Returns:
void
- Keyword Arguments:
spacecraftName (str) – The name of the spacecraft for which the actuator GUI options are set. Default: If not provided, then the name of the first spacecraft in the simulation is used.
viewThrusterPanel (bool) – flag if the GUI panel should be shown illustrating the thruster states Default: if not provided, then the Vizard default settings are used
viewRWPanel (bool) – flag if the GUI panel should be shown illustrating the reaction wheel states Default: if not provided, then the Vizard default settings are used
viewThrusterHUD (bool) – flag if the HUD visualization of the thruster states should be shown Default: if not provided, then the Vizard default settings are used
viewRWHUD (bool) – flag if the HUD visualization of the reaction wheel states should be shown Default: if not provided, then the Vizard default settings are used
showThrusterLabels (bool) – flag if the thruster labels should be shown Default: if not provided, then the Vizard default settings are used
showRWLabels (bool) – flag if the reaction wheel labels should be shown Default: if not provided, then the Vizard default settings are used
- vizSupport.setInstrumentGuiSetting(viz, spacecraftName=None, viewCSSPanel=0, viewCSSCoverage=0, viewCSSBoresight=0, showCSSLabels=0, showGenericSensorLabels=0, showTransceiverLabels=0, showTransceiverFrustum=0, showTransceiverFrustrum=0, showGenericStoragePanel=0, showMultiShapeLabels=0)[source]
This method sets the instrument GUI properties for a particular spacecraft. If no
spacecraftNameis provided, then the name of the first spacecraft in the simulation is assumed.- Parameters:
viz – copy of the vizInterface module
- Returns:
void
- Keyword Arguments:
spacecraftName (str) – The name of the spacecraft for which the actuator GUI options are set. Default: 0 - If not provided, then the name of the first spacecraft in the simulation is used.
viewCSSPanel (int) – flag if the GUI panel should be shown (1) or hidden (-1) illustrating the CSS states Default: 0 - if not provided, then the Vizard default settings are used
viewCSSCoverage (int) – flag if the HUD spherical coverage of the CSS states should be shown (1) or hidden (-1) Default: 0 - if not provided, then the Vizard default settings are used
viewCSSBoresight (int) – flag if the HUD boresight axes of the CSS states should be shown (1) or hidden (-1) Default: 0 - if not provided, then the Vizard default settings are used
showCSSLabels (int) – flag if the CSS labels should be shown (1) or hidden (-1) Default: 0 - if not provided, then the Vizard default settings are used
showGenericSensorLabels (int) – flag if the generic sensor labels should be shown (1) or hidden (-1) Default: 0 - if not provided, then the Vizard default settings are used
showTransceiverLabels (int) – flag if the generic sensor labels should be shown (1) or hidden (-1) Default: 0 - if not provided, then the Vizard default settings are used
showTransceiverFrustum (int) – flag if the generic sensor labels should be shown (1) or hidden (-1) Default: 0 - if not provided, then the Vizard default settings are used
showGenericStoragePanel (int) – flag if the generic sensor labels should be shown (1) or hidden (-1) Default: 0 - if not provided, then the Vizard default settings are used
showMultiShapeLabels (int) – flag if the generic sensor labels should be shown (1) or hidden (-1) Default: 0 - if not provided, then the Vizard default settings are used
- vizSupport.setSprite(shape, color=None)[source]
Helper function to set the sprite shape and optional sprite color. :param shape: Sprite shape, must be either “CIRCLE”, “SQUARE”, “TRIANGLE”, “STAR”, or “bskSat” :param kwargs: RGBA color, can be either color name string or a 4D list of [0,255] values :return: string of the protobuffer sprite setting