Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
|
Exposes RealSense device functionality for C compilers. More...
Go to the source code of this file.
Macros | |
#define | RS2_UNSIGNED_UPDATE_MODE_UPDATE 0 |
#define | RS2_UNSIGNED_UPDATE_MODE_READ_ONLY 1 |
#define | RS2_UNSIGNED_UPDATE_MODE_FULL 2 |
Typedefs | |
typedef enum rs2_calibration_type | rs2_calibration_type |
typedef enum rs2_calibration_status | rs2_calibration_status |
typedef struct rs2_calibration_change_callback | rs2_calibration_change_callback |
typedef void(* | rs2_calibration_change_callback_ptr) (rs2_calibration_status, void *arg) |
Enumerations | |
enum | rs2_calibration_type { RS2_CALIBRATION_AUTO_DEPTH_TO_RGB, RS2_CALIBRATION_MANUAL_DEPTH_TO_RGB, RS2_CALIBRATION_TYPE_COUNT } |
enum | rs2_calibration_status { RS2_CALIBRATION_TRIGGERED = 0, RS2_CALIBRATION_SPECIAL_FRAME = 1, RS2_CALIBRATION_STARTED = 2, RS2_CALIBRATION_NOT_NEEDED = 3, RS2_CALIBRATION_SUCCESSFUL = 4, RS2_CALIBRATION_RETRY = -1, RS2_CALIBRATION_FAILED = -2, RS2_CALIBRATION_SCENE_INVALID = -3, RS2_CALIBRATION_BAD_RESULT = -4, RS2_CALIBRATION_BAD_CONDITIONS = -5, RS2_CALIBRATION_STATUS_FIRST = -5, RS2_CALIBRATION_STATUS_LAST = 4, RS2_CALIBRATION_STATUS_COUNT = RS2_CALIBRATION_STATUS_LAST - RS2_CALIBRATION_STATUS_FIRST + 1 } |
Exposes RealSense device functionality for C compilers.
#define RS2_UNSIGNED_UPDATE_MODE_FULL 2 |
#define RS2_UNSIGNED_UPDATE_MODE_READ_ONLY 1 |
#define RS2_UNSIGNED_UPDATE_MODE_UPDATE 0 |
typedef struct rs2_calibration_change_callback rs2_calibration_change_callback |
typedef void(* rs2_calibration_change_callback_ptr) (rs2_calibration_status, void *arg) |
typedef enum rs2_calibration_status rs2_calibration_status |
Used in device_calibration with rs2_calibration_change_callback
typedef enum rs2_calibration_type rs2_calibration_type |
Used in device_calibration; enumerates the different calibration types available for that extension.
Used in device_calibration with rs2_calibration_change_callback
enum rs2_calibration_type |
const char* rs2_calibration_status_to_string | ( | rs2_calibration_status | ) |
const char* rs2_calibration_type_to_string | ( | rs2_calibration_type | ) |
void rs2_connect_tm2_controller | ( | const rs2_device * | device, |
const unsigned char * | mac_addr, | ||
rs2_error ** | error | ||
) |
Connects to a given tm2 controller
[in] | device | Device to connect to the controller |
[in] | mac_addr | The MAC address of the desired controller |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
rs2_device* rs2_create_device | ( | const rs2_device_list * | info_list, |
int | index, | ||
rs2_error ** | error | ||
) |
Creates a device by index. The device object represents a physical camera and provides the means to manipulate it.
[in] | info_list | the list containing the device to retrieve |
[in] | index | The zero based index of device to retrieve |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
const rs2_raw_data_buffer* rs2_create_flash_backup | ( | const rs2_device * | device, |
rs2_update_progress_callback_ptr | callback, | ||
void * | client_data, | ||
rs2_error ** | error | ||
) |
Create backup of camera flash memory. Such backup does not constitute valid firmware image, and cannot be loaded back to the device, but it does contain all calibration and device information.
[in] | device | Device to update |
[in] | callback | Optional callback for update progress notifications, the progress value is normailzed to 1 |
[in] | client_data | Optional client data for the callback |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
const rs2_raw_data_buffer* rs2_create_flash_backup_cpp | ( | const rs2_device * | device, |
rs2_update_progress_callback * | callback, | ||
rs2_error ** | error | ||
) |
Create backup of camera flash memory. Such backup does not constitute valid firmware image, and cannot be loaded back to the device, but it does contain all calibration and device information.
[in] | device | Device to update |
[in] | callback | Optional callback for update progress notifications, the progress value is normailzed to 1 |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_delete_device | ( | rs2_device * | device | ) |
Delete RealSense device
[in] | device | Realsense device to delete |
void rs2_delete_device_list | ( | rs2_device_list * | info_list | ) |
Deletes device list, any devices created using this list will remain unaffected.
[in] | info_list | List to delete |
int rs2_device_list_contains | ( | const rs2_device_list * | info_list, |
const rs2_device * | device, | ||
rs2_error ** | error | ||
) |
Checks if a specific device is contained inside a device list.
[in] | info_list | The list of devices to check in |
[in] | device | RealSense device to check for |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_disconnect_tm2_controller | ( | const rs2_device * | device, |
int | id, | ||
rs2_error ** | error | ||
) |
Disconnects a given tm2 controller
[in] | device | Device to disconnect the controller from |
[in] | id | The ID of the desired controller |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_enter_update_state | ( | const rs2_device * | device, |
rs2_error ** | error | ||
) |
Enter the device to update state, this will cause the updatable device to disconnect and reconnect as update device.
[in] | device | Device to update |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
const rs2_raw_data_buffer* rs2_get_calibration_table | ( | const rs2_device * | dev, |
rs2_error ** | error | ||
) |
Read current calibration table from flash.
int rs2_get_device_count | ( | const rs2_device_list * | info_list, |
rs2_error ** | error | ||
) |
Determines number of devices in a list.
[in] | info_list | The list of connected devices captured using rs2_query_devices |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
const char* rs2_get_device_info | ( | const rs2_device * | device, |
rs2_camera_info | info, | ||
rs2_error ** | error | ||
) |
Retrieve camera specific information, like versions of various internal components.
[in] | device | The RealSense device |
[in] | info | Camera info type to retrieve |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_hardware_reset | ( | const rs2_device * | device, |
rs2_error ** | error | ||
) |
Send hardware reset request to the device. The actual reset is asynchronous. Note: Invalidates all handles to this device.
[in] | device | The RealSense device to reset |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
int rs2_is_device_extendable_to | ( | const rs2_device * | device, |
rs2_extension | extension, | ||
rs2_error ** | error | ||
) |
Test if the given device can be extended to the requested extension.
[in] | device | Realsense device |
[in] | extension | The extension to which the device should be tested if it is extendable |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_load_json | ( | rs2_device * | dev, |
const void * | json_content, | ||
unsigned | content_size, | ||
rs2_error ** | error | ||
) |
void rs2_loopback_disable | ( | const rs2_device * | device, |
rs2_error ** | error | ||
) |
Restores the given device into normal operation mode
[in] | device | Device to restore to normal operation mode |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_loopback_enable | ( | const rs2_device * | device, |
const char * | from_file, | ||
rs2_error ** | error | ||
) |
Enter the given device into loopback operation mode that uses the given file as input for raw data
[in] | device | Device to enter into loopback operation mode |
[in] | from_file | Path to bag file with raw data for loopback |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
int rs2_loopback_is_enabled | ( | const rs2_device * | device, |
rs2_error ** | error | ||
) |
Checks if the device is in loopback mode or not
[in] | device | Device to check for operation mode |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
rs2_sensor_list* rs2_query_sensors | ( | const rs2_device * | device, |
rs2_error ** | error | ||
) |
Create a static snapshot of all connected sensors within a specific device.
[in] | device | Specific RealSense device |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_register_calibration_change_callback | ( | rs2_device * | dev, |
rs2_calibration_change_callback_ptr | callback, | ||
void * | user, | ||
rs2_error ** | error | ||
) |
Adds a callback for a sensor that gets called when calibration (intrinsics) changes, e.g. due to auto-calibration
[in] | sensor | the sensor |
[in] | callback | the C callback function that gets called |
[in] | user | user argument that gets passed to the callback function |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_register_calibration_change_callback_cpp | ( | rs2_device * | dev, |
rs2_calibration_change_callback * | callback, | ||
rs2_error ** | error | ||
) |
Adds a callback for a sensor that gets called when calibration (intrinsics) changes, e.g. due to auto-calibration
[in] | sensor | the sensor |
[in] | callback | the C++ callback interface that gets called |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_reset_to_factory_calibration | ( | const rs2_device * | device, |
rs2_error ** | e | ||
) |
Reset device to factory calibration
[in] | device | The RealSense device |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
const rs2_raw_data_buffer* rs2_run_on_chip_calibration | ( | rs2_device * | device, |
const void * | json_content, | ||
int | content_size, | ||
float * | health, | ||
rs2_update_progress_callback_ptr | callback, | ||
void * | client_data, | ||
int | timeout_ms, | ||
rs2_error ** | error | ||
) |
This will improve the depth noise.
[in] | json_content | Json string to configure speed on chip calibration parameters: { "speed": 3, "scan parameter": 0, "data sampling": 0 } speed - value can be one of: Very fast = 0, Fast = 1, Medium = 2, Slow = 3, White wall = 4, default is Slow scan_parameter - value can be one of: Py scan (default) = 0, Rx scan = 1 data_sampling - value can be one of:polling data sampling = 0, interrupt data sampling = 1 if json is nullptr it will be ignored and calibration will use the default parameters |
[out] | health | Calibration Health-Check captures how far camera calibration is from the optimal one [0, 0.25) - Good [0.25, 0.75) - Can be Improved [0.75, ) - Requires Calibration |
[in] | callback | Optional callback for update progress notifications, the progress value is normailzed to 1 |
[in] | client_data | Optional client data for the callback |
[in] | timeout_ms | Timeout in ms (use 5000 msec unless instructed otherwise) |
const rs2_raw_data_buffer* rs2_run_on_chip_calibration_cpp | ( | rs2_device * | device, |
const void * | json_content, | ||
int | content_size, | ||
float * | health, | ||
rs2_update_progress_callback * | progress_callback, | ||
int | timeout_ms, | ||
rs2_error ** | error | ||
) |
This will improve the depth noise.
[in] | json_content | Json string to configure speed on chip calibration parameters: { "speed": 3, "scan parameter": 0, "data sampling": 0 } speed - value can be one of: Very fast = 0, Fast = 1, Medium = 2, Slow = 3, White wall = 4, default is Slow scan_parameter - value can be one of: Py scan (default) = 0, Rx scan = 1 data_sampling - value can be one of:polling data sampling = 0, interrupt data sampling = 1 if json is nullptr it will be ignored and calibration will use the default parameters |
[out] | health | Calibration Health-Check captures how far camera calibration is from the optimal one [0, 0.25) - Good [0.25, 0.75) - Can be Improved [0.75, ) - Requires Calibration |
[in] | callback | Optional callback to get progress notifications |
[in] | timeout_ms | Timeout in ms (use 5000 msec unless instructed otherwise) |
const rs2_raw_data_buffer* rs2_run_tare_calibration | ( | rs2_device * | dev, |
float | ground_truth_mm, | ||
const void * | json_content, | ||
int | content_size, | ||
rs2_update_progress_callback_ptr | callback, | ||
void * | client_data, | ||
int | timeout_ms, | ||
rs2_error ** | error | ||
) |
This will adjust camera absolute distance to flat target. User needs to enter the known ground truth.
[in] | ground_truth_mm | Ground truth in mm must be between 2500 - 2000000 |
[in] | json_content | Json string to configure tare calibration parameters: { "average_step_count": 20, "step count": 20, "accuracy": 2, "scan parameter": 0, "data sampling": 0 } average step count - number of frames to average, must be between 1 - 30, default = 20 step count - max iteration steps, must be between 5 - 30, default = 10 accuracy - Subpixel accuracy level, value can be one of: Very high = 0 (0.025%), High = 1 (0.05%), Medium = 2 (0.1%), Low = 3 (0.2%), Default = Very high (0.025%), default is very high (0.025%) scan_parameter - value can be one of: Py scan (default) = 0, Rx scan = 1 data_sampling - value can be one of:polling data sampling = 0, interrupt data sampling = 1 if json is nullptr it will be ignored and calibration will use the default parameters |
[in] | content_size | Json string size if its 0 the json will be ignored and calibration will use the default parameters |
[in] | callback | Optional callback for update progress notifications, the progress value is normailzed to 1 |
[in] | client_data | Optional client data for the callback |
[in] | timeout_ms | Timeout in ms (use 5000 msec unless instructed otherwise) |
const rs2_raw_data_buffer* rs2_run_tare_calibration_cpp | ( | rs2_device * | dev, |
float | ground_truth_mm, | ||
const void * | json_content, | ||
int | content_size, | ||
rs2_update_progress_callback * | progress_callback, | ||
int | timeout_ms, | ||
rs2_error ** | error | ||
) |
This will adjust camera absolute distance to flat target. User needs to enter the known ground truth.
[in] | ground_truth_mm | Ground truth in mm must be between 2500 - 2000000 |
[in] | json_content | Json string to configure tare calibration parameters: { "average step count": 20, "step count": 20, "accuracy": 2, "scan parameter": 0, "data sampling": 0 } average step count - number of frames to average, must be between 1 - 30, default = 20 step count - max iteration steps, must be between 5 - 30, default = 10 accuracy - Subpixel accuracy level, value can be one of: Very high = 0 (0.025%), High = 1 (0.05%), Medium = 2 (0.1%), Low = 3 (0.2%), Default = Very high (0.025%), default is very high (0.025%) scan_parameter - value can be one of: Py scan (default) = 0, Rx scan = 1 data_sampling - value can be one of:polling data sampling = 0, interrupt data sampling = 1 if json is nullptr it will be ignored and calibration will use the default parameters |
[in] | content_size | Json string size if its 0 the json will be ignored and calibration will use the default parameters |
[in] | callback | Optional callback to get progress notifications |
[in] | timeout_ms | Timeout in ms (use 5000 msec unless instructed otherwise) |
const rs2_raw_data_buffer* rs2_send_and_receive_raw_data | ( | rs2_device * | device, |
void * | raw_data_to_send, | ||
unsigned | size_of_raw_data_to_send, | ||
rs2_error ** | error | ||
) |
Send raw data to device
[in] | device | RealSense device to send data to |
[in] | raw_data_to_send | Raw data to be sent to device |
[in] | size_of_raw_data_to_send | Size of raw_data_to_send in bytes |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
rs2_raw_data_buffer* rs2_serialize_json | ( | rs2_device * | dev, |
rs2_error ** | error | ||
) |
void rs2_set_calibration_table | ( | const rs2_device * | device, |
const void * | calibration, | ||
int | calibration_size, | ||
rs2_error ** | error | ||
) |
Set current table to dynamic area.
[in] | Calibration | table |
int rs2_supports_device_info | ( | const rs2_device * | device, |
rs2_camera_info | info, | ||
rs2_error ** | error | ||
) |
Check if a camera supports a specific camera info type.
[in] | device | The RealSense device to check |
[in] | info | The parameter to check for support |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_trigger_device_calibration | ( | rs2_device * | dev, |
rs2_calibration_type | type, | ||
rs2_error ** | error | ||
) |
Triggers calibration of the given type
[in] | dev | the device |
[in] | type | the type of calibration requested |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_update_firmware | ( | const rs2_device * | device, |
const void * | fw_image, | ||
int | fw_image_size, | ||
rs2_update_progress_callback_ptr | callback, | ||
void * | client_data, | ||
rs2_error ** | error | ||
) |
Update device to the provided firmware, the device must be extendable to RS2_EXTENSION_UPDATABLE. This call is executed on the caller's thread and it supports progress notifications via the optional callback.
[in] | device | Device to update |
[in] | fw_image | Firmware image buffer |
[in] | fw_image_size | Firmware image buffer size |
[in] | callback | Optional callback for update progress notifications, the progress value is normailzed to 1 |
[in] | client_data | Optional client data for the callback |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_update_firmware_cpp | ( | const rs2_device * | device, |
const void * | fw_image, | ||
int | fw_image_size, | ||
rs2_update_progress_callback * | callback, | ||
rs2_error ** | error | ||
) |
Update device to the provided firmware, the device must be extendable to RS2_EXTENSION_UPDATABLE. This call is executed on the caller's thread and it supports progress notifications via the optional callback.
[in] | device | Device to update |
[in] | fw_image | Firmware image buffer |
[in] | fw_image_size | Firmware image buffer size |
[in] | callback | Optional callback for update progress notifications, the progress value is normailzed to 1 |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_update_firmware_unsigned | ( | const rs2_device * | device, |
const void * | fw_image, | ||
int | fw_image_size, | ||
rs2_update_progress_callback_ptr | callback, | ||
void * | client_data, | ||
int | update_mode, | ||
rs2_error ** | error | ||
) |
Update device to the provided firmware by writing raw data directly to the flash, this command can be executed only on unlocked camera. The device must be extendable to RS2_EXTENSION_UPDATABLE. This call is executed on the caller's thread and it supports progress notifications via the optional callback.
[in] | device | Device to update |
[in] | fw_image | Firmware image buffer |
[in] | fw_image_size | Firmware image buffer size |
[in] | callback | Optional callback for update progress notifications, the progress value is normailzed to 1 |
[in] | client_data | Optional client data for the callback |
[in] | update_mode | Select one of RS2_UNSIGNED_UPDATE_MODE, WARNING!!! setting to any option other than RS2_UNSIGNED_UPDATE_MODE_UPDATE will make this call unsafe and might damage the camera |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_update_firmware_unsigned_cpp | ( | const rs2_device * | device, |
const void * | fw_image, | ||
int | fw_image_size, | ||
rs2_update_progress_callback * | callback, | ||
int | update_mode, | ||
rs2_error ** | error | ||
) |
Update device to the provided firmware by writing raw data directly to the flash, this command can be executed only on unlocked camera. The device must be extendable to RS2_EXTENSION_UPDATABLE. This call is executed on the caller's thread and it supports progress notifications via the optional callback.
[in] | device | Device to update |
[in] | fw_image | Firmware image buffer |
[in] | fw_image_size | Firmware image buffer size |
[in] | callback | Optional callback for update progress notifications, the progress value is normailzed to 1 |
[in] | update_mode | Select one of RS2_UNSIGNED_UPDATE_MODE, WARNING!!! setting to any option other than RS2_UNSIGNED_UPDATE_MODE_UPDATE will make this call unsafe and might damage the camera |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_write_calibration | ( | const rs2_device * | device, |
rs2_error ** | e | ||
) |
Write calibration to device's EEPROM
[in] | device | The RealSense device |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |