4#ifndef LIBREALSENSE_RS2_SENSOR_HPP
5#define LIBREALSENSE_RS2_SENSOR_HPP
76 return _serialized_data;
80 std::string _description;
81 double _timestamp = -1;
84 std::string _serialized_data;
90 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()),
222 std::vector<stream_profile> results;
225 std::shared_ptr<rs2_stream_profile_list> list(
233 for (
auto i = 0; i < size; i++)
237 results.push_back(profile);
249 std::vector<stream_profile> results;
252 std::shared_ptr<rs2_stream_profile_list> list(
260 for (
auto i = 0; i < size; i++)
264 results.push_back(profile);
276 std::vector<filter> results;
279 std::shared_ptr<rs2_processing_block_list> list(
287 for (
auto i = 0; i < size; i++)
289 auto f = std::shared_ptr<rs2_processing_block>(
293 results.push_back(f);
302 std::shared_ptr<rs2_embedded_filter_list> list(
310 std::vector<embedded_filter> results;
311 for (
auto i = 0; i < size; i++)
313 std::shared_ptr<rs2_embedded_filter> ef(
319 results.push_back(rs2_ef);
329 if (
auto t = ef.as<T>())
return t;
331 throw rs2::error(
"Could not find requested embedded filter type!");
351 operator bool()
const
356 const std::shared_ptr<rs2_sensor>&
get()
const
375 explicit sensor(std::shared_ptr<rs2_sensor> dev)
379 explicit operator std::shared_ptr<rs2_sensor>() {
return _sensor; }
396 return std::make_shared<sensor>(psens);
422 operator bool()
const {
return _sensor.get() !=
nullptr; }
438 operator bool()
const {
return _sensor.get() !=
nullptr; }
454 operator bool()
const {
return _sensor.get() !=
nullptr; }
487 operator bool()
const {
return _sensor.get() !=
nullptr; }
515 operator bool()
const {
return _sensor.get() !=
nullptr; }
543 operator bool()
const {
return _sensor.get() !=
nullptr; }
585 std::vector<uint8_t> results;
599 results = std::vector<uint8_t>(
start,
start + size);
654 operator bool()
const {
return _sensor.get() !=
nullptr; }
698 operator bool()
const {
return _sensor.get() !=
nullptr; }
716 operator bool()
const {
return _sensor.get() !=
nullptr; }
744 operator bool()
const {
return _sensor.get() !=
nullptr; }
752 std::vector< stream_profile > results;
755 std::shared_ptr< rs2_stream_profile_list > list(
763 for(
auto i = 0; i < size; i++ )
767 results.push_back( profile );
787 operator bool()
const {
return _sensor.get() !=
nullptr; }
color_sensor(sensor s)
Definition rs_sensor.hpp:412
debug_stream_sensor(sensor s)
Definition rs_sensor.hpp:733
std::vector< stream_profile > get_debug_stream_profiles() const
Definition rs_sensor.hpp:750
depth_mapping_sensor(sensor s)
Definition rs_sensor.hpp:777
depth_sensor(std::shared_ptr< rs2_sensor > dev)
Definition rs_sensor.hpp:516
depth_sensor(sensor s)
Definition rs_sensor.hpp:493
float get_depth_scale() const
Definition rs_sensor.hpp:507
float get_stereo_baseline() const
Definition rs_sensor.hpp:535
depth_stereo_sensor(sensor s)
Definition rs_sensor.hpp:522
Definition rs_processing.hpp:1276
Definition rs_types.hpp:116
static void handle(rs2_error *e)
Definition rs_types.hpp:167
fisheye_sensor(sensor s)
Definition rs_sensor.hpp:444
Definition rs_frame.hpp:1309
Definition rs_frame.hpp:355
rs2_sensor * get_sensor()
Definition rs_frame.hpp:456
float get_max_usable_depth_range() const
Definition rs_sensor.hpp:721
max_usable_range_sensor(sensor s)
Definition rs_sensor.hpp:705
motion_sensor(sensor s)
Definition rs_sensor.hpp:428
Definition rs_sensor.hpp:16
std::string get_serialized_data() const
Definition rs_sensor.hpp:74
notification(rs2_notification *nt)
Definition rs_sensor.hpp:18
rs2_notification_category get_category() const
Definition rs_sensor.hpp:39
rs2_log_severity get_severity() const
Definition rs_sensor.hpp:65
double get_timestamp() const
Definition rs_sensor.hpp:56
std::string get_description() const
Definition rs_sensor.hpp:47
Definition rs_sensor.hpp:89
void on_notification(rs2_notification *_notification) override
Definition rs_sensor.hpp:94
notifications_callback(T on_notification)
Definition rs_sensor.hpp:92
void release() override
Definition rs_sensor.hpp:99
options & operator=(const options &other)
Definition rs_options.hpp:323
options(const options &other)
Definition rs_options.hpp:329
bool supports(rs2_option option) const
Definition rs_options.hpp:163
std::vector< uint8_t > export_localization_map() const
Definition rs_sensor.hpp:583
bool import_localization_map(const std::vector< uint8_t > &lmap_buf) const
Definition rs_sensor.hpp:570
bool get_static_node(const std::string &guid, rs2_vector &pos, rs2_quaternion &orient) const
Definition rs_sensor.hpp:634
pose_sensor(std::shared_ptr< rs2_sensor > dev)
Definition rs_sensor.hpp:655
pose_sensor(sensor s)
Definition rs_sensor.hpp:550
bool set_static_node(const std::string &guid, const rs2_vector &pos, const rs2_quaternion &orient) const
Definition rs_sensor.hpp:614
bool remove_static_node(const std::string &guid) const
Definition rs_sensor.hpp:646
void set_region_of_interest(const region_of_interest &roi)
Definition rs_sensor.hpp:471
region_of_interest get_region_of_interest() const
Definition rs_sensor.hpp:478
roi_sensor(sensor s)
Definition rs_sensor.hpp:460
Definition rs_sensor.hpp:104
friend device_base
Definition rs_sensor.hpp:385
void open(const std::vector< stream_profile > &profiles) const
Definition rs_sensor.hpp:152
sensor()
Definition rs_sensor.hpp:349
std::shared_ptr< rs2_sensor > _sensor
Definition rs_sensor.hpp:388
const char * get_info(rs2_camera_info info) const
Definition rs_sensor.hpp:139
friend context
Definition rs_sensor.hpp:382
T get_embedded_filter() const
Definition rs_sensor.hpp:325
std::vector< stream_profile > get_stream_profiles() const
Definition rs_sensor.hpp:220
sensor & operator=(const sensor &other)
Definition rs_sensor.hpp:342
bool is() const
Definition rs_sensor.hpp:362
friend roi_sensor
Definition rs_sensor.hpp:386
sensor(std::shared_ptr< rs2_sensor > dev)
Definition rs_sensor.hpp:375
T as() const
Definition rs_sensor.hpp:369
std::vector< embedded_filter > query_embedded_filters() const
Definition rs_sensor.hpp:299
bool supports(rs2_camera_info info) const
Definition rs_sensor.hpp:126
void stop() const
Definition rs_sensor.hpp:196
std::vector< filter > get_recommended_filters() const
Definition rs_sensor.hpp:274
std::vector< stream_profile > get_active_streams() const
Definition rs_sensor.hpp:247
const std::shared_ptr< rs2_sensor > & get() const
Definition rs_sensor.hpp:356
friend device_list
Definition rs_sensor.hpp:383
void start(T callback) const
Definition rs_sensor.hpp:186
void set_notifications_callback(T callback) const
Definition rs_sensor.hpp:208
sensor & operator=(const std::shared_ptr< rs2_sensor > other)
Definition rs_sensor.hpp:334
friend device
Definition rs_sensor.hpp:384
void open(const stream_profile &profile) const
Definition rs_sensor.hpp:112
void close() const
Definition rs_sensor.hpp:174
Definition rs_frame.hpp:23
const rs2_stream_profile * get() const
Definition rs_frame.hpp:146
wheel_odometer(sensor s)
Definition rs_sensor.hpp:661
wheel_odometer(std::shared_ptr< rs2_sensor > dev)
Definition rs_sensor.hpp:699
bool load_wheel_odometery_config(const std::vector< uint8_t > &odometry_config_buf) const
Definition rs_sensor.hpp:676
bool send_wheel_odometry(uint8_t wo_sensor_id, uint32_t frame_num, const rs2_vector &translational_velocity)
Definition rs_sensor.hpp:690
Definition rs_processing_gl.hpp:13
std::shared_ptr< sensor > sensor_from_frame(frame f)
Definition rs_sensor.hpp:393
bool operator==(const sensor &lhs, const sensor &rhs)
Definition rs_sensor.hpp:399
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
void rs2_delete_processing_block(rs2_processing_block *block)
int rs2_get_embedded_filters_count(const rs2_embedded_filter_list *list, rs2_error **error)
void rs2_delete_embedded_filter(rs2_embedded_filter *embedded_filter)
rs2_embedded_filter * rs2_create_embedded_filter(const rs2_embedded_filter_list *list, int index, rs2_error **error)
rs2_processing_block_list * rs2_get_recommended_processing_blocks(rs2_sensor *sensor, rs2_error **error)
void rs2_delete_embedded_filter_list(rs2_embedded_filter_list *embedded_filter_list)
int rs2_get_recommended_processing_blocks_count(const rs2_processing_block_list *list, rs2_error **error)
float rs2_get_depth_scale(rs2_sensor *sensor, rs2_error **error)
int rs2_set_static_node(const rs2_sensor *sensor, const char *guid, const rs2_vector pos, const rs2_quaternion orient, rs2_error **error)
rs2_time_t rs2_get_notification_timestamp(rs2_notification *notification, rs2_error **error)
int rs2_supports_sensor_info(const rs2_sensor *sensor, rs2_camera_info info, rs2_error **error)
rs2_notification_category rs2_get_notification_category(rs2_notification *notification, 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
const char * rs2_get_sensor_info(const rs2_sensor *sensor, rs2_camera_info info, rs2_error **error)
void rs2_stop(const rs2_sensor *sensor, rs2_error **error)
void rs2_start_cpp(const rs2_sensor *sensor, rs2_frame_callback *callback, rs2_error **error)
const char * rs2_get_notification_serialized_data(rs2_notification *notification, rs2_error **error)
int rs2_load_wheel_odometry_config(const rs2_sensor *sensor, const unsigned char *odometry_config_buf, unsigned int blob_size, rs2_error **error)
const rs2_raw_data_buffer * rs2_export_localization_map(const 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)
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)
const char * rs2_get_notification_description(rs2_notification *notification, rs2_error **error)
int rs2_is_sensor_extendable_to(const rs2_sensor *sensor, rs2_extension extension, rs2_error **error)
void rs2_delete_sensor(rs2_sensor *sensor)
void rs2_close(const rs2_sensor *sensor, rs2_error **error)
rs2_stream_profile_list * rs2_get_debug_stream_profiles(rs2_sensor *sensor, rs2_error **error)
void rs2_set_notifications_callback_cpp(const rs2_sensor *sensor, rs2_notifications_callback *callback, rs2_error **error)
rs2_stream_profile_list * rs2_get_active_streams(rs2_sensor *sensor, 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
@ RS2_CAMERA_INFO_SERIAL_NUMBER
Definition rs_sensor.h:24
@ RS2_CAMERA_INFO_NAME
Definition rs_sensor.h:23
rs2_stream_profile_list * rs2_get_stream_profiles(rs2_sensor *sensor, rs2_error **error)
float rs2_get_max_usable_depth_range(rs2_sensor const *sensor, rs2_error **error)
float rs2_get_stereo_baseline(rs2_sensor *sensor, rs2_error **error)
rs2_processing_block * rs2_get_processing_block(const rs2_processing_block_list *list, int index, rs2_error **error)
void rs2_delete_stream_profiles_list(rs2_stream_profile_list *list)
rs2_embedded_filter_list * rs2_query_embedded_filters(const rs2_sensor *sensor, rs2_error **error)
int rs2_get_stream_profiles_count(const rs2_stream_profile_list *list, rs2_error **error)
int rs2_import_localization_map(const rs2_sensor *sensor, const unsigned char *lmap_blob, unsigned int blob_size, rs2_error **error)
void rs2_open_multiple(rs2_sensor *device, const rs2_stream_profile **profiles, int count, rs2_error **error)
int rs2_remove_static_node(const rs2_sensor *sensor, const char *guid, rs2_error **error)
void rs2_delete_recommended_processing_blocks(rs2_processing_block_list *list)
void rs2_open(rs2_sensor *device, const rs2_stream_profile *profile, rs2_error **error)
int rs2_get_static_node(const rs2_sensor *sensor, const char *guid, rs2_vector *pos, rs2_quaternion *orient, rs2_error **error)
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
rs2_log_severity
Severity of the librealsense logger.
Definition rs_types.h:123
@ RS2_LOG_SEVERITY_COUNT
Definition rs_types.h:130
rs2_notification_category
Category of the librealsense notification.
Definition rs_types.h:19
@ RS2_NOTIFICATION_CATEGORY_COUNT
Definition rs_types.h:27
@ RS2_EXTENSION_FISHEYE_SENSOR
Definition rs_types.h:183
@ RS2_EXTENSION_POSE_SENSOR
Definition rs_types.h:173
@ RS2_EXTENSION_DEPTH_SENSOR
Definition rs_types.h:146
@ RS2_EXTENSION_ROI
Definition rs_types.h:145
@ RS2_EXTENSION_DEBUG_STREAM_SENSOR
Definition rs_types.h:193
@ RS2_EXTENSION_WHEEL_ODOMETER
Definition rs_types.h:174
@ RS2_EXTENSION_DEPTH_MAPPING_SENSOR
Definition rs_types.h:197
@ RS2_EXTENSION_COLOR_SENSOR
Definition rs_types.h:181
@ RS2_EXTENSION_MAX_USABLE_RANGE_SENSOR
Definition rs_types.h:192
@ RS2_EXTENSION_DEPTH_STEREO_SENSOR
Definition rs_types.h:156
@ RS2_EXTENSION_MOTION_SENSOR
Definition rs_types.h:182
struct rs2_notification rs2_notification
Definition rs_types.h:308
struct rs2_error rs2_error
Definition rs_types.h:276
struct rs2_raw_data_buffer rs2_raw_data_buffer
Definition rs_types.h:278
struct rs2_options rs2_options
Definition rs_types.h:303
Definition rs_types.hpp:208
int min_x
Definition rs_types.hpp:209
int max_y
Definition rs_types.hpp:212
int max_x
Definition rs_types.hpp:211
int min_y
Definition rs_types.hpp:210
Definition rs_types.hpp:48
Quaternion used to represent rotation.
Definition rs_types.h:106
3D vector in Euclidean coordinate space
Definition rs_types.h:100