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;
130 return is_supported > 0;
151 void open(
const std::vector<stream_profile>& profiles)
const 155 std::vector<const rs2_stream_profile*> profs;
156 profs.reserve(profiles.size());
157 for (
auto& p : profiles)
159 profs.push_back(p.get());
164 static_cast<int>(profiles.size()),
221 std::vector<stream_profile> results;
224 std::shared_ptr<rs2_stream_profile_list> list(
232 for (
auto i = 0; i < size; i++)
236 results.push_back(profile);
248 std::vector<stream_profile> results;
251 std::shared_ptr<rs2_stream_profile_list> list(
259 for (
auto i = 0; i < size; i++)
263 results.push_back(profile);
275 std::vector<filter> results;
278 std::shared_ptr<rs2_processing_block_list> list(
286 for (
auto i = 0; i < size; i++)
288 auto f = std::shared_ptr<rs2_processing_block>(
292 results.push_back(f);
315 operator bool()
const 320 const std::shared_ptr<rs2_sensor>&
get()
const 339 explicit sensor(std::shared_ptr<rs2_sensor> dev)
343 explicit operator std::shared_ptr<rs2_sensor>() {
return _sensor; }
360 return std::make_shared<sensor>(psens);
386 operator bool()
const {
return _sensor.get() !=
nullptr; }
402 operator bool()
const {
return _sensor.get() !=
nullptr; }
418 operator bool()
const {
return _sensor.get() !=
nullptr; }
451 operator bool()
const {
return _sensor.get() !=
nullptr; }
479 operator bool()
const {
return _sensor.get() !=
nullptr; }
507 operator bool()
const {
return _sensor.get() !=
nullptr; }
549 std::vector<uint8_t> results;
563 results = std::vector<uint8_t>(
start,
start + size);
618 operator bool()
const {
return _sensor.get() !=
nullptr; }
662 operator bool()
const {
return _sensor.get() !=
nullptr; }
680 operator bool()
const {
return _sensor.get() !=
nullptr; }
708 operator bool()
const {
return _sensor.get() !=
nullptr; }
716 std::vector< stream_profile > results;
719 std::shared_ptr< rs2_stream_profile_list > list(
727 for(
auto i = 0; i < size; i++ )
731 results.push_back( profile );
738 #endif // LIBREALSENSE_RS2_SENSOR_HPP notification(rs2_notification *nt)
Definition: rs_sensor.hpp:17
Definition: rs_frame.hpp:22
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
pose_sensor(std::shared_ptr< rs2_sensor > dev)
Definition: rs_sensor.hpp:619
Definition: rs_sensor.hpp:102
bool operator==(const sensor &lhs, const sensor &rhs)
Definition: rs_sensor.hpp:363
Definition: rs_frame.hpp:345
struct rs2_raw_data_buffer rs2_raw_data_buffer
Definition: rs_types.h:231
Definition: rs_types.hpp:202
float rs2_get_depth_scale(rs2_sensor *sensor, rs2_error **error)
bool supports(rs2_option option) const
Definition: rs_options.hpp:163
friend device
Definition: rs_sensor.hpp:348
void stop() const
Definition: rs_sensor.hpp:195
std::vector< stream_profile > get_stream_profiles() const
Definition: rs_sensor.hpp:219
region_of_interest get_region_of_interest() const
Definition: rs_sensor.hpp:442
Definition: rs_types.h:180
fisheye_sensor(sensor s)
Definition: rs_sensor.hpp:408
void on_notification(rs2_notification *_notification) override
Definition: rs_sensor.hpp:93
Definition: rs_types.hpp:42
Definition: rs_sensor.hpp:454
void start(T callback) const
Definition: rs_sensor.hpp:185
int min_x
Definition: rs_types.hpp:204
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 rs2_get_max_usable_depth_range(rs2_sensor const *sensor, rs2_error **error)
Definition: rs_sensor.hpp:405
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
depth_sensor(sensor s)
Definition: rs_sensor.hpp:457
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
int rs2_import_localization_map(const rs2_sensor *sensor, const unsigned char *lmap_blob, unsigned int blob_size, rs2_error **error)
friend context
Definition: rs_sensor.hpp:346
void rs2_stop(const rs2_sensor *sensor, rs2_error **error)
std::vector< filter > get_recommended_filters() const
Definition: rs_sensor.hpp:273
debug_stream_sensor(sensor s)
Definition: rs_sensor.hpp:697
depth_stereo_sensor(sensor s)
Definition: rs_sensor.hpp:486
std::vector< uint8_t > export_localization_map() const
Definition: rs_sensor.hpp:547
void release() override
Definition: rs_sensor.hpp:98
const char * rs2_get_notification_serialized_data(rs2_notification *notification, rs2_error **error)
Definition: rs_context.hpp:11
bool supports(rs2_camera_info info) const
Definition: rs_sensor.hpp:125
Definition: rs_sensor.h:23
rs2_log_severity rs2_get_notification_severity(rs2_notification *notification, rs2_error **error)
bool get_static_node(const std::string &guid, rs2_vector &pos, rs2_quaternion &orient) const
Definition: rs_sensor.hpp:598
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
Definition: rs_types.h:145
int max_y
Definition: rs_types.hpp:207
sensor(std::shared_ptr< rs2_sensor > dev)
Definition: rs_sensor.hpp:339
friend roi_sensor
Definition: rs_sensor.hpp:350
void set_region_of_interest(const region_of_interest &roi)
Definition: rs_sensor.hpp:435
int max_x
Definition: rs_types.hpp:206
Definition: rs_sensor.hpp:389
rs2_notification_category get_category() const
Definition: rs_sensor.hpp:38
rs2_stream_profile_list * rs2_get_active_streams(rs2_sensor *sensor, rs2_error **error)
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
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)
notifications_callback(T on_notification)
Definition: rs_sensor.hpp:91
bool load_wheel_odometery_config(const std::vector< uint8_t > &odometry_config_buf) const
Definition: rs_sensor.hpp:640
Quaternion used to represent rotation.
Definition: rs_types.h:105
Definition: rs_types.h:191
Definition: rs_frame.hpp:1180
rs2_stream_profile_list * rs2_get_debug_stream_profiles(rs2_sensor *sensor, rs2_error **error)
double get_timestamp() const
Definition: rs_sensor.hpp:55
void open(const stream_profile &profile) const
Definition: rs_sensor.hpp:111
void set_notifications_callback(T callback) const
Definition: rs_sensor.hpp:207
struct rs2_notification rs2_notification
Definition: rs_types.h:258
std::shared_ptr< rs2_sensor > _sensor
Definition: rs_sensor.hpp:352
Definition: rs_types.h:144
max_usable_range_sensor(sensor s)
Definition: rs_sensor.hpp:669
bool remove_static_node(const std::string &guid) const
Definition: rs_sensor.hpp:610
Definition: rs_sensor.hpp:14
std::vector< stream_profile > get_debug_stream_profiles() const
Definition: rs_sensor.hpp:714
float rs2_get_stereo_baseline(rs2_sensor *sensor, rs2_error **error)
friend device_base
Definition: rs_sensor.hpp:349
Definition: rs_types.h:155
Definition: rs_types.h:181
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
rs2_time_t rs2_get_notification_timestamp(rs2_notification *notification, rs2_error **error)
sensor()
Definition: rs_sensor.hpp:313
int rs2_remove_static_node(const rs2_sensor *sensor, const char *guid, rs2_error **error)
Definition: rs_types.h:182
depth_sensor(std::shared_ptr< rs2_sensor > dev)
Definition: rs_sensor.hpp:480
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)
Definition: rs_sensor.hpp:666
Definition: rs_options.hpp:155
T as() const
Definition: rs_sensor.hpp:333
pose_sensor(sensor s)
Definition: rs_sensor.hpp:514
void rs2_delete_processing_block(rs2_processing_block *block)
int rs2_supports_sensor_info(const rs2_sensor *sensor, rs2_camera_info info, rs2_error **error)
float get_max_usable_depth_range() const
Definition: rs_sensor.hpp:685
struct rs2_options rs2_options
Definition: rs_types.h:254
void rs2_delete_recommended_processing_blocks(rs2_processing_block_list *list)
bool import_localization_map(const std::vector< uint8_t > &lmap_buf) const
Definition: rs_sensor.hpp:534
Definition: rs_sensor.hpp:87
static void handle(rs2_error *e)
Definition: rs_types.hpp:162
rs2_sensor * get_sensor()
Definition: rs_frame.hpp:447
std::string get_serialized_data() const
Definition: rs_sensor.hpp:73
bool is() const
Definition: rs_sensor.hpp:326
void close() const
Definition: rs_sensor.hpp:173
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:137
Definition: rs_types.h:130
void open(const std::vector< stream_profile > &profiles) const
Definition: rs_sensor.hpp:151
wheel_odometer(sensor s)
Definition: rs_sensor.hpp:625
float get_stereo_baseline() const
Definition: rs_sensor.hpp:499
Definition: rs_types.h:27
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
Definition: rs_types.h:173
rs2_log_severity get_severity() const
Definition: rs_sensor.hpp:64
Definition: rs_sensor.hpp:373
rs2_notification_category
Category of the librealsense notification.
Definition: rs_types.h:19
void rs2_delete_stream_profiles_list(rs2_stream_profile_list *list)
void rs2_close(const rs2_sensor *sensor, rs2_error **error)
Definition: rs_types.h:192
bool set_static_node(const std::string &guid, const rs2_vector &pos, const rs2_quaternion &orient) const
Definition: rs_sensor.hpp:578
motion_sensor(sensor s)
Definition: rs_sensor.hpp:392
options & operator=(const options &other)
Definition: rs_options.hpp:323
Definition: rs_sensor.hpp:622
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.hpp:421
friend device_list
Definition: rs_sensor.hpp:347
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)
bool send_wheel_odometry(uint8_t wo_sensor_id, uint32_t frame_num, const rs2_vector &translational_velocity)
Definition: rs_sensor.hpp:654
int rs2_set_static_node(const rs2_sensor *sensor, const char *guid, const rs2_vector pos, const rs2_quaternion orient, rs2_error **error)
Definition: rs_types.h:172
const rs2_raw_data_buffer * rs2_export_localization_map(const rs2_sensor *sensor, rs2_error **error)
std::string get_description() const
Definition: rs_sensor.hpp:46
Definition: rs_sensor.hpp:694
float get_depth_scale() const
Definition: rs_sensor.hpp:471
const char * rs2_get_sensor_info(const rs2_sensor *sensor, rs2_camera_info info, rs2_error **error)
sensor & operator=(const sensor &other)
Definition: rs_sensor.hpp:306
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)
const std::shared_ptr< rs2_sensor > & get() const
Definition: rs_sensor.hpp:320
struct rs2_error rs2_error
Definition: rs_types.h:229
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:123
Definition: rs_sensor.hpp:483
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)
Definition: rs_sensor.hpp:511
color_sensor(sensor s)
Definition: rs_sensor.hpp:376
std::vector< stream_profile > get_active_streams() const
Definition: rs_sensor.hpp:246
sensor & operator=(const std::shared_ptr< rs2_sensor > other)
Definition: rs_sensor.hpp:298
const char * get_info(rs2_camera_info info) const
Definition: rs_sensor.hpp:138
wheel_odometer(std::shared_ptr< rs2_sensor > dev)
Definition: rs_sensor.hpp:663
std::shared_ptr< sensor > sensor_from_frame(frame f)
Definition: rs_sensor.hpp:357
int min_y
Definition: rs_types.hpp:205
roi_sensor(sensor s)
Definition: rs_sensor.hpp:424