RealSense Cross Platform API
RealSense Cross-platform API
Loading...
Searching...
No Matches
rs_types.h
Go to the documentation of this file.
1/* License: Apache 2.0. See LICENSE file in root directory.
2 Copyright(c) 2017 RealSense, Inc. All Rights Reserved. */
3
8
9#ifndef LIBREALSENSE_RS2_TYPES_H
10#define LIBREALSENSE_RS2_TYPES_H
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#include <stdint.h>
17
30
45
58
60typedef struct rs2_intrinsics
61{
62 int width;
63 int height;
64 float ppx;
65 float ppy;
66 float fx;
67 float fy;
69 float coeffs[5];
71
74{
75 /* \internal
76 * Scale X cross axis cross axis Bias X \n
77 * cross axis Scale Y cross axis Bias Y \n
78 * cross axis cross axis Scale Z Bias Z */
79 float data[3][4];
80
81 float noise_variances[3];
82 float bias_variances[3];
84
87typedef struct rs2_vertex
88{
89 float xyz[3];
91
93typedef struct rs2_pixel
94{
95 int ij[2];
97
99typedef struct rs2_vector
100{
101 float x, y, z;
103
105typedef struct rs2_quaternion
106{
107 float x, y, z, w;
109
121
134
136// To add a new extension, append it at the end of this enum to preserve ordering.
137typedef enum rs2_extension
138{
207
209typedef enum rs2_matchers
210{
211 RS2_MATCHER_DI, //compare depth and ir based on frame number
212
213 RS2_MATCHER_DI_C, //compare depth and ir based on frame number,
214 //compare the pair of corresponding depth and ir with color based on closest timestamp,
215
216 RS2_MATCHER_DLR_C, //compare depth, left and right ir based on frame number,
217 //compare the set of corresponding depth, left and right with color based on closest timestamp,
218 //commonly used by RS415, RS435
219
220 RS2_MATCHER_DLR, //compare depth, left and right ir based on frame number,
221 //commonly used by RS400, RS405, RS410, RS420, RS430
222
223 RS2_MATCHER_DIC, //compare depth, ir and confidence based on frame number used by RS500
224
225 RS2_MATCHER_DIC_C, //compare depth, ir and confidence based on frame number,
226 //compare the set of corresponding depth, ir and confidence with color based on closest timestamp,
227 //commonly used by RS515
228
229 RS2_MATCHER_DEFAULT, //the default matcher compare all the streams based on closest timestamp
230
234
236{
237 RS2_POINT_CLOUD_LABEL_UNKNOWN, // No valid classification can be made for this point
239 RS2_POINT_CLOUD_LABEL_INVALID, // This point is discarded, i.e. outside of vertical FOV or too close
240 RS2_POINT_CLOUD_LABEL_GROUND, // This point belongs to ground plane
241 RS2_POINT_CLOUD_LABEL_NEAR_GROUND, // This point is not on ground plane, but yet not part of a true obstacle
242 RS2_POINT_CLOUD_LABEL_OVERHEAD, // This point belongs to something above robot's height, but below the ceiling height,
243 // and not part of a true obstacle
244 RS2_POINT_CLOUD_LABEL_ABOVE_CEILING_HEIGHT, // This point belongs to something above the ceiling height
245 RS2_POINT_CLOUD_LABEL_GAP, // This point belongs to a Gap Region
246 RS2_POINT_CLOUD_LABEL_MASKED, // This point belongs to a Masked Region
247 RS2_POINT_CLOUD_LABEL_CLIFF, // This point is part of a possible cliff
248 RS2_POINT_CLOUD_LABEL_OBSTACLE, // This point is a potential obstacle
249 RS2_POINT_CLOUD_LABEL_OBSTACLE_DANGER, // This point is an actual obstacle inside the danger zone
250 RS2_POINT_CLOUD_LABEL_OBSTACLE_WARNING, // This point is an actual obstacle inside the warning zone
254
264
273
275typedef struct rs2_device rs2_device;
276typedef struct rs2_error rs2_error;
279typedef struct rs2_frame rs2_frame;
283typedef struct rs2_config rs2_config;
290typedef struct rs2_syncer rs2_syncer;
292typedef struct rs2_source rs2_source;
300typedef struct rs2_sensor rs2_sensor;
314typedef void (*rs2_log_callback_ptr)(rs2_log_severity, rs2_log_message const *, void * arg);
318typedef void (*rs2_frame_callback_ptr)(rs2_frame*, void*);
320typedef void (*rs2_update_progress_callback_ptr)(const float, void*);
322
323typedef double rs2_time_t;
324typedef long long rs2_metadata_type;
325
326rs2_error * rs2_create_error(const char* what, const char* name, const char* args, rs2_exception_type type);
328const char* rs2_get_failed_function (const rs2_error* error);
329const char* rs2_get_failed_args (const rs2_error* error);
330const char* rs2_get_error_message (const rs2_error* error);
332
333
334#ifdef __cplusplus
335}
336#endif
337#endif
struct rs2_device_serializer rs2_device_serializer
Definition rs_types.h:291
const char * rs2_embedded_filter_type_to_string(rs2_embedded_filter_type embedded_filter)
struct rs2_sensor rs2_sensor
Definition rs_types.h:300
struct rs2_device_info rs2_device_info
Definition rs_types.h:274
const char * rs2_exception_type_to_string(rs2_exception_type type)
struct rs2_embedded_filter rs2_embedded_filter
Definition rs_types.h:301
rs2_calib_location
Definition rs_types.h:256
@ RS2_CALIB_LOCATION_COUNT
Definition rs_types.h:261
@ RS2_CALIB_LOCATION_RAM
Definition rs_types.h:260
@ RS2_CALIB_LOCATION_FLASH
Definition rs_types.h:259
@ RS2_CALIB_LOCATION_EEPROM
Definition rs_types.h:258
@ RS2_CALIB_LOCATION_FIRST
Definition rs_types.h:257
struct rs2_embedded_filter_list rs2_embedded_filter_list
Definition rs_types.h:302
rs2_exception_type rs2_get_librealsense_exception_type(const rs2_error *error)
const char * rs2_calib_location_to_string(rs2_calib_location calib_location)
struct rs2_syncer rs2_syncer
Definition rs_types.h:290
rs2_log_severity
Severity of the librealsense logger.
Definition rs_types.h:123
@ RS2_LOG_SEVERITY_WARN
Definition rs_types.h:126
@ RS2_LOG_SEVERITY_INFO
Definition rs_types.h:125
@ RS2_LOG_SEVERITY_ALL
Definition rs_types.h:131
@ RS2_LOG_SEVERITY_NONE
Definition rs_types.h:129
@ RS2_LOG_SEVERITY_DEBUG
Definition rs_types.h:124
@ RS2_LOG_SEVERITY_FATAL
Definition rs_types.h:128
@ RS2_LOG_SEVERITY_COUNT
Definition rs_types.h:130
@ RS2_LOG_SEVERITY_ERROR
Definition rs_types.h:127
struct rs2_stream_profile rs2_stream_profile
Definition rs_types.h:287
const char * rs2_matchers_to_string(rs2_matchers stream)
const char * rs2_distortion_to_string(rs2_distortion distortion)
struct rs2_pipeline_profile rs2_pipeline_profile
Definition rs_types.h:282
struct rs2_log_message rs2_log_message
Definition rs_types.h:277
rs2_point_cloud_label
Definition rs_types.h:236
@ RS2_POINT_CLOUD_LABEL_OBSTACLE_WARNING
Definition rs_types.h:250
@ RS2_POINT_CLOUD_LABEL_INVALID
Definition rs_types.h:239
@ RS2_POINT_CLOUD_LABEL_COUNT
Definition rs_types.h:251
@ RS2_POINT_CLOUD_LABEL_OBSTACLE_DANGER
Definition rs_types.h:249
@ RS2_POINT_CLOUD_LABEL_ABOVE_CEILING_HEIGHT
Definition rs_types.h:244
@ RS2_POINT_CLOUD_LABEL_NEAR_GROUND
Definition rs_types.h:241
@ RS2_POINT_CLOUD_LABEL_GAP
Definition rs_types.h:245
@ RS2_POINT_CLOUD_LABEL_CLIFF
Definition rs_types.h:247
@ RS2_POINT_CLOUD_LABEL_OBSTACLE
Definition rs_types.h:248
@ RS2_POINT_CLOUD_LABEL_OVERHEAD
Definition rs_types.h:242
@ RS2_POINT_CLOUD_LABEL_GROUND
Definition rs_types.h:240
@ RS2_POINT_CLOUD_LABEL_UNKNOWN
Definition rs_types.h:237
@ RS2_POINT_CLOUD_LABEL_MASKED
Definition rs_types.h:246
@ RS2_POINT_CLOUD_LABEL_UNDEFINED
Definition rs_types.h:238
const char * rs2_extension_type_to_string(rs2_extension type)
void(* rs2_frame_processor_callback_ptr)(rs2_frame *, rs2_source *, void *)
Definition rs_types.h:319
const char * rs2_point_cloud_label_to_string(rs2_point_cloud_label label)
void rs2_free_error(rs2_error *error)
rs2_notification_category
Category of the librealsense notification.
Definition rs_types.h:19
@ RS2_NOTIFICATION_CATEGORY_POSE_RELOCALIZATION
Definition rs_types.h:26
@ RS2_NOTIFICATION_CATEGORY_FIRMWARE_UPDATE_RECOMMENDED
Definition rs_types.h:25
@ RS2_NOTIFICATION_CATEGORY_UNKNOWN_ERROR
Definition rs_types.h:24
@ RS2_NOTIFICATION_CATEGORY_FRAMES_TIMEOUT
Definition rs_types.h:20
@ RS2_NOTIFICATION_CATEGORY_HARDWARE_EVENT
Definition rs_types.h:23
@ RS2_NOTIFICATION_CATEGORY_FRAME_CORRUPTED
Definition rs_types.h:21
@ RS2_NOTIFICATION_CATEGORY_COUNT
Definition rs_types.h:27
@ RS2_NOTIFICATION_CATEGORY_HARDWARE_ERROR
Definition rs_types.h:22
const char * rs2_get_failed_args(const rs2_error *error)
void(* rs2_software_device_destruction_callback_ptr)(void *)
Definition rs_types.h:316
void(* rs2_update_progress_callback_ptr)(const float, void *)
Definition rs_types.h:320
struct rs2_processing_block_list rs2_processing_block_list
Definition rs_types.h:286
struct rs2_sensor_list rs2_sensor_list
Definition rs_types.h:299
void(* rs2_notification_callback_ptr)(rs2_notification *, void *)
Definition rs_types.h:315
struct rs2_device rs2_device
Definition rs_types.h:275
struct rs2_source rs2_source
Definition rs_types.h:292
struct rs2_firmware_log_message rs2_firmware_log_message
Definition rs_types.h:310
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition rs_types.h:138
@ RS2_EXTENSION_MOTION_FRAME
Definition rs_types.h:148
@ RS2_EXTENSION_INFO
Definition rs_types.h:141
@ RS2_EXTENSION_HDR_MERGE
Definition rs_types.h:190
@ RS2_EXTENSION_COUNT
Definition rs_types.h:203
@ RS2_EXTENSION_FW_LOGGER
Definition rs_types.h:186
@ RS2_EXTENSION_HOLE_FILLING_FILTER
Definition rs_types.h:169
@ RS2_EXTENSION_MOTION_PROFILE
Definition rs_types.h:158
@ RS2_EXTENSION_DEBUG
Definition rs_types.h:140
@ RS2_EXTENSION_UPDATABLE
Definition rs_types.h:176
@ RS2_EXTENSION_L500_DEPTH_SENSOR
Definition rs_types.h:178
@ RS2_EXTENSION_FISHEYE_SENSOR
Definition rs_types.h:183
@ RS2_EXTENSION_DISPARITY_FRAME
Definition rs_types.h:157
@ RS2_EXTENSION_ZERO_ORDER_FILTER
Definition rs_types.h:170
@ RS2_EXTENSION_DISPARITY_FILTER
Definition rs_types.h:166
@ RS2_EXTENSION_SUPPORTED_EMBEDDED_FILTERS
Definition rs_types.h:200
@ RS2_EXTENSION_TEMPORAL_FILTER
Definition rs_types.h:168
@ RS2_EXTENSION_POSE_PROFILE
Definition rs_types.h:160
@ RS2_EXTENSION_ROTATION_FILTER
Definition rs_types.h:195
@ RS2_EXTENSION_VIDEO_PROFILE
Definition rs_types.h:154
@ RS2_EXTENSION_POSE_SENSOR
Definition rs_types.h:173
@ RS2_EXTENSION_DEPTH_HUFFMAN_DECODER
Definition rs_types.h:184
@ RS2_EXTENSION_DEPTH_SENSOR
Definition rs_types.h:146
@ RS2_EXTENSION_VIDEO_FRAME
Definition rs_types.h:147
@ RS2_EXTENSION_PLAYBACK
Definition rs_types.h:155
@ RS2_EXTENSION_AUTO_CALIBRATED_DEVICE
Definition rs_types.h:180
@ RS2_EXTENSION_TEMPORAL_EMBEDDED_FILTER
Definition rs_types.h:202
@ RS2_EXTENSION_SPATIAL_FILTER
Definition rs_types.h:167
@ RS2_EXTENSION_DECIMATION_FILTER
Definition rs_types.h:164
@ RS2_EXTENSION_SERIALIZABLE
Definition rs_types.h:185
@ RS2_EXTENSION_SEQUENCE_ID_FILTER
Definition rs_types.h:191
@ RS2_EXTENSION_TM2
Definition rs_types.h:161
@ RS2_EXTENSION_MOTION
Definition rs_types.h:142
@ RS2_EXTENSION_VIDEO
Definition rs_types.h:144
@ RS2_EXTENSION_SAFETY_SENSOR
Definition rs_types.h:196
@ RS2_EXTENSION_UNKNOWN
Definition rs_types.h:139
@ RS2_EXTENSION_SOFTWARE_DEVICE
Definition rs_types.h:162
@ RS2_EXTENSION_THRESHOLD_FILTER
Definition rs_types.h:165
@ RS2_EXTENSION_POSE
Definition rs_types.h:172
@ RS2_EXTENSION_ROI
Definition rs_types.h:145
@ RS2_EXTENSION_RECOMMENDED_FILTERS
Definition rs_types.h:171
@ RS2_EXTENSION_COMPOSITE_FRAME
Definition rs_types.h:149
@ RS2_EXTENSION_DEBUG_STREAM_SENSOR
Definition rs_types.h:193
@ RS2_EXTENSION_WHEEL_ODOMETER
Definition rs_types.h:174
@ RS2_EXTENSION_DECIMATION_EMBEDDED_FILTER
Definition rs_types.h:201
@ RS2_EXTENSION_DEPTH_FRAME
Definition rs_types.h:151
@ RS2_EXTENSION_DEVICE_CALIBRATION
Definition rs_types.h:188
@ RS2_EXTENSION_DEPTH_MAPPING_SENSOR
Definition rs_types.h:197
@ RS2_EXTENSION_TM2_SENSOR
Definition rs_types.h:179
@ RS2_EXTENSION_COLOR_SENSOR
Definition rs_types.h:181
@ RS2_EXTENSION_SOFTWARE_SENSOR
Definition rs_types.h:163
@ RS2_EXTENSION_MAX_USABLE_RANGE_SENSOR
Definition rs_types.h:192
@ RS2_EXTENSION_CALIBRATED_SENSOR
Definition rs_types.h:189
@ RS2_EXTENSION_LABELED_POINTS
Definition rs_types.h:198
@ RS2_EXTENSION_OPTIONS
Definition rs_types.h:143
@ RS2_EXTENSION_UPDATE_DEVICE
Definition rs_types.h:177
@ RS2_EXTENSION_CALIBRATION_CHANGE_DEVICE
Definition rs_types.h:194
@ RS2_EXTENSION_GLOBAL_TIMER
Definition rs_types.h:175
@ RS2_EXTENSION_RECORD
Definition rs_types.h:153
@ RS2_EXTENSION_ETH_CONFIG
Definition rs_types.h:199
@ RS2_EXTENSION_AUTO_CALIBRATION_FILTER
Definition rs_types.h:187
@ RS2_EXTENSION_DEPTH_STEREO_SENSOR
Definition rs_types.h:156
@ RS2_EXTENSION_MOTION_SENSOR
Definition rs_types.h:182
@ RS2_EXTENSION_POINTS
Definition rs_types.h:150
@ RS2_EXTENSION_ADVANCED_MODE
Definition rs_types.h:152
@ RS2_EXTENSION_POSE_FRAME
Definition rs_types.h:159
double rs2_time_t
Definition rs_types.h:323
rs2_error * rs2_create_error(const char *what, const char *name, const char *args, rs2_exception_type type)
struct rs2_firmware_log_parser rs2_firmware_log_parser
Definition rs_types.h:312
void(* rs2_options_changed_callback_ptr)(const rs2_options_list *)
Definition rs_types.h:321
const char * rs2_get_error_message(const rs2_error *error)
rs2_distortion
Distortion model: defines how pixel coordinates should be mapped to sensor coordinates.
Definition rs_types.h:48
@ RS2_DISTORTION_COUNT
Definition rs_types.h:55
@ RS2_DISTORTION_KANNALA_BRANDT4
Definition rs_types.h:54
@ RS2_DISTORTION_MODIFIED_BROWN_CONRADY
Definition rs_types.h:50
@ RS2_DISTORTION_BROWN_CONRADY
Definition rs_types.h:53
@ RS2_DISTORTION_NONE
Definition rs_types.h:49
@ RS2_DISTORTION_INVERSE_BROWN_CONRADY
Definition rs_types.h:51
@ RS2_DISTORTION_FTHETA
Definition rs_types.h:52
struct rs2_notification rs2_notification
Definition rs_types.h:308
void(* rs2_frame_callback_ptr)(rs2_frame *, void *)
Definition rs_types.h:318
struct rs2_firmware_log_parsed_message rs2_firmware_log_parsed_message
Definition rs_types.h:311
const char * rs2_get_failed_function(const rs2_error *error)
const char * rs2_log_severity_to_string(rs2_log_severity info)
struct rs2_stream_profile_list rs2_stream_profile_list
Definition rs_types.h:285
struct rs2_device_list rs2_device_list
Definition rs_types.h:284
struct rs2_error rs2_error
Definition rs_types.h:276
rs2_exception_type
Exception types are the different categories of errors that RealSense API might return.
Definition rs_types.h:33
@ RS2_EXCEPTION_TYPE_NOT_IMPLEMENTED
Definition rs_types.h:39
@ RS2_EXCEPTION_TYPE_COUNT
Definition rs_types.h:42
@ RS2_EXCEPTION_TYPE_CAMERA_DISCONNECTED
Definition rs_types.h:35
@ RS2_EXCEPTION_TYPE_BACKEND
Definition rs_types.h:36
@ RS2_EXCEPTION_TYPE_INVALID_VALUE
Definition rs_types.h:37
@ RS2_EXCEPTION_TYPE_UNKNOWN
Definition rs_types.h:34
@ RS2_EXCEPTION_TYPE_DEVICE_IN_RECOVERY_MODE
Definition rs_types.h:40
@ RS2_EXCEPTION_TYPE_WRONG_API_CALL_SEQUENCE
Definition rs_types.h:38
@ RS2_EXCEPTION_TYPE_IO
Definition rs_types.h:41
struct rs2_raw_data_buffer rs2_raw_data_buffer
Definition rs_types.h:278
struct rs2_device_hub rs2_device_hub
Definition rs_types.h:298
rs2_matchers
Specifies types of different matchers.
Definition rs_types.h:210
@ RS2_MATCHER_DLR
Definition rs_types.h:220
@ RS2_MATCHER_DIC_C
Definition rs_types.h:225
@ RS2_MATCHER_DEFAULT
Definition rs_types.h:229
@ RS2_MATCHER_DI
Definition rs_types.h:211
@ RS2_MATCHER_DIC
Definition rs_types.h:223
@ RS2_MATCHER_DLR_C
Definition rs_types.h:216
@ RS2_MATCHER_COUNT
Definition rs_types.h:231
@ RS2_MATCHER_DI_C
Definition rs_types.h:213
const char * rs2_notification_category_to_string(rs2_notification_category category)
rs2_embedded_filter_type
Definition rs_types.h:266
@ RS2_EMBEDDED_FILTER_TYPE_DECIMATION
Definition rs_types.h:268
@ RS2_EMBEDDED_FILTER_TYPE_FIRST
Definition rs_types.h:267
@ RS2_EMBEDDED_FILTER_TYPE_COUNT
Definition rs_types.h:270
@ RS2_EMBEDDED_FILTER_TYPE_TEMPORAL
Definition rs_types.h:269
void(* rs2_devices_changed_callback_ptr)(rs2_device_list *, rs2_device_list *, void *)
Definition rs_types.h:317
struct rs2_config rs2_config
Definition rs_types.h:283
struct rs2_options_list rs2_options_list
Definition rs_types.h:304
struct rs2_pipeline rs2_pipeline
Definition rs_types.h:281
struct rs2_options rs2_options
Definition rs_types.h:303
struct rs2_terminal_parser rs2_terminal_parser
Definition rs_types.h:313
struct rs2_frame_queue rs2_frame_queue
Definition rs_types.h:280
long long rs2_metadata_type
Definition rs_types.h:324
struct rs2_frame rs2_frame
Definition rs_types.h:279
void(* rs2_log_callback_ptr)(rs2_log_severity, rs2_log_message const *, void *arg)
Definition rs_types.h:314
struct rs2_processing_block rs2_processing_block
Definition rs_types.h:293
const char * rs2_extension_to_string(rs2_extension type)
struct rs2_context rs2_context
Definition rs_types.h:297
Definition rs_types.hpp:82
Definition rs_types.hpp:27
Definition rs_types.hpp:40
Video stream intrinsics.
Definition rs_types.h:61
int height
Definition rs_types.h:63
float fx
Definition rs_types.h:66
float fy
Definition rs_types.h:67
float ppx
Definition rs_types.h:64
rs2_distortion model
Definition rs_types.h:68
int width
Definition rs_types.h:62
float ppy
Definition rs_types.h:65
float coeffs[5]
Definition rs_types.h:69
Definition rs_types.hpp:66
Motion device intrinsics: scale, bias, and variances.
Definition rs_types.h:74
float bias_variances[3]
Definition rs_types.h:82
float data[3][4]
Definition rs_types.h:79
float noise_variances[3]
Definition rs_types.h:81
Definition rs_types.hpp:48
Definition rs_types.hpp:106
Pixel location within 2D image. (0,0) is the topmost, left corner. Positive X is right,...
Definition rs_types.h:94
int ij[2]
Definition rs_types.h:95
Definition rs_types.hpp:90
Definition rs_types.h:111
rs2_vector acceleration
Definition rs_types.h:114
rs2_vector angular_acceleration
Definition rs_types.h:117
rs2_vector velocity
Definition rs_types.h:113
unsigned int mapper_confidence
Definition rs_types.h:119
rs2_vector angular_velocity
Definition rs_types.h:116
unsigned int tracker_confidence
Definition rs_types.h:118
rs2_vector translation
Definition rs_types.h:112
rs2_quaternion rotation
Definition rs_types.h:115
Quaternion used to represent rotation.
Definition rs_types.h:106
float y
Definition rs_types.h:107
float z
Definition rs_types.h:107
float w
Definition rs_types.h:107
float x
Definition rs_types.h:107
Definition rs_types.hpp:35
Definition rs_types.hpp:98
3D vector in Euclidean coordinate space
Definition rs_types.h:100
float x
Definition rs_types.h:101
float y
Definition rs_types.h:101
float z
Definition rs_types.h:101
3D coordinates with origin at topmost left corner of the lense, with positive Z pointing away from th...
Definition rs_types.h:88
float xyz[3]
Definition rs_types.h:89