SpatialMappingParameters Class Reference

Class containing a set of parameters for the spatial mapping module. More...

Functions

 SpatialMappingParameters (float resolutionMeter=0.05f, float rangeMeter=0.0f, bool saveTexture=false, SPATIAL_MAP_TYPE map_type=SPATIAL_MAP_TYPE.MESH, bool useChunkOnly=false, int maxMemoryUsage=2048, bool reverseVertexOrder=false, int stabilityCounter=0)
 Default constructor. More...
 
void set (MAPPING_RESOLUTION mappingResolution=MAPPING_RESOLUTION.MEDIUM)
 Sets the resolution to a sl.MAPPING_RESOLUTION preset. More...
 
void set (MAPPING_RANGE mappingRange=MAPPING_RANGE.MEDIUM)
 Sets the range to a sl.MAPPING_RANGE preset. More...
 

Static Functions

static float get (MAPPING_RESOLUTION mappingResolution=MAPPING_RESOLUTION.MEDIUM)
 Returns the value corresponding to a sl.MAPPING_RESOLUTION preset in meters. More...
 
static float get (MAPPING_RANGE mappingRange=MAPPING_RANGE.MEDIUM)
 Returns the value corresponding to a sl.MAPPING_RANGE preset in meters. More...
 

Attributes

float resolutionMeter = 0.05f
 Spatial mapping resolution in meters. More...
 
float rangeMeter = 0.0f
 Depth range in meters. More...
 
bool saveTexture = false
 Whether to save the texture. More...
 
bool useChunkOnly = false
 Whether to only use chunks. More...
 
int maxMemoryUsage = 2048
 The maximum CPU memory (in MB) allocated for the meshing process. More...
 
bool reverseVertexOrder = false
 Whether to inverse the order of the vertices of the triangles. More...
 
SPATIAL_MAP_TYPE map_type = SPATIAL_MAP_TYPE.MESH
 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 SPATIAL_MAP_TYPE More...
 
int stabilityCounter = 0
 Control the integration rate of the current depth into the mapping process. More...
 

Detailed Description

Class containing a set of parameters for the spatial mapping module.

The default constructor sets all parameters to their default settings.

Note
Parameters can be adjusted by the user.

Constructor and Destructor

◆ SpatialMappingParameters()

SpatialMappingParameters ( float  resolutionMeter = 0.05f,
float  rangeMeter = 0.0f,
bool  saveTexture = false,
SPATIAL_MAP_TYPE  map_type = SPATIAL_MAP_TYPE.MESH,
bool  useChunkOnly = false,
int  maxMemoryUsage = 2048,
bool  reverseVertexOrder = false,
int  stabilityCounter = 0 
)
inline

Default constructor.

Sets all parameters to their default and optimized values.

Functions

◆ get() [1/2]

static float get ( MAPPING_RESOLUTION  mappingResolution = MAPPING_RESOLUTION.MEDIUM)
inlinestatic

Returns the value corresponding to a sl.MAPPING_RESOLUTION preset in meters.

Parameters
mappingResolutionThe desired sl.MAPPING_RESOLUTION. Default: sl.MAPPING_RESOLUTION.MEDIUM
Returns
The value of mappingResolution in meters.

◆ get() [2/2]

static float get ( MAPPING_RANGE  mappingRange = MAPPING_RANGE.MEDIUM)
inlinestatic

Returns the value corresponding to a sl.MAPPING_RANGE preset in meters.

Parameters
mappingRangeThe desired sl.MAPPING_RANGE. Default: sl.MAPPING_RANGE.MEDIUM
Returns
The value of mappingRange in meters.

◆ set() [1/2]

void set ( MAPPING_RESOLUTION  mappingResolution = MAPPING_RESOLUTION.MEDIUM)
inline

Sets the resolution to a sl.MAPPING_RESOLUTION preset.

Parameters
mappingResolutionThe desired sl.MAPPING_RESOLUTION. Default: sl.MAPPING_RESOLUTION.MEDIUM

◆ set() [2/2]

void set ( MAPPING_RANGE  mappingRange = MAPPING_RANGE.MEDIUM)
inline

Sets the range to a sl.MAPPING_RANGE preset.

Parameters
mappingRangeThe desired sl.MAPPING_RANGE. Default: sl.MAPPING_RANGE.MEDIUM

Variables

◆ resolutionMeter

float resolutionMeter = 0.05f

◆ rangeMeter

float rangeMeter = 0.0f

Depth range in meters.

Can be different from the value set by sl.InitParameters.depthMaximumDistance.

Note
Set to 0 by default. In this case, the range is computed from resolutionMeter and from the current internal parameters to fit your application.

Referenced by SpatialMappingParameters.set(), and SpatialMappingParameters.SpatialMappingParameters().

◆ saveTexture

bool saveTexture = false

Whether to save the texture.

If set to true, you will be able to apply the texture to your mesh after it is created.

Note
This option will consume more memory.
This option is only available for sl.SPATIAL_MAP_TYPE.MESH.

Referenced by SpatialMappingParameters.SpatialMappingParameters().

◆ useChunkOnly

bool useChunkOnly = false

Whether to only use chunks.

If set to false, you will ensure consistency between the mesh and its inner chunk data.

Note
Updating the mesh is time-consuming.
Setting this to true results in better performance.

Referenced by SpatialMappingParameters.SpatialMappingParameters().

◆ maxMemoryUsage

int maxMemoryUsage = 2048

The maximum CPU memory (in MB) allocated for the meshing process.

Referenced by SpatialMappingParameters.SpatialMappingParameters().

◆ reverseVertexOrder

bool reverseVertexOrder = false

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.

Note
This option is only available for sl.SPATIAL_MAP_TYPE.MESH.

Referenced by SpatialMappingParameters.SpatialMappingParameters().

◆ map_type

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 SPATIAL_MAP_TYPE

Referenced by SpatialMappingParameters.SpatialMappingParameters().

◆ stabilityCounter

int stabilityCounter = 0

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)

Referenced by SpatialMappingParameters.SpatialMappingParameters().