scenarioQuadMaps

Overview

This scenario demonstrates how to set up and modify QuadMaps within Vizard, as both rectangular/polar defined regions and camera field-of-view regions.

The script is found in the folder basilisk/examples and executed by using:

python3 scenarioQuadMaps.py

Important

This scenario requires BSK to be built with vizInterface enabled.

Creating QuadMaps

As shown in this scenario, QuadMaps can be created using the helper functions in quadMapSupport. This is already imported within vizSupport, and can be accessed using vizSupport.qms. QuadMaps can also be built by hand.

Note

The ordering of the vertices field is important for QuadMaps to be rendered correctly. Each corner must be specified in the fixed-frame of its parent body, and the resulting vector is [x1, y1, z1, x2, …, y4, z4]. If another quadrilateral is to be added to the mesh, its vertices append directly after the first set. Thus, the vertices field should always contain a multiple of 12 elements (k quads, each with 4 corners, each with a 3D position).

This scenario demonstrates setting up QuadMaps using latitude/longitude/altitude, as shown by both Colorado (bounded by [37°N, 41°N] latitude and [-109°02’48”E, -102°02’48”E] longitude) and the Arctic Region (bounded by [66.5°N, 90°N] latitude and [-180°E, 180°E] longitude). These are computed using vizSupport.qms.computeRectMesh().

The satellite is capturing images of Earth’s surface every 20 minutes, and the camera field-of-view is projected onto the surface as a red QuadMap. Due to the eccentricity of the orbit, the spacing and scale of these FOV boxes change over time. There are two separate functions which handle the camera FOV: vizSupport.qms.computeCamFOVBox() returns the intersection points between the reference ellipsoid and the camera FOV, while vizSupport.qms.subdivideFOVBox() interpolates these corners according to produce a square grid that can more easily wrap a convex surface. It is important to note that, in this scenario, the FOV box is only drawn if all 4 corners find a valid intersection with the reference ellipsoid. Otherwise, the non-intersection case becomes more complex to handle and is currently the responsibility of the user to handle.

A custom QuadMap is also created on one of the solar cells of the satellite, which is defined by hand in body-fixed coordinates.

../_images/scenarioQuadMaps_overview.png

Once half of the simulation time passes, various settings are changed: Arctic Region toggles its isHidden flag, Solar Cell switches its label to “NOLABEL”, and Colorado changes its label/color.

scenarioQuadMaps.run(show_plots)[source]

The scenarios can be run with the followings setups parameters:

Parameters:

show_plots (bool) – Determines if the script should display plots. This script has no plots to show.