FeatureCatalogue¶
giant.relative_opnav.estimators.sfn.surface_features
:
This class represents a collection of
SurfaceFeatures
for use in GIANT relative OpNav.In GIANT, a surface feature is used to represent a small patch of surface which we look for in an image to generate a bearing measurement to in the process of
SurfaceFeatureNavigation
. Because we normally have many features in order to globally cover the surface, we need a special manager to handle all of these features, rather than making each one aSceneObject
in a scene. That is the purpose of this class.Essentially this class works as its own mini scene (in fact much of the code was copied from the
Scene
but without aScene.light_obj
. Somewhat confusingly though, this class is meant to be wrapped in aSceneObject
and then stored as aScene.target_obj
for processing. To the user (and to theScene
) this will look like any other traceable object in GIANT for the most part.Internally, the features are filtered with the
include_features
attribute, which is a list of integer indices into thefeatures
list of which features to include while tracing. Normally, however, a user won’t interact with this attribute, which is instead handled by theSurfaceFeatureNavigation
class.This class also collects some information about each feature into the
feature_normals
,feature_locations
, andfeature_bounds
attributes, which are used to easily determine which features are visible for a given image in conjunction with theVisibleFeatureFinder
class and theSurfaceFeatureNavigation
class.Similar to a
KDTree
, when something requests to rotate or translate the feature catalogue through therotate()
andtranslate()
methods, the features themselves are not actually moved. Instead the rotation/translation is stored and is used to rotate/translate the rays into the original feature catalogue frame before ray tracing for performance reasons. These methods do update thefeature_normals
,feature_locations
, andfeature_bounds
attributes though.One of the keys of the
SurfaceFeature
class is that is provides a mechanism for lazy loading/unloading of the DEM data itself from memory. This class provides 2 easy properties to change the control of this lazy load/unload through thestale_count_unload_threshold
andmemory_percent_unload_threshold
which can be used to change the corresponding settings for all features in the catalogue.Creating a feature catalogue is a difficult process which has largely be automated into the
spc_to_feature_catalogue
andtile_shape
scripts, which we encourage you to consider at least as examples if you are building your own. If you are making your own, once you have your list ofSurfaceFeature
objects, if you are using the lazy load/unload functionality, you should also provide a corresponding list of dictionaries which contain the bounding box vertices under key'bounds'
and the feature DEM order under key'order'
. Again, for an example of how to do this consider thetile_shape
script.- Parameters:
features (List[SurfaceFeature]) –
map_info (List[Dict[str, int | ndarray]] | None) –
The number of times
not_found()
must be called since the lastfound()
was called for a feature to be unloaded from memory.Setting to this property will change this value for all features contained in the catalogue.
This property returns the feature finder for this class, which is a callable that takes in a camera model, scene, and temperature and returns a list of indices into the
features
list and related.Typically this is an instance of
VisibleFeatureFinder
The memory percentage used by the current process at which point we begin unloading features that are not found regardless of how long its been since a feature was used.
If you trust your system to handle swap appropriately you can set this to some value greater than 100 which will effectively disable this check.
If you plan to run multiple instances of GIANT/SFN at the same time then you should probably set this value lower so that you limit the resources they are fighting over.
Setting to this property will change this value for all features contained in the catalogue.
The approximate axis aligned bounding box of all of the features in the catalogue.
This is found by finding the minimum/maximum bound of the bounding box vertices (
feature_bounds
) rotated/translated into the current frame. As such, it is only a rough estimate.
Summary of Methods
This static method identifies the first intersection for each ray when there is more than 1 feature intersected. |
|
Rotates the feature catalogue. |
|
This method traces rays through the feature catalogue, optionally filtering which features are included traced through the |
|
Translates the feature catalogue. |
|
This method goes through and updates the directory structure for each feature contained in the catalogue. |