SynchronizationParameter Struct Reference

Configuration parameters for data synchronization. More...

Functions

bool save (String filename, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON) const
 Saves the current set of parameters into a file to be reloaded with the load() method. More...
 
bool load (String filename, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON)
 Loads a set of parameters from the values contained in a previously saved file. More...
 
bool encode (String &serialized_content, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON) const
 Generate a JSON Object (with the struct type as a key) containing the serialized struct, converted into a string. More...
 
bool decode (const String &serialized_content, SERIALIZATION_FORMAT format=SERIALIZATION_FORMAT::JSON)
 Fill the structure from the serialized json object contained in the input string. More...
 
bool operator== (const SynchronizationParameter &param1) const
 Comparison operator ==. More...
 
bool operator!= (const SynchronizationParameter &param1) const
 Comparison operator !=. More...
 

Attributes

double windows_size = 0
 Size of synchronization windows in milliseconds. More...
 
double data_source_timeout = 1000
 Duration in milliseconds before considering a camera as inactive if no more data is present (for example camera disconnection). More...
 
bool keep_last_data = false
 Determines whether to include the last data returned by a source in the final synchronized data. More...
 
double maximum_lateness = 50
 Maximum duration in milliseconds allowed for data to be considered as the last data. More...
 

Detailed Description

Configuration parameters for data synchronization.

The SynchronizationParameter struct represents the configuration parameters used by the synchronizer. It allows customization of the synchronization process based on specific requirements.

Functions

◆ save()

bool save ( String  filename,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
) const

Saves the current set of parameters into a file to be reloaded with the load() method.

Parameters
filename: Name of the file which will be created to store the parameters (extension '.yml' will be added if not set).
Returns
True if the file was successfully saved, otherwise false.
Warning
For security reasons, the file must not already exist.
In case a file already exists, the method will return false and existing file will not be updated.

◆ load()

bool load ( String  filename,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
)

Loads a set of parameters from the values contained in a previously saved file.

Parameters
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).
Returns
True if the file was successfully loaded, otherwise false.

◆ encode()

bool encode ( String serialized_content,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
) const

Generate a JSON Object (with the struct type as a key) containing the serialized struct, converted into a string.

Parameters
serialized_contentoutput string containing the JSON Object
formatserialization format, default is JSON
Returns
True if file was successfully saved, otherwise false.

◆ decode()

bool decode ( const String serialized_content,
SERIALIZATION_FORMAT  format = SERIALIZATION_FORMAT::JSON 
)

Fill the structure from the serialized json object contained in the input string.

Parameters
serialized_contentinput string containing the JSON Object
formatserialization format, default is JSON
Returns
True if the decoding was successful, otherwise false.

◆ operator==()

bool operator== ( const SynchronizationParameter param1) const

Comparison operator ==.

Parameters
SynchronizationParameterto compare
Returns
true if the two struct are identical

◆ operator!=()

bool operator!= ( const SynchronizationParameter param1) const

Comparison operator !=.

Parameters
SynchronizationParameterto compare
Returns
true if the two struct are different

Variables

◆ windows_size

double windows_size = 0

Size of synchronization windows in milliseconds.

The synchronization window is used by the synchronizer to return all data present inside the current synchronization window. For efficient fusion, the synchronization window size is expected to be equal to the mean grab() duration of the camera at the lowest FPS. If not provided, the fusion SDK will compute it from the data's sources.

Default value: 0

◆ data_source_timeout

double data_source_timeout = 1000

Duration in milliseconds before considering a camera as inactive if no more data is present (for example camera disconnection).

The data_source_timeout parameter specifies the duration to wait before considering a camera as inactive if no new data is received within the specified time frame.

Default value: 1000

◆ keep_last_data

bool keep_last_data = false

Determines whether to include the last data returned by a source in the final synchronized data.

If the keep_last_data parameter is set to true and no data is present in the current synchronization window, the last data returned by the source will be included in the final synchronized data. This ensures continuity even in the absence of fresh data.

Default value: false

◆ maximum_lateness

double maximum_lateness = 50

Maximum duration in milliseconds allowed for data to be considered as the last data.

The maximum_lateness parameter sets the maximum duration within which data can be considered as the last available data. If the duration between the last received data and the current synchronization window exceeds this value, the data will not be included as the last data in the final synchronized output.

Default value: 50