OrbbecSDK 1.10.18
OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras
|
#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< DeviceInfo > | getDeviceInfo () |
Get device information. | |
std::shared_ptr< SensorList > | getSensorList () |
Get device sensor list. | |
std::shared_ptr< Sensor > | getSensor (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< OBDataBundle > | getStructuredDataExt (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< CameraParamList > | getCalibrationCameraParamList () |
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< OBDepthWorkModeList > | getDepthWorkModeList () |
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< DevicePresetList > | getAvailablePresetList () |
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 |
Definition at line 29 of file Device.hpp.
|
protected |
ob::Device::Device | ( | std::unique_ptr< DeviceImpl > | impl | ) |
Describe the entity of the RGBD camera, representing a specific model of RGBD camera.
|
virtualnoexcept |
std::shared_ptr< DeviceInfo > ob::Device::getDeviceInfo | ( | ) |
Get device information.
std::shared_ptr< SensorList > ob::Device::getSensorList | ( | ) |
Get device sensor list.
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.
void ob::Device::setIntProperty | ( | OBPropertyID | propertyId, |
int32_t | property | ||
) |
Set int type of device property.
propertyId | Property id |
property | Property to be set |
void ob::Device::setFloatProperty | ( | OBPropertyID | propertyId, |
float | property | ||
) |
Set float type of device property.
propertyId | Property id |
property | Property to be set |
void ob::Device::setBoolProperty | ( | OBPropertyID | propertyId, |
bool | property | ||
) |
Set bool type of device property.
propertyId | Property id |
property | Property to be set |
int32_t ob::Device::getIntProperty | ( | OBPropertyID | propertyId | ) |
Get int type of device property.
propertyId | Property id |
float ob::Device::getFloatProperty | ( | OBPropertyID | propertyId | ) |
Get float type of device property.
propertyId | Property id |
bool ob::Device::getBoolProperty | ( | OBPropertyID | propertyId | ) |
Get bool type of device property.
propertyId | Property id |
OBIntPropertyRange ob::Device::getIntPropertyRange | ( | OBPropertyID | propertyId | ) |
Get int type device property range (including current value and default value)
propertyId | Property id |
OBFloatPropertyRange ob::Device::getFloatPropertyRange | ( | OBPropertyID | propertyId | ) |
Get float type device property range((including current value and default value)
propertyId | Property id |
OBBoolPropertyRange ob::Device::getBoolPropertyRange | ( | OBPropertyID | propertyId | ) |
Get bool type device property range (including current value and default value)
propertyId | The ID of the property |
void ob::Device::writeAHB | ( | uint32_t | reg, |
uint32_t | mask, | ||
uint32_t | value | ||
) |
Write to an AHB register.
reg | The register to write to |
mask | The mask to apply |
value | The value to write |
void ob::Device::readAHB | ( | uint32_t | reg, |
uint32_t | mask, | ||
uint32_t * | value | ||
) |
Read from an AHB register.
reg | The register to read from |
mask | The mask to apply |
value | The value to return |
void ob::Device::writeI2C | ( | uint32_t | moduleId, |
uint32_t | reg, | ||
uint32_t | mask, | ||
uint32_t | value | ||
) |
Write to an I2C register.
moduleId | The ID of the I2C module to write to |
reg | The register to write to |
mask | The mask to apply |
value | The value to write |
void ob::Device::readI2C | ( | uint32_t | moduleId, |
uint32_t | reg, | ||
uint32_t | mask, | ||
uint32_t * | value | ||
) |
Read from an I2C register.
moduleId | The ID of the I2C module to read from |
reg | The register to read from |
mask | The mask to apply |
value | The value to return |
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.
offset | The offset address in Flash |
data | The data to write |
dataSize | The size of the data to write |
callback | The callback for write progress |
async | Whether to execute asynchronously |
void ob::Device::readFlash | ( | uint32_t | offset, |
uint32_t | dataSize, | ||
GetDataCallback | callback, | ||
bool | async = false |
||
) |
Read a property from Flash.
offset | The offset address in Flash |
dataSize | The size of the property to read |
callback | The callback for read progress and data |
async | Whether to execute asynchronously |
void ob::Device::writeCustomerData | ( | const void * | data, |
uint32_t | dataSize | ||
) |
Set the customer data type of a device property.
data | The data to set |
dataSize | The size of the data to set,the maximum length cannot exceed 65532 bytes. |
void ob::Device::readCustomerData | ( | void * | data, |
uint32_t * | dataSize | ||
) |
Get the customer data type of a device property.
data | The property data obtained |
dataSize | The size of the data obtained |
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)
propertyId | The ID of the property |
data | The data to set |
dataSize | The size of the data to set |
callback | The callback for set progress |
async | Whether to execute asynchronously |
void ob::Device::getRawData | ( | OBPropertyID | propertyId, |
GetDataCallback | callback, | ||
bool | async = false |
||
) |
Get the raw data type of a device property (with asynchronous callback)
propertyId | The ID of the property |
callback | The callback for getting the data and progress |
async | Whether to execute asynchronously |
void ob::Device::setStructuredData | ( | OBPropertyID | propertyId, |
const void * | data, | ||
uint32_t | dataSize | ||
) |
Set the structured data type of a device property.
propertyId | The ID of the property |
data | The data to set |
dataSize | The size of the data to set |
void ob::Device::getStructuredData | ( | OBPropertyID | propertyId, |
void * | data, | ||
uint32_t * | dataSize | ||
) |
Get the structured data type of a device property.
propertyId | The ID of the property |
data | The property data obtained |
dataSize | The size of the data obtained |
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)
propertyId | The ID of the property |
dataBundle | The target data bundle |
callback | The callback for setting |
std::shared_ptr< OBDataBundle > ob::Device::getStructuredDataExt | ( | OBPropertyID | propertyId | ) |
Get the structured data type of a device property (with extended data bundle)
propertyId | The ID of the property |
OBProtocolVersion ob::Device::getProtocolVersion | ( | ) |
Get the property protocol version.
OBCmdVersion ob::Device::getCmdVersion | ( | OBPropertyID | propertyId | ) |
Get the cmdVersion of a property.
propertyId | The ID of the property |
uint32_t ob::Device::getSupportedPropertyCount | ( | ) |
Get the number of properties supported by the device.
OBPropertyItem ob::Device::getSupportedProperty | ( | uint32_t | index | ) |
Get the supported properties of the device.
index | The index of the property |
bool ob::Device::isPropertySupported | ( | OBPropertyID | propertyId, |
OBPermissionType | permission | ||
) |
Check if a property permission is supported.
propertyId | The ID of the property |
permission | The read and write permissions to check |
bool ob::Device::isGlobalTimestampSupported | ( | ) |
Check if the global timestamp is supported for the device.
void ob::Device::deviceUpgrade | ( | const char * | filePath, |
DeviceUpgradeCallback | callback, | ||
bool | async = true |
||
) |
Upgrade the device firmware.
filePath | Firmware path |
callback | Firmware upgrade progress and status callback |
async | Whether to execute asynchronously |
void ob::Device::deviceUpgradeFromData | ( | const char * | fileData, |
uint32_t | fileSize, | ||
DeviceUpgradeCallback | callback, | ||
bool | async = true |
||
) |
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].
filePath | Original file path |
dstPath | Accept the save path on the device side |
callback | File transfer callback |
async | Whether to execute asynchronously |
OBDeviceState ob::Device::getDeviceState | ( | ) |
Get the current state.
void ob::Device::setDeviceStateChangedCallback | ( | DeviceStateChangedCallback | callback | ) |
Set the device state changed callbacks.
callback | The 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.) |
bool ob::Device::activateAuthorization | ( | const char * | authCode | ) |
Verify device authorization code.
authCode | Authorization code |
void ob::Device::writeAuthorizationCode | ( | const char * | authCodeStr | ) |
Write authorization code.
[in] | authCodeStr | Authorization code |
std::shared_ptr< CameraParamList > ob::Device::getCalibrationCameraParamList | ( | ) |
Get the original parameter list of camera calibration saved in the device.
OBDepthWorkMode ob::Device::getCurrentDepthWorkMode | ( | ) |
Get current depth work mode.
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.
[in] | workMode | Depth work mode come from ob_depth_work_mode_list which return by ob_device_get_depth_work_mode_list |
OBStatus ob::Device::switchDepthWorkMode | ( | const char * | modeName | ) |
Switch depth work mode by work mode name.
[in] | modeName | Depth work mode name which equals to OBDepthWorkMode.name |
std::shared_ptr< OBDepthWorkModeList > ob::Device::getDepthWorkModeList | ( | ) |
Request support depth work mode list.
void ob::Device::reboot | ( | ) |
void ob::Device::reboot | ( | uint32_t | delayMs | ) |
Device restart delay mode.
[in] | delayMs | Time unit:ms。delayMs == 0:No delay;delayMs > 0, Delay millisecond connect to host device after reboot |
DEPRECATED uint64_t ob::Device::syncDeviceTime | ( | ) |
Synchronize the device time (synchronize local system time to device)
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 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
deviceSyncConfig | Device synchronization configuration |
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:
void ob::Device::setMultiDeviceSyncConfig | ( | const OBMultiDeviceSyncConfig & | config | ) |
set the multi device sync configuration of the device.
[in] | config | The multi device sync configuration. |
OBMultiDeviceSyncConfig ob::Device::getMultiDeviceSyncConfig | ( | ) |
get the multi device sync configuration of the device.
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
void ob::Device::setTimestampResetConfig | ( | const OBDeviceTimestampResetConfig & | config | ) |
set the timestamp reset configuration of the device.
OBDeviceTimestampResetConfig ob::Device::getTimestampResetConfig | ( | ) |
get the timestamp reset configuration of the device.
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).
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.
void ob::Device::loadDepthFilterConfig | ( | const char * | filePath | ) |
Load depth filter config from file.
filePath | Path of the config file. |
void ob::Device::resetDefaultDepthFilterConfig | ( | ) |
Reset depth filter config to device default define.
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.
const char * ob::Device::getCurrentDepthModeName | ( | ) |
Get current depth mode name.
According the current preset name to return current depth mode name
void ob::Device::loadPreset | ( | const char * | presetName | ) |
load the preset according to the preset name.
presetName | The preset name to set. The name should be one of the preset names returned by 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.
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.
filePath | The path of the custom preset file. |
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.
data | The custom preset data. |
size | The size of the custom preset data. |
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.
filePath | The path of the preset file to be exported. |
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.
[out] | data | return the preset json data. |
[out] | dataSize | return the size of the preset json data. |
|
friend |
Definition at line 632 of file Device.hpp.
|
friend |
Definition at line 633 of file Device.hpp.
|
friend |
Definition at line 634 of file Device.hpp.
|
protected |
Definition at line 31 of file Device.hpp.