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 {
36 
38 typedef enum rs2_stream
39 {
51 } rs2_stream;
52 const char* rs2_stream_to_string(rs2_stream stream);
53 
55 typedef enum rs2_format
56 {
80 } rs2_format;
81 const char* rs2_format_to_string(rs2_format format);
82 
84 typedef struct rs2_extrinsics
85 {
86  float rotation[9];
87  float translation[3];
89 
95 
102 int rs2_get_sensors_count(const rs2_sensor_list* info_list, rs2_error** error);
103 
108 void rs2_delete_sensor(rs2_sensor* sensor);
109 
116 rs2_sensor* rs2_create_sensor(const rs2_sensor_list* list, int index, rs2_error** error);
117 
125 
133 const char* rs2_get_sensor_info(const rs2_sensor* sensor, rs2_camera_info info, rs2_error** error);
134 
141 int rs2_supports_sensor_info(const rs2_sensor* sensor, rs2_camera_info info, rs2_error** error);
142 
150 int rs2_is_sensor_extendable_to(const rs2_sensor* sensor, rs2_extension extension, rs2_error** error);
151 
157 float rs2_get_depth_scale(rs2_sensor* sensor, rs2_error** error);
158 
164 float rs2_depth_stereo_frame_get_baseline(const rs2_frame* frame_ref, rs2_error** error);
165 
171 float rs2_get_stereo_baseline(rs2_sensor* sensor, rs2_error** error);
172 
182 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);
183 
193 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);
194 
201 void rs2_open(rs2_sensor* device, const rs2_stream_profile* profile, rs2_error** error);
202 
211 void rs2_open_multiple(rs2_sensor* device, const rs2_stream_profile** profiles, int count, rs2_error** error);
212 
218 void rs2_close(const rs2_sensor* sensor, rs2_error** error);
219 
227 void rs2_start(const rs2_sensor* sensor, rs2_frame_callback_ptr on_frame, void* user, rs2_error** error);
228 
235 void rs2_start_cpp(const rs2_sensor* sensor, rs2_frame_callback* callback, rs2_error** error);
236 
243 void rs2_start_queue(const rs2_sensor* sensor, rs2_frame_queue* queue, rs2_error** error);
244 
250 void rs2_stop(const rs2_sensor* sensor, rs2_error** error);
251 
258 void rs2_set_notifications_callback(const rs2_sensor* sensor, rs2_notification_callback_ptr on_notification, void* user, rs2_error** error);
259 
267 
274 const char* rs2_get_notification_description(rs2_notification* notification, rs2_error** error);
275 
283 
291 
299 
306 const char* rs2_get_notification_serialized_data(rs2_notification* notification, rs2_error** error);
307 
315 
322 const rs2_stream_profile* rs2_get_stream_profile(const rs2_stream_profile_list* list, int index, rs2_error** error);
323 
334 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);
335 
344 void rs2_set_stream_profile_data(rs2_stream_profile* mode, rs2_stream stream, int index, rs2_format format, rs2_error** error);
345 
355 rs2_stream_profile* rs2_clone_stream_profile(const rs2_stream_profile* mode, rs2_stream stream, int index, rs2_format format, rs2_error** error);
356 
363 
371 int rs2_stream_profile_is(const rs2_stream_profile* mode, rs2_extension type, rs2_error** error);
372 
380 void rs2_get_video_stream_resolution(const rs2_stream_profile* mode, int* width, int* height, rs2_error** error);
381 
389 
398 
406 
412 
419 void rs2_get_extrinsics(const rs2_stream_profile* from,
420  const rs2_stream_profile* to,
421  rs2_extrinsics* extrin, rs2_error** error);
422 
430  const rs2_stream_profile* to,
431  rs2_extrinsics extrin, rs2_error** error);
432 
439 void rs2_get_video_stream_intrinsics(const rs2_stream_profile* mode, rs2_intrinsics* intrinsics, rs2_error** error);
440 
449 
458 
466 
472 
481 int rs2_import_localization_map(const rs2_sensor* sensor, const unsigned char* lmap_blob, unsigned int blob_size, rs2_error** error);
482 
490 //void rs2_export_localization_map(const rs2_sensor* sensor, const char* lmap_fname, rs2_error** error);
492 
502 int rs2_set_static_node(const rs2_sensor* sensor, const char* guid, const rs2_vector pos, const rs2_quaternion orient, rs2_error** error);
503 
513 int rs2_get_static_node(const rs2_sensor* sensor, const char* guid, rs2_vector *pos, rs2_quaternion *orient, rs2_error** error);
514 
519 int rs2_load_wheel_odometry_config(const rs2_sensor* sensor, const unsigned char* odometry_config_buf, unsigned int blob_size, rs2_error** error);
520 
527 int rs2_send_wheel_odometry(const rs2_sensor* sensor, char wo_sensor_id, unsigned int frame_num,
528  const rs2_vector translational_velocity, rs2_error** error);
529 
530 #ifdef __cplusplus
531 }
532 #endif
533 #endif // LIBREALSENSE_RS2_SENSOR_H
Definition: rs_sensor.h:72
struct rs2_processing_block_list rs2_processing_block_list
Definition: rs_types.h:214
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:25
const char * rs2_format_to_string(rs2_format format)
Definition: rs_sensor.h:63
struct rs2_raw_data_buffer rs2_raw_data_buffer
Definition: rs_types.h:206
Definition: rs_sensor.h:76
float rs2_get_depth_scale(rs2_sensor *sensor, rs2_error **error)
Definition: rs_sensor.h:27
Definition: rs_sensor.h:28
Definition: rs_types.hpp:39
struct rs2_frame_queue rs2_frame_queue
Definition: rs_types.h:208
void rs2_get_video_stream_resolution(const rs2_stream_profile *mode, int *width, int *height, 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:87
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:75
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:58
Definition: rs_sensor.h:44
Definition: rs_sensor.h:78
int rs2_import_localization_map(const rs2_sensor *sensor, const unsigned char *lmap_blob, unsigned int blob_size, rs2_error **error)
struct rs2_sensor_list rs2_sensor_list
Definition: rs_types.h:226
Definition: rs_sensor.h:48
void rs2_stop(const rs2_sensor *sensor, rs2_error **error)
Definition: rs_sensor.h:61
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)
const char * rs2_get_notification_serialized_data(rs2_notification *notification, rs2_error **error)
Definition: rs_sensor.h:23
Definition: rs_sensor.h:47
rs2_log_severity rs2_get_notification_severity(rs2_notification *notification, rs2_error **error)
Definition: rs_sensor.h:59
Definition: rs_sensor.h:45
rs2_stream_profile * rs2_clone_stream_profile(const rs2_stream_profile *mode, rs2_stream stream, int index, rs2_format format, rs2_error **error)
struct rs2_sensor rs2_sensor
Definition: rs_types.h:227
float rotation[9]
Definition: rs_sensor.h:86
Definition: rs_sensor.h:42
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:62
Quaternion used to represent rotation.
Definition: rs_types.h:102
Definition: rs_sensor.h:60
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)
struct rs2_notification rs2_notification
Definition: rs_types.h:231
int rs2_is_stream_profile_default(const rs2_stream_profile *mode, rs2_error **error)
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:50
rs2_time_t rs2_get_notification_timestamp(rs2_notification *notification, rs2_error **error)
Definition: rs_sensor.h:32
Definition: rs_sensor.h:49
Definition: rs_sensor.h:77
void rs2_delete_stream_profile(rs2_stream_profile *mode)
struct rs2_stream_profile_list rs2_stream_profile_list
Definition: rs_types.h:213
const rs2_stream_profile * rs2_get_stream_profile(const rs2_stream_profile_list *list, int index, rs2_error **error)
void rs2_set_notifications_callback_cpp(const rs2_sensor *sensor, rs2_notifications_callback *callback, rs2_error **error)
struct rs2_stream_profile rs2_stream_profile
Definition: rs_types.h:215
Definition: rs_sensor.h:57
rs2_format
A stream's format identifies how binary data is encoded within a frame.
Definition: rs_sensor.h:55
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:71
Definition: rs_sensor.h:33
Definition: rs_sensor.h:79
Definition: rs_sensor.h:73
Definition: rs_sensor.h:41
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:38
void rs2_get_video_stream_intrinsics(const rs2_stream_profile *mode, rs2_intrinsics *intrinsics, rs2_error **error)
Definition: rs_sensor.h:43
Definition: rs_sensor.h:46
Definition: rs_sensor.h:69
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
Definition: rs_sensor.h:84
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:96
struct rs2_processing_block rs2_processing_block
Definition: rs_types.h:221
const char * rs2_stream_to_string(rs2_stream stream)
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:132
rs2_notification_category
Category of the librealsense notification.
Definition: rs_types.h:17
Definition: rs_sensor.h:40
void(* rs2_notification_callback_ptr)(rs2_notification *, void *)
Definition: rs_types.h:233
void rs2_delete_stream_profiles_list(rs2_stream_profile_list *list)
void rs2_close(const rs2_sensor *sensor, rs2_error **error)
struct rs2_device rs2_device
Definition: rs_types.h:204
rs2_stream_profile_list * rs2_get_stream_profiles(rs2_sensor *device, rs2_error **error)
Video stream intrinsics.
Definition: rs_types.h:57
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:65
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:70
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)
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:235
Definition: rs_sensor.h:74
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:205
double rs2_time_t
Definition: rs_types.h:238
int rs2_load_wheel_odometry_config(const rs2_sensor *sensor, const unsigned char *odometry_config_buf, unsigned int blob_size, rs2_error **error)
rs2_log_severity
Severity of the librealsense logger.
Definition: rs_types.h:120
Definition: rs_sensor.h:67
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)
Definition: rs_sensor.h:70
Definition: rs_sensor.h:29
struct rs2_frame rs2_frame
Definition: rs_types.h:207
Definition: rs_sensor.h:64
Definition: rs_sensor.h:66
Definition: rs_sensor.h:68