Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
rs_sensor.h
Go to the documentation of this file.
1 /* License: Apache 2.0. See LICENSE file in root directory.
2  Copyright(c) 2017 Intel Corporation. All Rights Reserved. */
3 
10 #ifndef LIBREALSENSE_RS2_SENSOR_H
11 #define LIBREALSENSE_RS2_SENSOR_H
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 #include "rs_types.h"
18 
22 typedef enum rs2_camera_info {
41 
43 typedef enum rs2_stream
44 {
57 } rs2_stream;
58 const char* rs2_stream_to_string(rs2_stream stream);
59 
61 typedef enum rs2_format
62 {
98 } rs2_format;
99 const char* rs2_format_to_string(rs2_format format);
100 
102 typedef struct rs2_extrinsics
103 {
104  float rotation[9];
105  float translation[3];
107 
109 typedef struct rs2_combined_motion
110 {
111  struct { double x, y, z, w; } orientation;
112  struct { double x, y, z; } angular_velocity;
113  struct { double x, y, z; } linear_acceleration;
115 
120 void rs2_delete_sensor_list(rs2_sensor_list* info_list);
121 
128 int rs2_get_sensors_count(const rs2_sensor_list* info_list, rs2_error** error);
129 
134 void rs2_delete_sensor(rs2_sensor* sensor);
135 
142 rs2_sensor* rs2_create_sensor(const rs2_sensor_list* list, int index, rs2_error** error);
143 
151 
159 const char* rs2_get_sensor_info(const rs2_sensor* sensor, rs2_camera_info info, rs2_error** error);
160 
167 int rs2_supports_sensor_info(const rs2_sensor* sensor, rs2_camera_info info, rs2_error** error);
168 
176 int rs2_is_sensor_extendable_to(const rs2_sensor* sensor, rs2_extension extension, rs2_error** error);
177 
183 float rs2_get_depth_scale(rs2_sensor* sensor, rs2_error** error);
184 
190 float rs2_depth_stereo_frame_get_baseline(const rs2_frame* frame_ref, rs2_error** error);
191 
197 float rs2_get_stereo_baseline(rs2_sensor* sensor, rs2_error** error);
198 
208 void rs2_set_region_of_interest(const rs2_sensor* sensor, int min_x, int min_y, int max_x, int max_y, rs2_error** error);
209 
219 void rs2_get_region_of_interest(const rs2_sensor* sensor, int* min_x, int* min_y, int* max_x, int* max_y, rs2_error** error);
220 
227 void rs2_open(rs2_sensor* device, const rs2_stream_profile* profile, rs2_error** error);
228 
237 void rs2_open_multiple(rs2_sensor* device, const rs2_stream_profile** profiles, int count, rs2_error** error);
238 
244 void rs2_close(const rs2_sensor* sensor, rs2_error** error);
245 
253 void rs2_start(const rs2_sensor* sensor, rs2_frame_callback_ptr on_frame, void* user, rs2_error** error);
254 
261 void rs2_start_cpp(const rs2_sensor* sensor, rs2_frame_callback* callback, rs2_error** error);
262 
269 void rs2_start_queue(const rs2_sensor* sensor, rs2_frame_queue* queue, rs2_error** error);
270 
276 void rs2_stop(const rs2_sensor* sensor, rs2_error** error);
277 
284 void rs2_set_notifications_callback(const rs2_sensor* sensor, rs2_notification_callback_ptr on_notification, void* user, rs2_error** error);
285 
293 
300 const char* rs2_get_notification_description(rs2_notification* notification, rs2_error** error);
301 
309 
317 
325 
332 const char* rs2_get_notification_serialized_data(rs2_notification* notification, rs2_error** error);
333 
341 
349 
357 
364 const rs2_stream_profile* rs2_get_stream_profile(const rs2_stream_profile_list* list, int index, rs2_error** error);
365 
376 void rs2_get_stream_profile_data(const rs2_stream_profile* mode, rs2_stream* stream, rs2_format* format, int* index, int* unique_id, int* framerate, rs2_error** error);
377 
386 void rs2_set_stream_profile_data(rs2_stream_profile* mode, rs2_stream stream, int index, rs2_format format, rs2_error** error);
387 
397 rs2_stream_profile* rs2_clone_stream_profile(const rs2_stream_profile* mode, rs2_stream stream, int index, rs2_format format, rs2_error** error);
398 
411 rs2_stream_profile* rs2_clone_video_stream_profile(const rs2_stream_profile* mode, rs2_stream stream, int index, rs2_format format, int width, int height, const rs2_intrinsics* intr, rs2_error** error);
412 
413 
420 
428 int rs2_stream_profile_is(const rs2_stream_profile* mode, rs2_extension type, rs2_error** error);
429 
437 void rs2_get_video_stream_resolution(const rs2_stream_profile* mode, int* width, int* height, rs2_error** error);
438 
446 
455 
463 
469 
476 void rs2_get_extrinsics(const rs2_stream_profile* from,
477  const rs2_stream_profile* to,
478  rs2_extrinsics* extrin, rs2_error** error);
479 
487  const rs2_stream_profile* to,
488  rs2_extrinsics extrin, rs2_error** error);
489 
499 void rs2_override_extrinsics( const rs2_sensor* sensor, const rs2_extrinsics* extrinsics, rs2_error** error );
500 
507 void rs2_get_video_stream_intrinsics(const rs2_stream_profile* mode, rs2_intrinsics* intrinsics, rs2_error** error);
508 
517 
526 
534 
540 
549 int rs2_import_localization_map(const rs2_sensor* sensor, const unsigned char* lmap_blob, unsigned int blob_size, rs2_error** error);
550 
558 //void rs2_export_localization_map(const rs2_sensor* sensor, const char* lmap_fname, rs2_error** error);
560 
570 int rs2_set_static_node(const rs2_sensor* sensor, const char* guid, const rs2_vector pos, const rs2_quaternion orient, rs2_error** error);
571 
581 int rs2_get_static_node(const rs2_sensor* sensor, const char* guid, rs2_vector *pos, rs2_quaternion *orient, rs2_error** error);
582 
590 int rs2_remove_static_node(const rs2_sensor* sensor, const char* guid, rs2_error** error);
591 
596 int rs2_load_wheel_odometry_config(const rs2_sensor* sensor, const unsigned char* odometry_config_buf, unsigned int blob_size, rs2_error** error);
597 
604 int rs2_send_wheel_odometry(const rs2_sensor* sensor, char wo_sensor_id, unsigned int frame_num,
605  const rs2_vector translational_velocity, rs2_error** error);
606 
614 void rs2_set_intrinsics(const rs2_sensor* sensor, const rs2_stream_profile* profile , const rs2_intrinsics* intrinsics, rs2_error** error);
615 
625 void rs2_override_intrinsics( const rs2_sensor* sensor, const rs2_intrinsics* intrinsics, rs2_error** error );
626 
636 void rs2_set_extrinsics(const rs2_sensor* from_sensor, const rs2_stream_profile* from_profile, rs2_sensor* to_sensor, const rs2_stream_profile* to_profile, const rs2_extrinsics* extrinsics, rs2_error** error);
637 
644 void rs2_reset_sensor_calibration( rs2_sensor const * sensor, rs2_error** error );
645 
653 void rs2_set_motion_device_intrinsics(const rs2_sensor* sensor, const rs2_stream_profile* profile, const rs2_motion_device_intrinsic* intrinsics, rs2_error** error);
654 
660 float rs2_get_max_usable_depth_range(rs2_sensor const * sensor, rs2_error** error);
661 
662 #ifdef __cplusplus
663 }
664 #endif
665 #endif // LIBREALSENSE_RS2_SENSOR_H
Definition: rs_sensor.h:33
Definition: rs_sensor.h:78
struct rs2_processing_block_list rs2_processing_block_list
Definition: rs_types.h:239
void rs2_register_extrinsics(const rs2_stream_profile *from, const rs2_stream_profile *to, rs2_extrinsics extrin, rs2_error **error)
int rs2_get_sensors_count(const rs2_sensor_list *info_list, rs2_error **error)
rs2_camera_info
Read-only strings that can be queried from the device. Not all information attributes are available o...
Definition: rs_sensor.h:22
Definition: rs_types.hpp:26
const char * rs2_format_to_string(rs2_format format)
Definition: rs_sensor.h:69
struct rs2_raw_data_buffer rs2_raw_data_buffer
Definition: rs_types.h:231
Definition: rs_sensor.h:82
float rs2_get_depth_scale(rs2_sensor *sensor, rs2_error **error)
Definition: rs_sensor.h:27
Definition: rs_sensor.h:92
Definition: rs_sensor.h:28
Definition: rs_types.hpp:42
Definition: rs_sensor.h:55
struct rs2_frame_queue rs2_frame_queue
Definition: rs_types.h:233
void rs2_get_video_stream_resolution(const rs2_stream_profile *mode, int *width, int *height, rs2_error **error)
void rs2_set_intrinsics(const rs2_sensor *sensor, const rs2_stream_profile *profile, const rs2_intrinsics *intrinsics, rs2_error **error)
rs2_sensor * rs2_create_sensor(const rs2_sensor_list *list, int index, rs2_error **error)
Definition: rs_sensor.h:24
int rs2_get_static_node(const rs2_sensor *sensor, const char *guid, rs2_vector *pos, rs2_quaternion *orient, rs2_error **error)
float translation[3]
Definition: rs_sensor.h:105
float rs2_get_max_usable_depth_range(rs2_sensor const *sensor, rs2_error **error)
double x
Definition: rs_sensor.h:111
Definition: rs_sensor.h:30
void rs2_get_extrinsics(const rs2_stream_profile *from, const rs2_stream_profile *to, rs2_extrinsics *extrin, rs2_error **error)
rs2_device * rs2_create_device_from_sensor(const rs2_sensor *sensor, rs2_error **error)
Definition: rs_sensor.h:81
struct rs2_combined_motion::@3 angular_velocity
void rs2_set_region_of_interest(const rs2_sensor *sensor, int min_x, int min_y, int max_x, int max_y, rs2_error **error)
sets the active region of interest to be used by auto-exposure algorithm
Definition: rs_sensor.h:31
Definition: rs_sensor.h:64
Definition: rs_sensor.h:49
Definition: rs_sensor.h:84
int rs2_import_localization_map(const rs2_sensor *sensor, const unsigned char *lmap_blob, unsigned int blob_size, rs2_error **error)
Definition: rs_sensor.h:89
struct rs2_sensor_list rs2_sensor_list
Definition: rs_types.h:252
Definition: rs_sensor.h:53
void rs2_stop(const rs2_sensor *sensor, rs2_error **error)
Definition: rs_sensor.h:67
void rs2_start_queue(const rs2_sensor *sensor, rs2_frame_queue *queue, rs2_error **error)
int rs2_stream_profile_is(const rs2_stream_profile *mode, rs2_extension type, rs2_error **error)
Definition: rs_sensor.h:95
const char * rs2_get_notification_serialized_data(rs2_notification *notification, rs2_error **error)
Definition: rs_sensor.h:23
Definition: rs_sensor.h:52
rs2_log_severity rs2_get_notification_severity(rs2_notification *notification, rs2_error **error)
Definition: rs_sensor.h:34
Definition: rs_sensor.h:65
Definition: rs_sensor.h:50
rs2_stream_profile * rs2_clone_stream_profile(const rs2_stream_profile *mode, rs2_stream stream, int index, rs2_format format, rs2_error **error)
Definition: rs_sensor.h:93
rs2_stream_profile_list * rs2_get_active_streams(rs2_sensor *sensor, rs2_error **error)
struct rs2_combined_motion::@2 orientation
struct rs2_sensor rs2_sensor
Definition: rs_types.h:253
float rotation[9]
Definition: rs_sensor.h:104
Definition: rs_sensor.h:47
rs2_stream_profile_list * rs2_get_stream_profiles(rs2_sensor *sensor, rs2_error **error)
void rs2_open(rs2_sensor *device, const rs2_stream_profile *profile, rs2_error **error)
void rs2_set_stream_profile_data(rs2_stream_profile *mode, rs2_stream stream, int index, rs2_format format, rs2_error **error)
Definition: rs_sensor.h:68
Quaternion used to represent rotation.
Definition: rs_types.h:105
rs2_stream_profile_list * rs2_get_debug_stream_profiles(rs2_sensor *sensor, rs2_error **error)
Definition: rs_sensor.h:66
void rs2_get_stream_profile_data(const rs2_stream_profile *mode, rs2_stream *stream, rs2_format *format, int *index, int *unique_id, int *framerate, rs2_error **error)
Definition: rs_sensor.h:85
struct rs2_notification rs2_notification
Definition: rs_types.h:258
int rs2_is_stream_profile_default(const rs2_stream_profile *mode, rs2_error **error)
double w
Definition: rs_sensor.h:111
Exposes RealSense structs.
void rs2_start(const rs2_sensor *sensor, rs2_frame_callback_ptr on_frame, void *user, rs2_error **error)
void rs2_set_notifications_callback(const rs2_sensor *sensor, rs2_notification_callback_ptr on_notification, void *user, rs2_error **error)
float rs2_get_stereo_baseline(rs2_sensor *sensor, rs2_error **error)
int rs2_get_recommended_processing_blocks_count(const rs2_processing_block_list *list, rs2_error **error)
void rs2_delete_sensor(rs2_sensor *sensor)
void rs2_get_region_of_interest(const rs2_sensor *sensor, int *min_x, int *min_y, int *max_x, int *max_y, rs2_error **error)
gets the active region of interest to be used by auto-exposure algorithm
Definition: rs_sensor.h:56
rs2_time_t rs2_get_notification_timestamp(rs2_notification *notification, rs2_error **error)
Definition: rs_sensor.h:32
void rs2_set_extrinsics(const rs2_sensor *from_sensor, const rs2_stream_profile *from_profile, rs2_sensor *to_sensor, const rs2_stream_profile *to_profile, const rs2_extrinsics *extrinsics, rs2_error **error)
RS2_STREAM_MOTION / RS2_FORMAT_COMBINED_MOTION content is similar to ROS2's Imu message.
Definition: rs_sensor.h:109
int rs2_remove_static_node(const rs2_sensor *sensor, const char *guid, rs2_error **error)
Definition: rs_sensor.h:54
Definition: rs_sensor.h:83
void rs2_delete_stream_profile(rs2_stream_profile *mode)
struct rs2_stream_profile_list rs2_stream_profile_list
Definition: rs_types.h:238
const rs2_stream_profile * rs2_get_stream_profile(const rs2_stream_profile_list *list, int index, rs2_error **error)
Definition: rs_sensor.h:90
void rs2_set_notifications_callback_cpp(const rs2_sensor *sensor, rs2_notifications_callback *callback, rs2_error **error)
void rs2_reset_sensor_calibration(rs2_sensor const *sensor, rs2_error **error)
Definition: rs_sensor.h:88
struct rs2_stream_profile rs2_stream_profile
Definition: rs_types.h:240
Definition: rs_sensor.h:63
Definition: rs_sensor.h:94
rs2_format
A stream's format identifies how binary data is encoded within a frame.
Definition: rs_sensor.h:61
int rs2_supports_sensor_info(const rs2_sensor *sensor, rs2_camera_info info, rs2_error **error)
Definition: rs_sensor.h:25
void rs2_delete_recommended_processing_blocks(rs2_processing_block_list *list)
Definition: rs_sensor.h:77
Definition: rs_sensor.h:38
Definition: rs_sensor.h:97
Definition: rs_sensor.h:79
Definition: rs_sensor.h:36
Definition: rs_sensor.h:46
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:43
void rs2_override_extrinsics(const rs2_sensor *sensor, const rs2_extrinsics *extrinsics, rs2_error **error)
Override extrinsics of a given sensor that supports calibrated_sensor.
struct rs2_combined_motion rs2_combined_motion
RS2_STREAM_MOTION / RS2_FORMAT_COMBINED_MOTION content is similar to ROS2's Imu message.
void rs2_set_motion_device_intrinsics(const rs2_sensor *sensor, const rs2_stream_profile *profile, const rs2_motion_device_intrinsic *intrinsics, rs2_error **error)
void rs2_get_video_stream_intrinsics(const rs2_stream_profile *mode, rs2_intrinsics *intrinsics, rs2_error **error)
Definition: rs_sensor.h:48
Definition: rs_sensor.h:51
Definition: rs_sensor.h:75
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
Definition: rs_sensor.h:102
Definition: rs_sensor.h:96
struct rs2_combined_motion::@4 linear_acceleration
const char * rs2_camera_info_to_string(rs2_camera_info info)
int rs2_is_sensor_extendable_to(const rs2_sensor *sensor, rs2_extension extension, rs2_error **error)
3D vector in Euclidean coordinate space
Definition: rs_types.h:99
struct rs2_processing_block rs2_processing_block
Definition: rs_types.h:246
const char * rs2_stream_to_string(rs2_stream stream)
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:136
double z
Definition: rs_sensor.h:111
rs2_notification_category
Category of the librealsense notification.
Definition: rs_types.h:19
Definition: rs_sensor.h:45
void(* rs2_notification_callback_ptr)(rs2_notification *, void *)
Definition: rs_types.h:265
Definition: rs_sensor.h:37
void rs2_delete_stream_profiles_list(rs2_stream_profile_list *list)
void rs2_close(const rs2_sensor *sensor, rs2_error **error)
double y
Definition: rs_sensor.h:111
struct rs2_device rs2_device
Definition: rs_types.h:228
Video stream intrinsics.
Definition: rs_types.h:60
rs2_stream_profile * rs2_clone_video_stream_profile(const rs2_stream_profile *mode, rs2_stream stream, int index, rs2_format format, int width, int height, const rs2_intrinsics *intr, rs2_error **error)
void rs2_open_multiple(rs2_sensor *device, const rs2_stream_profile **profiles, int count, rs2_error **error)
void rs2_start_cpp(const rs2_sensor *sensor, rs2_frame_callback *callback, rs2_error **error)
Definition: rs_sensor.h:71
rs2_notification_category rs2_get_notification_category(rs2_notification *notification, rs2_error **error)
rs2_processing_block * rs2_get_processing_block(const rs2_processing_block_list *list, int index, rs2_error **error)
Motion device intrinsics: scale, bias, and variances.
Definition: rs_types.h:73
struct rs2_extrinsics rs2_extrinsics
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
void rs2_delete_sensor_list(rs2_sensor_list *info_list)
Definition: rs_sensor.h:35
int rs2_set_static_node(const rs2_sensor *sensor, const char *guid, const rs2_vector pos, const rs2_quaternion orient, rs2_error **error)
void(* rs2_frame_callback_ptr)(rs2_frame *, void *)
Definition: rs_types.h:268
Definition: rs_sensor.h:80
const rs2_raw_data_buffer * rs2_export_localization_map(const rs2_sensor *sensor, rs2_error **error)
float rs2_depth_stereo_frame_get_baseline(const rs2_frame *frame_ref, rs2_error **error)
const char * rs2_get_sensor_info(const rs2_sensor *sensor, rs2_camera_info info, rs2_error **error)
const char * rs2_get_notification_description(rs2_notification *notification, rs2_error **error)
int rs2_get_stream_profiles_count(const rs2_stream_profile_list *list, rs2_error **error)
struct rs2_error rs2_error
Definition: rs_types.h:229
double rs2_time_t
Definition: rs_types.h:273
int rs2_load_wheel_odometry_config(const rs2_sensor *sensor, const unsigned char *odometry_config_buf, unsigned int blob_size, rs2_error **error)
Definition: rs_sensor.h:91
rs2_log_severity
Severity of the librealsense logger.
Definition: rs_types.h:123
Definition: rs_sensor.h:73
rs2_processing_block_list * rs2_get_recommended_processing_blocks(rs2_sensor *sensor, rs2_error **error)
int rs2_send_wheel_odometry(const rs2_sensor *sensor, char wo_sensor_id, unsigned int frame_num, const rs2_vector translational_velocity, rs2_error **error)
void rs2_get_motion_intrinsics(const rs2_stream_profile *mode, rs2_motion_device_intrinsic *intrinsics, rs2_error **error)
void rs2_override_intrinsics(const rs2_sensor *sensor, const rs2_intrinsics *intrinsics, rs2_error **error)
Override intrinsics of a given sensor that supports calibrated_sensor.
Definition: rs_sensor.h:76
Definition: rs_sensor.h:29
Definition: rs_sensor.h:87
struct rs2_frame rs2_frame
Definition: rs_types.h:232
Definition: rs_sensor.h:70
Definition: rs_sensor.h:72
Definition: rs_sensor.h:86
Definition: rs_sensor.h:74