OrbbecSDK 1.10.18
OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ob::Device Class Reference

#include <Device.hpp>

Public Member Functions

 Device (std::unique_ptr< DeviceImpl > impl)
 Describe the entity of the RGBD camera, representing a specific model of RGBD camera.
 
virtual ~Device () noexcept
 
std::shared_ptr< DeviceInfogetDeviceInfo ()
 Get device information.
 
std::shared_ptr< SensorListgetSensorList ()
 Get device sensor list.
 
std::shared_ptr< SensorgetSensor (OBSensorType type)
 Get specific type of sensor if device not open, SDK will automatically open the connected device and return to the instance.
 
void setIntProperty (OBPropertyID propertyId, int32_t property)
 Set int type of device property.
 
void setFloatProperty (OBPropertyID propertyId, float property)
 Set float type of device property.
 
void setBoolProperty (OBPropertyID propertyId, bool property)
 Set bool type of device property.
 
int32_t getIntProperty (OBPropertyID propertyId)
 Get int type of device property.
 
float getFloatProperty (OBPropertyID propertyId)
 Get float type of device property.
 
bool getBoolProperty (OBPropertyID propertyId)
 Get bool type of device property.
 
OBIntPropertyRange getIntPropertyRange (OBPropertyID propertyId)
 Get int type device property range (including current value and default value)
 
