vizSupport
- vizSupport.addLocation(viz, **kwargs)[source]
This method creates a Location instance on a parent body.
- Parameters:
viz – copy of the vizInterface module
kwargs – list of keyword arguments that this method supports
- 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. Required
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. Required
fieldOfView (double) – [rad] FOV angle measured edge-to-edge. Required
color (int-list) – Color of the Location. Can be 4 RGBA integer value (0-255) or a color string. Required
range (double) – [m] Range of the ground Location. Required
markerScale (double) – Value will be multiplied by default marker scale, values less than 1.0 will decrease size, greater will increase. Optional
- vizSupport.addQuadMap(viz, **kwargs)[source]
This method creates a QuadMap element for displaying shaded regions in Vizard.
- Parameters:
viz – copy of the vizInterface module
kwargs – list of keyword arguments that this method supports
- Returns:
void
- Keyword Arguments:
ID (int) – The reference ID of the QuadMap instance. Once instantiated, can be used to change the QuadMap settings. Required
parentBodyName (str) – Name of the parent body to draw the QuadMap in reference to. Required
vertices (single or double-list) – Specifies the internal mesh coordinates of the QuadMap, in body-fixed frame. Required
color (int list) – Color of the QuadMap. Can be 4 RGBA integer value (0-255) or a color string. Required
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.createCameraConfigMsg(viz, **kwargs)[source]
This method configures camera settings.
- Parameters:
viz – copy of the vizInterface module
kwargs – list of keyword arguments that this method supports
- Returns:
camera instance
- Keyword Arguments:
cameraID (int) – ID of the camera that took the snapshot. Required
parentName (str) – Name of the parent body to which the camera should be attached Optional, default is
firstSpacecraftName
fieldOfView (double) – [rad] Camera FOV, edge-to-edge along camera y-axis. Required
resolution (2-element int-list) – Camera resolution, width/height in pixels. Required
renderRate (int) – [ns] Frame time interval at which to capture images. Optional
cameraPos_B (3-element double-list) – [m] Camera position in body frame. Required
sigma_CB (3-element double-list) – MRP defining the orientation of the camera frame relative to the body frame. Required
skyBox (str) – String containing the star field preference. Optional
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. Optional
ppFocusDistance (double) – Distance to the point of focus, minimum value of 0.1, Value of 0 to turn off this parameter entirely. Optional
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. Optional
ppFocalLength (double) – Valid setting range: 0.001m to 0.3m. Value of 0 to turn off this parameter entirely. Optional
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. Optional
updateCameraParameters (int) – If true, commands camera to update Instrument Camera to current message’s parameters. Optional
renderMode (int) – Value of 0 to render visual image (default), value of 1 to render depth buffer to image. Optional
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. Optional
- vizSupport.createConeInOut(viz, **kwargs)[source]
This method creates a
KeepOutInCone
.- Parameters:
viz – copy of the vizInterface module
kwargs – list of keyword arguments that this method supports
- Returns:
void
- Keyword Arguments:
fromBodyName (str) – Name of body to attach cone onto. Optional, default selects
firstSpacecraftName
toBodyName (str) – Detect changes if this body has impingement on cone. Required
coneColor (int list) – Color of the KeepOutInCone. Can be 4 RGBA integer value (0-255) or a color string. Required
isKeepIn (bool) – True -> keep-in cone created, False -> keep-out cone created Required
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 Required
incidenceAngle (double) – [rad] Cone incidence angle Required
coneHeight (double) – [m] Sets height of visible cone (aesthetic only, does not impact function) Required
coneName (str) – Cone name, if unspecified, viz will autogenerate name Optional
- vizSupport.createCustomModel(viz, **kwargs)[source]
This method creates a CustomModel.
- Parameters:
viz – copy of the vizInterface module
kwargs – list of keyword arguments that this method supports
- Returns:
void
- Keyword Arguments:
modelPath (str) – Path to model obj -OR-
CUBE
,CYLINDER
, orSPHERE
to use a primitive shape RequiredsimBodiesToModify (list) – Which bodies in scene to replace with this model, use
ALL_SPACECRAFT
to apply custom model to all spacecraft in simulation Optional, default modifiesfirstSpacecraftName
offset (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 Optional
shader (int) – Value of -1 to use viz default, 0 for Unity Specular Standard Shader, 1 for Unity Standard Shader Optional
color (int list) – Send desired RGBA as values between 0 and 255, default is gray, and will be applied to the albedo color setting Optional
- vizSupport.createPointLine(viz, **kwargs)[source]
This method creates a PointLine between two bodies.
- Parameters:
viz – copy of the vizInterface module
kwargs – list of keyword arguments that this method supports
- Returns:
void
- Keyword Arguments:
fromBodyName (str) – Body from which PointLine originates. Optional, default selects
firstSpacecraftName
toBodyName (str) – Body which the PointLine points to. Required
lineColor (int list) – Color of the PointLine. Can be 4 RGBA integer value (0-255) or a color string. Required
- vizSupport.createStandardCamera(viz, **kwargs)[source]
This method creates a Standard Camera.
- Parameters:
viz – copy of the vizInterface module
kwargs – list of keyword arguments that this method supports
- Returns:
camera instance
- Keyword Arguments:
spacecraftName (str) – Name of spacecraft to attach camera onto. Optional, default selects
firstSpacecraftName
setMode (int) – 0 -> body targeting, 1 -> pointing vector (default). Optional
setView (int) – 0 -> nadir (default), 1 -> orbit normal, 2 -> along track. This is a setting for body targeting mode. Optional
fieldOfView (double) – [rad] FOV angle measured edge-to-edge, -1 to use viz default. Optional
bodyTarget (str) – Name of body camera should point to (default to first celestial body in messages). This is a setting for body targeting mode. Optional
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, **kwargs)[source]
This method creates a TargetLine between two bodies.
- Parameters:
viz – copy of the vizInterface module
kwargs – list of keyword arguments that this method supports
- Returns:
void
- Keyword Arguments:
fromBodyName (str) – Body from which PointLine originates. Optional, default selects
firstSpacecraftName
toBodyName (str) – Body which the PointLine points to. Required
lineColor (int list) – Color of the PointLine. Can be 4 RGBA integer value (0-255) or a color string. Required
- vizSupport.enableUnityVisualization(scSim, simTaskName, scList, **kwargs)[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 file name, or a full path + file name. In both cases a local results are stored in a local sub-folder. Default: empty string resulting in the data not being saved to a file
rwEffectorList (single or list of
ReactionWheelStateEffector
) – The list must have the same lengthscList
. Each entry is the Module: reactionWheelStateEffector instance for the spacecraft, orNone
if 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, orNone
if 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
GenericSensor
structures. The outer list length must matchscList
.genericSensorCmdInMsgs – list of lists of DeviceCmdMsgPayload sensor state messages. The outer list length must match
scList
. If the spacecraft has no sensor command msg, then useNone
.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)
genericStorageList – list of lists of
GenericStorage
structures. The outer list length must matchscList
.lightList – list of lists of
Light
structures. The outer list length must matchscList
.spriteList – list of sprite information for each spacecraft
modelDictionaryKeyList – list of the spacecraft model dictionary. Use
None
if default values are usedoscOrbitColorList – list of spacecraft osculating orbit colors. Can be 4 RGBA integer value (0-255), a color string, or
None
if 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
None
if 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
ellipsoidList – list of lists of
Ellipsoid
structures. The outer list length must matchscList
.
- 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, **kwargs)[source]
This method sets the actuator GUI properties for a particular spacecraft. If no
spacecraftName
is provided, then the name of the first spacecraft in the simulation is assumed.- Parameters:
viz – copy of the vizInterface module
kwargs – list of keyword arguments that this method supports
- 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, **kwargs)[source]
This method sets the instrument GUI properties for a particular spacecraft. If no
spacecraftName
is provided, then the name of the first spacecraft in the simulation is assumed.- Parameters:
viz – copy of the vizInterface module
kwargs – list of keyword arguments that this method supports
- 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
showTransceiverFrustrum (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, **kwargs)[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