Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
|
Go to the documentation of this file.
4 #ifndef LIBREALSENSE_RS2_SENSOR_HPP
5 #define LIBREALSENSE_RS2_SENSOR_HPP
75 return _serialized_data;
79 std::string _description;
80 double _timestamp = -1;
83 std::string _serialized_data;
89 T on_notification_function;
131 return is_supported > 0;
152 void open(
const std::vector<stream_profile>& profiles)
const
156 std::vector<const rs2_stream_profile*> profs;
157 profs.reserve(profiles.size());
158 for (
auto& p : profiles)
160 profs.push_back(p.get());
165 static_cast<int>(profiles.size()),
223 std::vector<stream_profile> results{};
226 std::shared_ptr<rs2_stream_profile_list> list(
234 for (
auto i = 0; i < size; i++)
238 results.push_back(profile);
250 std::vector<filter> results{};
253 std::shared_ptr<rs2_processing_block_list> list(
261 for (
auto i = 0; i < size; i++)
263 auto f = std::shared_ptr<rs2_processing_block>(
267 results.push_back(f);
290 operator bool()
const
295 const std::shared_ptr<rs2_sensor>&
get()
const
314 explicit sensor(std::shared_ptr<rs2_sensor> dev)
318 explicit operator std::shared_ptr<rs2_sensor>() {
return _sensor; }
335 return std::make_shared<sensor>(psens);
361 operator bool()
const {
return _sensor.get() !=
nullptr; }
377 operator bool()
const {
return _sensor.get() !=
nullptr; }
393 operator bool()
const {
return _sensor.get() !=
nullptr; }
426 operator bool()
const {
return _sensor.get() !=
nullptr; }
454 operator bool()
const {
return _sensor.get() !=
nullptr; }
482 operator bool()
const {
return _sensor.get() !=
nullptr; }
524 std::vector<uint8_t> results;
538 results = std::vector<uint8_t>(
start,
start + size);
593 operator bool()
const {
return _sensor.get() !=
nullptr; }
637 operator bool()
const {
return _sensor.get() !=
nullptr; }
641 #endif // LIBREALSENSE_RS2_SENSOR_HPP
std::shared_ptr< sensor > sensor_from_frame(frame f)
Definition: rs_sensor.hpp:332
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
int rs2_get_static_node(const rs2_sensor *sensor, const char *guid, rs2_vector *pos, rs2_quaternion *orient, rs2_error **error)
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:97
float get_depth_scale() const
Definition: rs_sensor.hpp:446
float rs2_get_stereo_baseline(rs2_sensor *sensor, rs2_error **error)
float get_stereo_baseline() const
Definition: rs_sensor.hpp:474
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
void open(const stream_profile &profile) const
Definition: rs_sensor.hpp:112
@ RS2_NOTIFICATION_CATEGORY_COUNT
Definition: rs_types.h:25
rs2_notification_category rs2_get_notification_category(rs2_notification *notification, rs2_error **error)
Quaternion used to represent rotation
Definition: rs_types.h:103
Definition: rs_frame.hpp:336
Definition: rs_sensor.hpp:597
friend roi_sensor
Definition: rs_sensor.hpp:325
Definition: rs_frame.hpp:22
Definition: rs_sensor.hpp:348
@ RS2_EXTENSION_POSE_SENSOR
Definition: rs_types.h:170
rs2_sensor * get_sensor()
Definition: rs_frame.hpp:438
@ RS2_CAMERA_INFO_SERIAL_NUMBER
Definition: rs_sensor.h:24
Definition: rs_sensor.hpp:458
int min_x
Definition: rs_types.hpp:172
std::vector< stream_profile > get_stream_profiles() const
Definition: rs_sensor.hpp:221
bool supports(rs2_camera_info info) const
Definition: rs_sensor.hpp:126
sensor(std::shared_ptr< rs2_sensor > dev)
Definition: rs_sensor.hpp:314
void rs2_set_notifications_callback_cpp(const rs2_sensor *sensor, rs2_notifications_callback *callback, rs2_error **error)
rs2_processing_block * rs2_get_processing_block(const rs2_processing_block_list *list, int index, rs2_error **error)
bool set_static_node(const std::string &guid, const rs2_vector &pos, const rs2_quaternion &orient) const
Definition: rs_sensor.hpp:553
void set_notifications_callback(T callback) const
Definition: rs_sensor.hpp:208
Definition: rs_options.hpp:11
friend device_list
Definition: rs_sensor.hpp:322
int rs2_set_static_node(const rs2_sensor *sensor, const char *guid, const rs2_vector pos, const rs2_quaternion orient, rs2_error **error)
const char * rs2_get_sensor_info(const rs2_sensor *sensor, rs2_camera_info info, rs2_error **error)
wheel_odometer(sensor s)
Definition: rs_sensor.hpp:600
void open(const std::vector< stream_profile > &profiles) const
Definition: rs_sensor.hpp:152
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
rs2_notification_category get_category() const
Definition: rs_sensor.hpp:38
void rs2_close(const rs2_sensor *sensor, rs2_error **error)
Definition: rs_sensor.hpp:87
depth_sensor(std::shared_ptr< rs2_sensor > dev)
Definition: rs_sensor.hpp:455
void set_region_of_interest(const region_of_interest &roi)
Definition: rs_sensor.hpp:410
Definition: rs_types.hpp:39
friend device
Definition: rs_sensor.hpp:323
notification(rs2_notification *nt)
Definition: rs_sensor.hpp:17
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
void close() const
Definition: rs_sensor.hpp:174
rs2_log_severity
Severity of the librealsense logger.
Definition: rs_types.h:121
wheel_odometer(std::shared_ptr< rs2_sensor > dev)
Definition: rs_sensor.hpp:638
int max_y
Definition: rs_types.hpp:175
rs2_stream_profile_list * rs2_get_stream_profiles(rs2_sensor *device, rs2_error **error)
@ RS2_CAMERA_INFO_NAME
Definition: rs_sensor.h:23
void rs2_delete_recommended_processing_blocks(rs2_processing_block_list *list)
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)
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
region_of_interest get_region_of_interest() const
Definition: rs_sensor.hpp:417
std::string get_serialized_data() const
Definition: rs_sensor.hpp:73
bool send_wheel_odometry(uint8_t wo_sensor_id, uint32_t frame_num, const rs2_vector &translational_velocity)
Definition: rs_sensor.hpp:629
color_sensor(sensor s)
Definition: rs_sensor.hpp:351
Definition: rs_sensor.hpp:364
friend device_base
Definition: rs_sensor.hpp:324
struct rs2_notification rs2_notification
Definition: rs_types.h:245
const char * rs2_get_notification_serialized_data(rs2_notification *notification, rs2_error **error)
sensor()
Definition: rs_sensor.hpp:288
int rs2_get_recommended_processing_blocks_count(const rs2_processing_block_list *list, rs2_error **error)
@ RS2_EXTENSION_ROI
Definition: rs_types.h:142
sensor & operator=(const std::shared_ptr< rs2_sensor > other)
Definition: rs_sensor.hpp:273
void rs2_delete_sensor(rs2_sensor *sensor)
bool load_wheel_odometery_config(const std::vector< uint8_t > &odometry_config_buf) const
Definition: rs_sensor.hpp:615
struct rs2_options rs2_options
Definition: rs_types.h:242
int rs2_remove_static_node(const rs2_sensor *sensor, const char *guid, rs2_error **error)
bool remove_static_node(const std::string &guid) const
Definition: rs_sensor.hpp:585
Definition: rs_sensor.hpp:429
@ RS2_EXTENSION_COLOR_SENSOR
Definition: rs_types.h:178
void on_notification(rs2_notification *_notification) override
Definition: rs_sensor.hpp:93
friend context
Definition: rs_sensor.hpp:321
bool supports(rs2_option option) const
Definition: rs_options.hpp:19
@ RS2_EXTENSION_DEPTH_STEREO_SENSOR
Definition: rs_types.h:153
bool get_static_node(const std::string &guid, rs2_vector &pos, rs2_quaternion &orient) const
Definition: rs_sensor.hpp:573
Definition: rs_context.hpp:11
bool is() const
Definition: rs_sensor.hpp:301
Definition: rs_sensor.hpp:103
void rs2_delete_processing_block(rs2_processing_block *block)
Definition: rs_sensor.hpp:14
std::vector< filter > get_recommended_filters() const
Definition: rs_sensor.hpp:248
depth_stereo_sensor(sensor s)
Definition: rs_sensor.hpp:461
Definition: rs_types.hpp:170
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:137
roi_sensor(sensor s)
Definition: rs_sensor.hpp:399
rs2_processing_block_list * rs2_get_recommended_processing_blocks(rs2_sensor *sensor, rs2_error **error)
@ RS2_EXTENSION_DEPTH_SENSOR
Definition: rs_types.h:143
bool operator==(const sensor &lhs, const sensor &rhs)
Definition: rs_sensor.hpp:338
pose_sensor(std::shared_ptr< rs2_sensor > dev)
Definition: rs_sensor.hpp:594
sensor & operator=(const sensor &other)
Definition: rs_sensor.hpp:281
motion_sensor(sensor s)
Definition: rs_sensor.hpp:367
Definition: rs_sensor.hpp:380
options & operator=(const options &other)
Definition: rs_options.hpp:134
void stop() const
Definition: rs_sensor.hpp:196
const char * get_info(rs2_camera_info info) const
Definition: rs_sensor.hpp:139
const std::shared_ptr< rs2_sensor > & get() const
Definition: rs_sensor.hpp:295
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
@ RS2_EXTENSION_WHEEL_ODOMETER
Definition: rs_types.h:171
int min_y
Definition: rs_types.hpp:173
struct rs2_raw_data_buffer rs2_raw_data_buffer
Definition: rs_types.h:219
pose_sensor(sensor s)
Definition: rs_sensor.hpp:489
std::shared_ptr< rs2_sensor > _sensor
Definition: rs_sensor.hpp:327
int rs2_supports_sensor_info(const rs2_sensor *sensor, rs2_camera_info info, rs2_error **error)
const rs2_stream_profile * rs2_get_stream_profile(const rs2_stream_profile_list *list, int index, rs2_error **error)
rs2_log_severity rs2_get_notification_severity(rs2_notification *notification, rs2_error **error)
void rs2_open(rs2_sensor *device, const rs2_stream_profile *profile, rs2_error **error)
rs2_time_t rs2_get_notification_timestamp(rs2_notification *notification, rs2_error **error)
int rs2_import_localization_map(const rs2_sensor *sensor, const unsigned char *lmap_blob, unsigned int blob_size, rs2_error **error)
float rs2_get_depth_scale(rs2_sensor *sensor, rs2_error **error)
T as() const
Definition: rs_sensor.hpp:308
notifications_callback(T on_notification)
Definition: rs_sensor.hpp:91
Definition: rs_sensor.hpp:486
fisheye_sensor(sensor s)
Definition: rs_sensor.hpp:383
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)
static void handle(rs2_error *e)
Definition: rs_types.hpp:130
@ RS2_EXTENSION_MOTION_SENSOR
Definition: rs_types.h:179
std::vector< uint8_t > export_localization_map() const
Definition: rs_sensor.hpp:522
Definition: rs_frame.hpp:1123
int rs2_load_wheel_odometry_config(const rs2_sensor *sensor, const unsigned char *odometry_config_buf, unsigned int blob_size, rs2_error **error)
@ RS2_EXTENSION_FISHEYE_SENSOR
Definition: rs_types.h:180
const rs2_raw_data_buffer * rs2_export_localization_map(const rs2_sensor *sensor, rs2_error **error)
double get_timestamp() const
Definition: rs_sensor.hpp:55
void rs2_delete_stream_profiles_list(rs2_stream_profile_list *list)
const char * rs2_get_notification_description(rs2_notification *notification, rs2_error **error)
@ RS2_LOG_SEVERITY_COUNT
Definition: rs_types.h:128
bool import_localization_map(const std::vector< uint8_t > &lmap_buf) const
Definition: rs_sensor.hpp:509
void release() override
Definition: rs_sensor.hpp:98
std::string get_description() const
Definition: rs_sensor.hpp:46
void start(T callback) const
Definition: rs_sensor.hpp:186
int max_x
Definition: rs_types.hpp:174
void rs2_stop(const rs2_sensor *sensor, 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:217
Definition: rs_sensor.hpp:396
rs2_notification_category
Category of the librealsense notification.
Definition: rs_types.h:17
depth_sensor(sensor s)
Definition: rs_sensor.hpp:432
rs2_log_severity get_severity() const
Definition: rs_sensor.hpp:64