OBFloatPropertyRange getFloatPropertyRange (OBPropertyID propertyId)
 Get float type device property range((including current value and default value)
 
OBBoolPropertyRange getBoolPropertyRange (OBPropertyID propertyId)
 Get bool type device property range (including current value and default value)
 
void writeAHB (uint32_t reg, uint32_t mask, uint32_t value)
 Write to an AHB register.
 
void readAHB (uint32_t reg, uint32_t mask, uint32_t *value)
 Read from an AHB register.
 
void writeI2C (uint32_t moduleId, uint32_t reg, uint32_t mask, uint32_t value)
 Write to an I2C register.
 
void readI2C (uint32_t moduleId, uint32_t reg, uint32_t mask, uint32_t *value)
 Read from an I2C register.
 
void writeFlash (uint32_t offset, const void *data, uint32_t dataSize, SetDataCallback callback, bool async=false)
 Set the properties for writing to Flash.
 
void readFlash (uint32_t offset, uint32_t dataSize, GetDataCallback callback, bool async=false)
 Read a property from Flash.
 
void writeCustomerData (const void *data, uint32_t dataSize)
 Set the customer data type of a device property.
 
void readCustomerData (void *data, uint32_t *dataSize)
 Get the customer data type of a device property.
 
void setRawData (OBPropertyID propertyId, const void *data, uint32_t dataSize, SetDataCallback callback, bool async=false)
 Set the raw data type of a device property (with asynchronous callback)
 
void getRawData (OBPropertyID propertyId, GetDataCallback callback, bool async=false)
 Get the raw data type of a device property (with asynchronous callback)
 
void setStructuredData (OBPropertyID propertyId, const void *data, uint32_t dataSize)
 Set the structured data type of a device property.
 
void getStructuredData (OBPropertyID propertyId, void *data, uint32_t *dataSize)
 Get the structured data type of a device property.
 
void setStructuredDataExt (OBPropertyID propertyId, std::shared_ptr< OBDataBundle > dataBundle, SetDataCallback callback)
 Set the structured data type of a device property (with extended data bundle)
 
std::shared_ptr< OBDataBundlegetStructuredDataExt (OBPropertyID propertyId)
 Get the structured data type of a device property (with extended data bundle)
 
OBProtocolVersion getProtocolVersion ()
 Get the property protocol version.
 
OBCmdVersion getCmdVersion (OBPropertyID propertyId)
 Get the cmdVersion of a property.
 
uint32_t getSupportedPropertyCount ()
 Get the number of properties supported by the device.
 
OBPropertyItem getSupportedProperty (uint32_t index)
 Get the supported properties of the device.
 
bool isPropertySupported (OBPropertyID propertyId, OBPermissionType permission)
 Check if a property permission is supported.
 
bool isGlobalTimestampSupported ()
 Check if the global timestamp is supported for the device.
 
void deviceUpgrade (const char *filePath, DeviceUpgradeCallback callback, bool async=true)
 Upgrade the device firmware.
 
void deviceUpgradeFromData (const char *fileData, uint32_t fileSize, DeviceUpgradeCallback callback, bool async=true)
 
void sendFile (const char *filePath, const char *dstPath, SendFileCallback callback, bool async=true)
 Send files to the specified path on the device side [Asynchronouscallback].
 
OBDeviceState getDeviceState ()
 Get the current state.
 
void setDeviceStateChangedCallback (DeviceStateChangedCallback callback)
 Set the device state changed callbacks.
 
bool activateAuthorization (const char *authCode)
 Verify device authorization code.
 
void writeAuthorizationCode (const char *authCodeStr)
 Write authorization code.
 
std::shared_ptr< CameraParamListgetCalibrationCameraParamList ()
 Get the original parameter list of camera calibration saved in the device.
 
OBDepthWorkMode getCurrentDepthWorkMode ()
 Get current depth work mode.
 
OBStatus switchDepthWorkMode (const OBDepthWorkMode &workMode)
 Switch depth work mode by OBDepthWorkMode. Prefer invoke switchDepthWorkMode(const char *modeName) to switch depth mode when known the complete name of depth work mode.
 
OBStatus switchDepthWorkMode (const char *modeName)
 Switch depth work mode by work mode name.
 
std::shared_ptr< OBDepthWorkModeListgetDepthWorkModeList ()
 Request support depth work mode list.
 
void reboot ()
 Device restart.
 
void reboot (uint32_t delayMs)
 Device restart delay mode.
 
DEPRECATED uint64_t syncDeviceTime ()
 Synchronize the device time (synchronize local system time to device)
 
DEPRECATED OBDeviceSyncConfig getSyncConfig ()
 get the current device synchronization configuration
 
DEPRECATED void setSyncConfig (const OBDeviceSyncConfig &deviceSyncConfig)
 Set the device synchronization configuration.
 
uint16_t getSupportedMultiDeviceSyncModeBitmap ()
 Get the supported multi device sync mode bitmap of the device.
 
void setMultiDeviceSyncConfig (const OBMultiDeviceSyncConfig &config)
 set the multi device sync configuration of the device.
 
OBMultiDeviceSyncConfig getMultiDeviceSyncConfig ()
 get the multi device sync configuration of the device.
 
void triggerCapture ()
 send the capture command to the device.
 
void setTimestampResetConfig (const OBDeviceTimestampResetConfig &config)
 set the timestamp reset configuration of the device.
 
OBDeviceTimestampResetConfig getTimestampResetConfig ()
 get the timestamp reset configuration of the device.
 
void timestampReset ()
 send the timestamp reset command to the device.
 
void timerSyncWithHost ()
 synchronize the timer of the device with the host.
 
void loadDepthFilterConfig (const char *filePath)
 Load depth filter config from file.
 
void resetDefaultDepthFilterConfig ()
 Reset depth filter config to device default define.
 
const char * getCurrentPresetName ()
 Get current preset name.
 
const char * getCurrentDepthModeName ()
 Get current depth mode name.
 
void loadPreset (const char *presetName)
 load the preset according to the preset name.
 
std::shared_ptr< DevicePresetListgetAvailablePresetList ()
 Get available preset list.
 
void loadPresetFromJsonFile (const char *filePath)
 Load custom preset from file.
 
void loadPresetFromJsonData (const char *presetName, const uint8_t *data, uint32_t size)
 Load custom preset from data.
 
void exportSettingsAsPresetJsonFile (const char *filePath)
 Export current device settings as a preset json file.
 
void exportSettingsAsPresetJsonData (const char *presetName, const uint8_t **data, uint32_t *dataSize)
 Export current device settings as a preset json data.
 

Protected Member Functions

 Device (Device &&device)
 

Protected Attributes

std::unique_ptr< DeviceImpl > impl_
 

Friends

class Pipeline
 
class Recorder
 
class CoordinateTransformHelper
 

Detailed Description

Definition at line 29 of file Device.hpp.

Constructor & Destructor Documentation

◆ Device() [1/2]

ob::Device::Device ( Device &&  device)
protected

◆ Device() [2/2]

ob::Device::Device ( std::unique_ptr< DeviceImpl >  impl)

Describe the entity of the RGBD camera, representing a specific model of RGBD camera.

◆ ~Device()

virtual ob::Device::~Device ( )
virtualnoexcept

Member Function Documentation

◆ getDeviceInfo()

std::shared_ptr< DeviceInfo > ob::Device::getDeviceInfo ( )

Get device information.

Returns
std::shared_ptr<DeviceInfo> return device information

◆ getSensorList()

std::shared_ptr< SensorList > ob::Device::getSensorList ( )

Get device sensor list.

Returns
std::shared_ptr<SensorList> return the sensor list

◆ getSensor()

std::shared_ptr< Sensor > ob::Device::getSensor ( OBSensorType  type)

Get specific type of sensor if device not open, SDK will automatically open the connected device and return to the instance.

Returns
std::shared_ptr<Sensor> return the sensor example, if the device does not have the device,return nullptr

◆ setIntProperty()

void ob::Device::setIntProperty ( OBPropertyID  propertyId,
int32_t  property 
)

Set int type of device property.

Parameters
propertyIdProperty id
propertyProperty to be set

◆ setFloatProperty()

void ob::Device::setFloatProperty ( OBPropertyID  propertyId,
float  property 
)

Set float type of device property.

Parameters
propertyIdProperty id
propertyProperty to be set

◆ setBoolProperty()

void ob::Device::setBoolProperty ( OBPropertyID  propertyId,
bool  property 
)

Set bool type of device property.

Parameters
propertyIdProperty id
propertyProperty to be set

◆ getIntProperty()

int32_t ob::Device::getIntProperty ( OBPropertyID  propertyId)

Get int type of device property.

Parameters
propertyIdProperty id
Returns
int32_t Property to get

◆ getFloatProperty()

float ob::Device::getFloatProperty ( OBPropertyID  propertyId)

Get float type of device property.

Parameters
propertyIdProperty id
Returns
float Property to get

◆ getBoolProperty()

bool ob::Device::getBoolProperty ( OBPropertyID  propertyId)

Get bool type of device property.

Parameters
propertyIdProperty id
Returns
bool Property to get

◆ getIntPropertyRange()

OBIntPropertyRange ob::Device::getIntPropertyRange ( OBPropertyID  propertyId)

Get int type device property range (including current value and default value)

Parameters
propertyIdProperty id
Returns
OBIntPropertyRange Property range

◆ getFloatPropertyRange()

OBFloatPropertyRange ob::Device::getFloatPropertyRange ( OBPropertyID  propertyId)

Get float type device property range((including current value and default value)

Parameters
propertyIdProperty id
Returns
OBFloatPropertyRange Property range

◆ getBoolPropertyRange()

OBBoolPropertyRange ob::Device::getBoolPropertyRange ( OBPropertyID  propertyId)

Get bool type device property range (including current value and default value)

Parameters
propertyIdThe ID of the property
Returns
OBBoolPropertyRange The range of the property

◆ writeAHB()

void ob::Device::writeAHB ( uint32_t  reg,
uint32_t  mask,
uint32_t  value 
)

Write to an AHB register.

Parameters
regThe register to write to
maskThe mask to apply
valueThe value to write

◆ readAHB()

void ob::Device::readAHB ( uint32_t  reg,
uint32_t  mask,
uint32_t *  value 
)

Read from an AHB register.

Parameters
regThe register to read from
maskThe mask to apply
valueThe value to return

◆ writeI2C()

void ob::Device::writeI2C ( uint32_t  moduleId,
uint32_t  reg,
uint32_t  mask,
uint32_t  value 
)

Write to an I2C register.

Parameters
moduleIdThe ID of the I2C module to write to
regThe register to write to
maskThe mask to apply
valueThe value to write

◆ readI2C()

void ob::Device::readI2C ( uint32_t  moduleId,
uint32_t  reg,
uint32_t  mask,
uint32_t *  value 
)

Read from an I2C register.

Parameters
moduleIdThe ID of the I2C module to read from
regThe register to read from
maskThe mask to apply
valueThe value to return

◆ writeFlash()

void ob::Device::writeFlash ( uint32_t  offset,
const void *  data,
uint32_t  dataSize,
SetDataCallback  callback,
bool  async = false 
)

Set the properties for writing to Flash.

Parameters
offsetThe offset address in Flash
dataThe data to write
dataSizeThe size of the data to write
callbackThe callback for write progress
asyncWhether to execute asynchronously

◆ readFlash()

void ob::Device::readFlash ( uint32_t  offset,
uint32_t  dataSize,
GetDataCallback  callback,
bool  async = false 
)

Read a property from Flash.

Parameters
offsetThe offset address in Flash
dataSizeThe size of the property to read
callbackThe callback for read progress and data
asyncWhether to execute asynchronously

◆ writeCustomerData()

void ob::Device::writeCustomerData ( const void *  data,
uint32_t  dataSize 
)

Set the customer data type of a device property.

Parameters
dataThe data to set
dataSizeThe size of the data to set,the maximum length cannot exceed 65532 bytes.

◆ readCustomerData()

void ob::Device::readCustomerData ( void *  data,
uint32_t *  dataSize 
)

Get the customer data type of a device property.

Parameters
dataThe property data obtained
dataSizeThe size of the data obtained

◆ setRawData()

void ob::Device::setRawData ( OBPropertyID  propertyId,
const void *  data,
uint32_t  dataSize,
SetDataCallback  callback,
bool  async = false 
)

Set the raw data type of a device property (with asynchronous callback)

Parameters
propertyIdThe ID of the property
dataThe data to set
dataSizeThe size of the data to set
callbackThe callback for set progress
asyncWhether to execute asynchronously

◆ getRawData()

void ob::Device::getRawData ( OBPropertyID  propertyId,
GetDataCallback  callback,
bool  async = false 
)

Get the raw data type of a device property (with asynchronous callback)

Parameters
propertyIdThe ID of the property
callbackThe callback for getting the data and progress
asyncWhether to execute asynchronously

◆ setStructuredData()

void ob::Device::setStructuredData ( OBPropertyID  propertyId,
const void *  data,
uint32_t  dataSize 
)

Set the structured data type of a device property.

Parameters
propertyIdThe ID of the property
dataThe data to set
dataSizeThe size of the data to set

◆ getStructuredData()

void ob::Device::getStructuredData ( OBPropertyID  propertyId,
void *  data,
uint32_t *  dataSize 
)

Get the structured data type of a device property.

Parameters
propertyIdThe ID of the property
dataThe property data obtained
dataSizeThe size of the data obtained

◆ setStructuredDataExt()

void ob::Device::setStructuredDataExt ( OBPropertyID  propertyId,
std::shared_ptr< OBDataBundle dataBundle,
SetDataCallback  callback 
)

Set the structured data type of a device property (with extended data bundle)

Parameters
propertyIdThe ID of the property
dataBundleThe target data bundle
callbackThe callback for setting

◆ getStructuredDataExt()

std::shared_ptr< OBDataBundle > ob::Device::getStructuredDataExt ( OBPropertyID  propertyId)

Get the structured data type of a device property (with extended data bundle)

Parameters
propertyIdThe ID of the property
Returns
The data bundle

◆ getProtocolVersion()

OBProtocolVersion ob::Device::getProtocolVersion ( )

Get the property protocol version.

Returns
The protocol version

◆ getCmdVersion()

OBCmdVersion ob::Device::getCmdVersion ( OBPropertyID  propertyId)

Get the cmdVersion of a property.

Parameters
propertyIdThe ID of the property
Returns
The cmdVersion

◆ getSupportedPropertyCount()

uint32_t ob::Device::getSupportedPropertyCount ( )

Get the number of properties supported by the device.

Returns
The number of supported properties

◆ getSupportedProperty()

OBPropertyItem ob::Device::getSupportedProperty ( uint32_t  index)

Get the supported properties of the device.

Parameters
indexThe index of the property
Returns
The type of supported property

◆ isPropertySupported()

bool ob::Device::isPropertySupported ( OBPropertyID  propertyId,
OBPermissionType  permission 
)

Check if a property permission is supported.

Parameters
propertyIdThe ID of the property
permissionThe read and write permissions to check
Returns
Whether the property permission is supported

◆ isGlobalTimestampSupported()

bool ob::Device::isGlobalTimestampSupported ( )

Check if the global timestamp is supported for the device.

Returns
Whether the global timestamp is supported

◆ deviceUpgrade()

void ob::Device::deviceUpgrade ( const char *  filePath,
DeviceUpgradeCallback  callback,
bool  async = true 
)

Upgrade the device firmware.

Parameters
filePathFirmware path
callbackFirmware upgrade progress and status callback
asyncWhether to execute asynchronously

◆ deviceUpgradeFromData()

void ob::Device::deviceUpgradeFromData ( const char *  fileData,
uint32_t  fileSize,
DeviceUpgradeCallback  callback,
bool  async = true 
)

◆ sendFile()

void ob::Device::sendFile ( const char *  filePath,
const char *  dstPath,
SendFileCallback  callback,
bool  async = true 
)

Send files to the specified path on the device side [Asynchronouscallback].

Parameters
filePathOriginal file path
dstPathAccept the save path on the device side
callbackFile transfer callback
asyncWhether to execute asynchronously

◆ getDeviceState()

OBDeviceState ob::Device::getDeviceState ( )

Get the current state.

Returns
OBDeviceState device state information

◆ setDeviceStateChangedCallback()

void ob::Device::setDeviceStateChangedCallback ( DeviceStateChangedCallback  callback)

Set the device state changed callbacks.

Parameters
callbackThe callback function that is triggered when the device status changes (for example, the frame rate is automatically reduced or the stream is closed due to high temperature, etc.)

◆ activateAuthorization()

bool ob::Device::activateAuthorization ( const char *  authCode)

Verify device authorization code.

Parameters
authCodeAuthorization code
Returns
bool whether the activation is successful

◆ writeAuthorizationCode()

void ob::Device::writeAuthorizationCode ( const char *  authCodeStr)

Write authorization code.

Parameters
[in]authCodeStrAuthorization code

◆ getCalibrationCameraParamList()

std::shared_ptr< CameraParamList > ob::Device::getCalibrationCameraParamList ( )

Get the original parameter list of camera calibration saved in the device.

Attention
The parameters in the list do not correspond to the current open-current configuration. You need to select the parameters according to the actual situation, and may need to do scaling, mirroring and other processing. Non-professional users are recommended to use the Pipeline::getCameraParam() interface.
Returns
std::shared_ptr<CameraParamList> camera parameter list

◆ getCurrentDepthWorkMode()

OBDepthWorkMode ob::Device::getCurrentDepthWorkMode ( )

Get current depth work mode.

Returns
ob_depth_work_mode Current depth work mode

◆ switchDepthWorkMode() [1/2]

OBStatus ob::Device::switchDepthWorkMode ( const OBDepthWorkMode workMode)

Switch depth work mode by OBDepthWorkMode. Prefer invoke switchDepthWorkMode(const char *modeName) to switch depth mode when known the complete name of depth work mode.

Parameters
[in]workModeDepth work mode come from ob_depth_work_mode_list which return by ob_device_get_depth_work_mode_list

◆ switchDepthWorkMode() [2/2]

OBStatus ob::Device::switchDepthWorkMode ( const char *  modeName)

Switch depth work mode by work mode name.

Parameters
[in]modeNameDepth work mode name which equals to OBDepthWorkMode.name

◆ getDepthWorkModeList()

std::shared_ptr< OBDepthWorkModeList > ob::Device::getDepthWorkModeList ( )

Request support depth work mode list.

Returns
OBDepthWorkModeList list of ob_depth_work_mode

◆ reboot() [1/2]

void ob::Device::reboot ( )

Device restart.

Attention
The device will be disconnected and reconnected. After the device is disconnected, the access to the Device object interface may be abnormal. Please delete the object directly and obtain it again after the device is reconnected.

◆ reboot() [2/2]

void ob::Device::reboot ( uint32_t  delayMs)

Device restart delay mode.

Attention
The device will be disconnected and reconnected. After the device is disconnected, the access to the Device object interface may be abnormal. Please delete the object directly and obtain it again after the device is reconnected. Support devices: Gemini2 L
Parameters
[in]delayMsTime unit:ms。delayMs == 0:No delay;delayMs > 0, Delay millisecond connect to host device after reboot

◆ syncDeviceTime()

DEPRECATED uint64_t ob::Device::syncDeviceTime ( )

Synchronize the device time (synchronize local system time to device)

Deprecated:
This interface is deprecated, please use timerSyncWithHost instead.
Returns
The command (round trip time, rtt)

◆ getSyncConfig()

DEPRECATED OBDeviceSyncConfig ob::Device::getSyncConfig ( )

get the current device synchronization configuration

Device synchronization: including exposure synchronization function and multi-camera synchronization function of different sensors within a single machine

Deprecated:
This interface is deprecated, please use getMultiDeviceSyncConfig instead.
Returns
OBDeviceSyncConfig return the device synchronization configuration

◆ setSyncConfig()

DEPRECATED void ob::Device::setSyncConfig ( const OBDeviceSyncConfig deviceSyncConfig)

Set the device synchronization configuration.

Used to configure the exposure synchronization function and multi-camera synchronization function of different sensors in a single machine

Deprecated:
This interface is deprecated, please use setMultiDeviceSyncConfig instead.
Attention
Calling this function will directly write the configuration to the device Flash, and it will still take effect after the device restarts. To avoid affecting the Flash lifespan, do not update the configuration frequently.
Parameters
deviceSyncConfigDevice synchronization configuration

◆ getSupportedMultiDeviceSyncModeBitmap()

uint16_t ob::Device::getSupportedMultiDeviceSyncModeBitmap ( )

Get the supported multi device sync mode bitmap of the device.

For example, if the return value is 0b00001100, it means the device supports OB_MULTI_DEVICE_SYNC_MODE_PRIMARY and OB_MULTI_DEVICE_SYNC_MODE_SECONDARY. User can check the supported mode by the code:

if(supported_mode_bitmap & OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN){
//support OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN
}
if(supported_mode_bitmap & OB_MULTI_DEVICE_SYNC_MODE_STANDALONE){
//support OB_MULTI_DEVICE_SYNC_MODE_STANDALONE
}
// and so on
@ OB_MULTI_DEVICE_SYNC_MODE_STANDALONE
standalone mode
Definition ObTypes.h:1272
@ OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN
free run mode
Definition ObTypes.h:1265
Returns
uint16_t return the supported multi device sync mode bitmap of the device.

◆ setMultiDeviceSyncConfig()

void ob::Device::setMultiDeviceSyncConfig ( const OBMultiDeviceSyncConfig config)

set the multi device sync configuration of the device.

Parameters
[in]configThe multi device sync configuration.

◆ getMultiDeviceSyncConfig()

OBMultiDeviceSyncConfig ob::Device::getMultiDeviceSyncConfig ( )

get the multi device sync configuration of the device.

Returns
OBMultiDeviceSyncConfig return the multi device sync configuration of the device.

◆ triggerCapture()

void ob::Device::triggerCapture ( )

send the capture command to the device.

The device will start one time image capture after receiving the capture command when it is in the OB_MULTI_DEVICE_SYNC_MODE_SOFTWARE_TRIGGERING

Attention
The frequency of the user call this function multiplied by the number of frames per trigger should be less than the frame rate of the stream. The number of frames per trigger can be set by framesPerTrigger.
For some models,receive and execute the capture command will have a certain delay and performance consumption, so the frequency of calling this function should not be too high, please refer to the product manual for the specific supported frequency.
If the device is not in the OB_MULTI_DEVICE_SYNC_MODE_HARDWARE_TRIGGERING mode, device will ignore the capture command.

◆ setTimestampResetConfig()

void ob::Device::setTimestampResetConfig ( const OBDeviceTimestampResetConfig config)

set the timestamp reset configuration of the device.

◆ getTimestampResetConfig()

OBDeviceTimestampResetConfig ob::Device::getTimestampResetConfig ( )

get the timestamp reset configuration of the device.

Returns
OBDeviceTimestampResetConfig return the timestamp reset configuration of the device.

◆ timestampReset()

void ob::Device::timestampReset ( )

send the timestamp reset command to the device.

The device will reset the timer for calculating the timestamp for output frames to 0 after receiving the timestamp reset command when the timestamp reset function is enabled. The timestamp reset function can be enabled by call ob_device_set_timestamp_reset_config.

Before calling this function, user should call ob_device_set_timestamp_reset_config to disable the timestamp reset function (It is not required for some models, but it is still recommended to do so for code compatibility).

Attention
If the stream of the device is started, the timestamp of the continuous frames output by the stream will jump once after the timestamp reset.
Due to the timer of device is not high-accuracy, the timestamp of the continuous frames output by the stream will drift after a long time. User can call this function periodically to reset the timer to avoid the timestamp drift, the recommended interval time is 60 minutes.

◆ timerSyncWithHost()

void ob::Device::timerSyncWithHost ( )

synchronize the timer of the device with the host.

After calling this function, the timer of the device will be synchronized with the host. User can call this function to multiple devices to synchronize all timers of the devices.

Attention
If the stream of the device is started, the timestamp of the continuous frames output by the stream will may jump once after the timer sync.
Due to the timer of device is not high-accuracy, the timestamp of the continuous frames output by the stream will drift after a long time. User can call this function periodically to synchronize the timer to avoid the timestamp drift, the recommended interval time is 60 minutes.

◆ loadDepthFilterConfig()

void ob::Device::loadDepthFilterConfig ( const char *  filePath)

Load depth filter config from file.

Parameters
filePathPath of the config file.

◆ resetDefaultDepthFilterConfig()

void ob::Device::resetDefaultDepthFilterConfig ( )

Reset depth filter config to device default define.

◆ getCurrentPresetName()

const char * ob::Device::getCurrentPresetName ( )

Get current preset name.

The preset mean a set of parameters or configurations that can be applied to the device to achieve a specific effect or function.

Returns
const char* return the current preset name, it should be one of the preset names returned by getAvailablePresetList.

◆ getCurrentDepthModeName()

const char * ob::Device::getCurrentDepthModeName ( )

Get current depth mode name.

According the current preset name to return current depth mode name

Returns
const char* return the current depth mode name.

◆ loadPreset()

void ob::Device::loadPreset ( const char *  presetName)

load the preset according to the preset name.

Attention
After loading the preset, the settings in the preset will set to the device immediately. Therefore, it is recommended to re-read the device settings to update the user program temporarily.
Parameters
presetNameThe preset name to set. The name should be one of the preset names returned by getAvailablePresetList.

◆ getAvailablePresetList()

std::shared_ptr< DevicePresetList > ob::Device::getAvailablePresetList ( )

Get available preset list.

The available preset list usually defined by the device manufacturer and restores on the device.

User can load the custom preset by calling loadPresetFromJsonFile to append the available preset list.

Returns
DevicePresetList return the available preset list.

◆ loadPresetFromJsonFile()

void ob::Device::loadPresetFromJsonFile ( const char *  filePath)

Load custom preset from file.

After loading the custom preset, the settings in the custom preset will set to the device immediately.

After loading the custom preset, the available preset list will be appended with the custom preset and named as the file name.

Attention
The user should ensure that the custom preset file is adapted to the device and the settings in the file are valid.
It is recommended to re-read the device settings to update the user program temporarily after successfully loading the custom preset.
Parameters
filePathThe path of the custom preset file.

◆ loadPresetFromJsonData()

void ob::Device::loadPresetFromJsonData ( const char *  presetName,
const uint8_t *  data,
uint32_t  size 
)

Load custom preset from data.

After loading the custom preset, the settings in the custom preset will set to the device immediately.

After loading the custom preset, the available preset list will be appended with the custom preset and named as the presetName.

Attention
The user should ensure that the custom preset data is adapted to the device and the settings in the data are valid.
It is recommended to re-read the device settings to update the user program temporarily after successfully loading the custom preset.
Parameters
dataThe custom preset data.
sizeThe size of the custom preset data.

◆ exportSettingsAsPresetJsonFile()

void ob::Device::exportSettingsAsPresetJsonFile ( const char *  filePath)

Export current device settings as a preset json file.

The exported preset file can be loaded by calling loadPresetFromJsonFile to restore the device setting.

After exporting the preset, a new preset named as the filePath will be added to the available preset list.

Parameters
filePathThe path of the preset file to be exported.

◆ exportSettingsAsPresetJsonData()

void ob::Device::exportSettingsAsPresetJsonData ( const char *  presetName,
const uint8_t **  data,
uint32_t *  dataSize 
)

Export current device settings as a preset json data.

After exporting the preset, a new preset named as the presetName will be added to the available preset list.

Attention
The memory of the data is allocated by the SDK, and will automatically be released by the SDK.
The memory of the data will be reused by the SDK on the next call, so the user should copy the data to a new buffer if it needs to be preserved.
Parameters
[out]datareturn the preset json data.
[out]dataSizereturn the size of the preset json data.

Friends And Related Symbol Documentation

◆ Pipeline

friend class Pipeline
friend

Definition at line 632 of file Device.hpp.

◆ Recorder

friend class Recorder
friend

Definition at line 633 of file Device.hpp.

◆ CoordinateTransformHelper

friend class CoordinateTransformHelper
friend

Definition at line 634 of file Device.hpp.

Member Data Documentation

◆ impl_

std::unique_ptr<DeviceImpl> ob::Device::impl_
protected

Definition at line 31 of file Device.hpp.


The documentation for this class was generated from the following file: