Class containing a set of parameters for the spatial mapping module. More...
Functions | |
SpatialMappingParameters | __cinit__ (self, resolution=MAPPING_RESOLUTION.MEDIUM, mapping_range=MAPPING_RANGE.AUTO, max_memory_usage=2048, save_texture=False, use_chunk_only=False, reverse_vertex_order=False, map_type=SPATIAL_MAP_TYPE.MESH) |
Default constructor. More... | |
None | set_resolution (self, resolution=MAPPING_RESOLUTION.HIGH) |
Sets the resolution to a sl.MAPPING_RESOLUTION preset. More... | |
None | set_range (self, mapping_range=MAPPING_RANGE.AUTO) |
Sets the range to a sl.MAPPING_RANGE preset. More... | |
float | get_range_preset (self, mapping_range=MAPPING_RANGE.AUTO) |
Returns the value corresponding to a sl.MAPPING_RANGE preset in meters. More... | |
float | get_resolution_preset (self, resolution=MAPPING_RESOLUTION.HIGH) |
Returns the value corresponding to a sl.MAPPING_RESOLUTION preset in meters. More... | |
float | get_recommended_range (self, resolution, Camera py_cam) |
Returns the recommended maximum depth value corresponding to a resolution. More... | |
SPATIAL_MAP_TYPE | map_type (self) |
The type of spatial map to be created. More... | |
int | max_memory_usage (self) |
The maximum CPU memory (in MB) allocated for the meshing process. More... | |
bool | save_texture (self) |
Whether to save the texture. More... | |
bool | use_chunk_only (self) |
Whether to only use chunks. More... | |
bool | reverse_vertex_order (self) |
Whether to inverse the order of the vertices of the triangles. More... | |
np.array[float] | allowed_range (self) |
The maximum depth allowed by spatial mapping: More... | |
float | range_meter (self) |
Depth range in meters. More... | |
np.array[float] | allowed_resolution (self) |
The resolution allowed by the spatial mapping: More... | |
float | resolution_meter (self) |
Spatial mapping resolution in meters. More... | |
int | stability_counter (self) |
Control the integration rate of the current depth into the mapping process. More... | |
bool | save (self, str filename) |
Saves the current set of parameters into a file to be reloaded with the load() method. More... | |
bool | load (self, str filename) |
Loads a set of parameters from the values contained in a previously saved file. More... | |
Class containing a set of parameters for the spatial mapping module.
The default constructor sets all parameters to their default settings.
SpatialMappingParameters __cinit__ | ( | self, | |
resolution = MAPPING_RESOLUTION.MEDIUM , |
|||
mapping_range = MAPPING_RANGE.AUTO , |
|||
max_memory_usage = 2048 , |
|||
save_texture = False , |
|||
use_chunk_only = False , |
|||
reverse_vertex_order = False , |
|||
map_type = SPATIAL_MAP_TYPE.MESH |
|||
) |
Default constructor.
Sets all parameters to their default and optimized values.
resolution | : Chosen MAPPING_RESOLUTION |
mapping_range | : Chosen MAPPING_RANGE |
max_memory_usage | : Chosen max_memory_usage |
save_texture | : Activates save_texture |
use_chunk_only | : Activates use_chunk_only |
reverse_vertex_order | : Activates reverse_vertex_order |
map_type | : Chosen map_type |
None set_resolution | ( | self, | |
resolution = MAPPING_RESOLUTION.HIGH |
|||
) |
Sets the resolution to a sl.MAPPING_RESOLUTION preset.
resolution | The desired sl.MAPPING_RESOLUTION. Default: sl.MAPPING_RESOLUTION.HIGH |
None set_range | ( | self, | |
mapping_range = MAPPING_RANGE.AUTO |
|||
) |
Sets the range to a sl.MAPPING_RANGE preset.
mapping_range | The desired sl.MAPPING_RANGE. Default: sl.MAPPING_RANGE::AUTO |
float get_range_preset | ( | self, | |
mapping_range = MAPPING_RANGE.AUTO |
|||
) |
Returns the value corresponding to a sl.MAPPING_RANGE preset in meters.
mapping_range | The desired sl.MAPPING_RANGE. Default: sl.MAPPING_RANGE::AUTO |
float get_resolution_preset | ( | self, | |
resolution = MAPPING_RESOLUTION.HIGH |
|||
) |
Returns the value corresponding to a sl.MAPPING_RESOLUTION preset in meters.
resolution | The desired sl.MAPPING_RESOLUTION. Default: sl.MAPPING_RESOLUTION.HIGH |
float get_recommended_range | ( | self, | |
resolution, | |||
Camera | py_cam | ||
) |
Returns the recommended maximum depth value corresponding to a resolution.
resolution | : The desired resolution, either defined by a sl.MAPPING_RESOLUTION preset or a resolution value in meters. |
py_cam | : The sl.Camera object which will run the spatial mapping. |
SPATIAL_MAP_TYPE map_type | ( | self | ) |
The type of spatial map to be created.
This dictates the format that will be used for the mapping (e.g. mesh, point cloud).
See sl.SPATIAL_MAP_TYPE.
int max_memory_usage | ( | self | ) |
The maximum CPU memory (in MB) allocated for the meshing process.
Default: 2048
bool save_texture | ( | self | ) |
Whether to save the texture.
If set to true, you will be able to apply the texture to your mesh after it is created.
Default: False
bool use_chunk_only | ( | self | ) |
Whether to only use chunks.
If set to False, you will ensure consistency between the mesh and its inner chunk data.
Default: False
bool reverse_vertex_order | ( | self | ) |
Whether to inverse the order of the vertices of the triangles.
If your display process does not handle front and back face culling, you can use this to correct it.
Default: False
np.array[float] allowed_range | ( | self | ) |
The maximum depth allowed by spatial mapping:
float range_meter | ( | self | ) |
Depth range in meters.
Can be different from the value set by sl.InitParameters.depth_maximum_distance.
np.array[float] allowed_resolution | ( | self | ) |
The resolution allowed by the spatial mapping:
float resolution_meter | ( | self | ) |
int stability_counter | ( | self | ) |
Control the integration rate of the current depth into the mapping process.
This parameter controls how many times a stable 3D points should be seen before it is integrated into the spatial mapping.
Default: 0 (this will define the stability counter based on the mesh resolution, the higher the resolution, the higher the stability counter)
bool save | ( | self, | |
str | filename | ||
) |
Saves the current set of parameters into a file to be reloaded with the load() method.
filename | : Name of the file which will be created to store the parameters (extension '.yml' will be added if not set). |
bool load | ( | self, | |
str | filename | ||
) |
Loads a set of parameters from the values contained in a previously saved file.
filename | : Path to the file from which the parameters will be loaded (extension '.yml' will be added at the end of the filename if not detected). |