RealSense Cross Platform API
RealSense Cross-platform API
rs_sensor.hpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2017 RealSense, Inc. All Rights Reserved.
3 
4 #ifndef LIBREALSENSE_RS2_SENSOR_HPP
5 #define LIBREALSENSE_RS2_SENSOR_HPP
6 
7 #include "rs_types.hpp"
8 #include "rs_frame.hpp"
9 #include "rs_processing.hpp"
10 #include "rs_options.hpp"
11 
12 namespace rs2
13 {
14 
16  {
17  public:
19  {
20  rs2_error* e = nullptr;
21  _description = rs2_get_notification_description(nt, &e);
22  error::handle(e);
23  _timestamp = rs2_get_notification_timestamp(nt, &e);
24  error::handle(e);
25  _severity = rs2_get_notification_severity(nt, &e);
26  error::handle(e);
27  _category = rs2_get_notification_category(nt, &e);
28  error::handle(e);
29  _serialized_data = rs2_get_notification_serialized_data(nt, &e);
30  error::handle(e);
31  }
32 
33  notification() = default;
34 
40  {
41  return _category;
42  }
47  std::string get_description() const
48  {
49  return _description;
50  }
51 
56  double get_timestamp() const
57  {
58  return _timestamp;
59  }
60 
66  {
67  return _severity;
68  }
69 
74  std::string get_serialized_data() const
75  {
76  return _serialized_data;
77  }
78 
79  private:
80  std::string _description;
81  double _timestamp = -1;
84  std::string _serialized_data;
85  };
86 
87  template<class T>
89  {
90  T on_notification_function;
91  public:
92  explicit notifications_callback(T on_notification) : on_notification_function(on_notification) {}
93 
94  void on_notification(rs2_notification* _notification) override
95  {
96  on_notification_function(notification{ _notification });
97  }
98 
99  void release() override { delete this; }
100  };
101 
102 
103  class sensor : public options
104  {
105  public:
106 
107  using options::supports;
112  void open(const stream_profile& profile) const
113  {
114  rs2_error* e = nullptr;
115  rs2_open(_sensor.get(),
116  profile.get(),
117  &e);
118  error::handle(e);
119  }
120 
126  bool supports(rs2_camera_info info) const
127  {
128  rs2_error* e = nullptr;
129  auto is_supported = rs2_supports_sensor_info(_sensor.get(), info, &e);
130  error::handle(e);
131  return is_supported > 0;
132  }
133 
139  const char* get_info(rs2_camera_info info) const
140  {
141  rs2_error* e = nullptr;
142  auto result = rs2_get_sensor_info(_sensor.get(), info, &e);
143  error::handle(e);
144  return result;
145  }
146 
152  void open(const std::vector<stream_profile>& profiles) const
153  {
154  rs2_error* e = nullptr;
155 
156  std::vector<const rs2_stream_profile*> profs;
157  profs.reserve(profiles.size());
158  for (auto& p : profiles)
159  {
160  profs.push_back(p.get());
161  }
162 
164  profs.data(),
165  static_cast<int>(profiles.size()),
166  &e);
167  error::handle(e);
168  }
169 
174  void close() const
175  {
176  rs2_error* e = nullptr;
177  rs2_close(_sensor.get(), &e);
178  error::handle(e);
179  }
180 
185  template<class T>
186  void start(T callback) const
187  {
188  rs2_error* e = nullptr;
189  rs2_start_cpp(_sensor.get(), new frame_callback<T>(std::move(callback)), &e);
190  error::handle(e);
191  }
192 
196  void stop() const
197  {
198  rs2_error* e = nullptr;
199  rs2_stop(_sensor.get(), &e);
200  error::handle(e);
201  }
202 
207  template<class T>
208  void set_notifications_callback(T callback) const
209  {
210  rs2_error* e = nullptr;
212  new notifications_callback<T>(std::move(callback)), &e);
213  error::handle(e);
214  }
215 
220  std::vector<stream_profile> get_stream_profiles() const
221  {
222  std::vector<stream_profile> results;
223 
224  rs2_error* e = nullptr;
225  std::shared_ptr<rs2_stream_profile_list> list(
226  rs2_get_stream_profiles(_sensor.get(), &e),
228  error::handle(e);
229 
230  auto size = rs2_get_stream_profiles_count(list.get(), &e);
231  error::handle(e);
232 
233  for (auto i = 0; i < size; i++)
234  {
235  stream_profile profile(rs2_get_stream_profile(list.get(), i, &e));
236  error::handle(e);
237  results.push_back(profile);
238  }
239 
240  return results;
241  }
242 
247  std::vector<stream_profile> get_active_streams() const
248  {
249  std::vector<stream_profile> results;
250 
251  rs2_error* e = nullptr;
252  std::shared_ptr<rs2_stream_profile_list> list(
253  rs2_get_active_streams(_sensor.get(), &e),
255  error::handle(e);
256 
257  auto size = rs2_get_stream_profiles_count(list.get(), &e);
258  error::handle(e);
259 
260  for (auto i = 0; i < size; i++)
261  {
262  stream_profile profile(rs2_get_stream_profile(list.get(), i, &e));
263  error::handle(e);
264  results.push_back(profile);
265  }
266 
267  return results;
268  }
269 
274  std::vector<filter> get_recommended_filters() const
275  {
276  std::vector<filter> results;
277 
278  rs2_error* e = nullptr;
279  std::shared_ptr<rs2_processing_block_list> list(
282  error::handle(e);
283 
284  auto size = rs2_get_recommended_processing_blocks_count(list.get(), &e);
285  error::handle(e);
286 
287  for (auto i = 0; i < size; i++)
288  {
289  auto f = std::shared_ptr<rs2_processing_block>(
290  rs2_get_processing_block(list.get(), i, &e),
292  error::handle(e);
293  results.push_back(f);
294  }
295 
296  return results;
297  }
298 
299  std::vector<embedded_filter> query_embedded_filters() const
300  {
301  rs2_error* e = nullptr;
302  std::shared_ptr<rs2_embedded_filter_list> list(
305  error::handle(e);
306 
307  auto size = rs2_get_embedded_filters_count(list.get(), &e);
308  error::handle(e);
309 
310  std::vector<embedded_filter> results;
311  for (auto i = 0; i < size; i++)
312  {
313  std::shared_ptr<rs2_embedded_filter> ef(
314  rs2_create_embedded_filter(list.get(), i, &e),
316  error::handle(e);
317 
318  embedded_filter rs2_ef(ef);
319  results.push_back(rs2_ef);
320  }
321  return results;
322  }
323 
324  template<class T>
326  {
327  for (auto&& ef : query_embedded_filters())
328  {
329  if (auto t = ef.as<T>()) return t;
330  }
331  throw rs2::error("Could not find requested embedded filter type!");
332  }
333 
334  sensor& operator=(const std::shared_ptr<rs2_sensor> other)
335  {
336  options::operator=(other);
337  _sensor.reset();
338  _sensor = other;
339  return *this;
340  }
341 
342  sensor& operator=(const sensor& other)
343  {
344  *this = nullptr;
346  _sensor = other._sensor;
347  return *this;
348  }
349  sensor() : _sensor(nullptr) {}
350 
351  operator bool() const
352  {
353  return _sensor != nullptr;
354  }
355 
356  const std::shared_ptr<rs2_sensor>& get() const
357  {
358  return _sensor;
359  }
360 
361  template<class T>
362  bool is() const
363  {
364  T extension(*this);
365  return extension;
366  }
367 
368  template<class T>
369  T as() const
370  {
371  T extension(*this);
372  return extension;
373  }
374 
375  explicit sensor(std::shared_ptr<rs2_sensor> dev)
376  :options((rs2_options*)dev.get()), _sensor(dev)
377  {
378  }
379  explicit operator std::shared_ptr<rs2_sensor>() { return _sensor; }
380 
381  protected:
382  friend context;
383  friend device_list;
384  friend device;
385  friend device_base;
386  friend roi_sensor;
387 
388  std::shared_ptr<rs2_sensor> _sensor;
389 
390 
391  };
392 
393  inline std::shared_ptr<sensor> sensor_from_frame(frame f)
394  {
395  std::shared_ptr<rs2_sensor> psens(f.get_sensor(), rs2_delete_sensor);
396  return std::make_shared<sensor>(psens);
397  }
398 
399  inline bool operator==(const sensor& lhs, const sensor& rhs)
400  {
403  return false;
404 
405  return std::string(lhs.get_info(RS2_CAMERA_INFO_NAME)) == rhs.get_info(RS2_CAMERA_INFO_NAME)
407  }
408 
409  class color_sensor : public sensor
410  {
411  public:
413  : sensor(s.get())
414  {
415  rs2_error* e = nullptr;
417  {
418  _sensor.reset();
419  }
420  error::handle(e);
421  }
422  operator bool() const { return _sensor.get() != nullptr; }
423  };
424 
425  class motion_sensor : public sensor
426  {
427  public:
429  : sensor(s.get())
430  {
431  rs2_error* e = nullptr;
433  {
434  _sensor.reset();
435  }
436  error::handle(e);
437  }
438  operator bool() const { return _sensor.get() != nullptr; }
439  };
440 
441  class fisheye_sensor : public sensor
442  {
443  public:
445  : sensor(s.get())
446  {
447  rs2_error* e = nullptr;
449  {
450  _sensor.reset();
451  }
452  error::handle(e);
453  }
454  operator bool() const { return _sensor.get() != nullptr; }
455  };
456 
457  class roi_sensor : public sensor
458  {
459  public:
461  : sensor(s.get())
462  {
463  rs2_error* e = nullptr;
464  if(rs2_is_sensor_extendable_to(_sensor.get(), RS2_EXTENSION_ROI, &e) == 0 && !e)
465  {
466  _sensor.reset();
467  }
468  error::handle(e);
469  }
470 
472  {
473  rs2_error* e = nullptr;
474  rs2_set_region_of_interest(_sensor.get(), roi.min_x, roi.min_y, roi.max_x, roi.max_y, &e);
475  error::handle(e);
476  }
477 
479  {
480  region_of_interest roi {};
481  rs2_error* e = nullptr;
482  rs2_get_region_of_interest(_sensor.get(), &roi.min_x, &roi.min_y, &roi.max_x, &roi.max_y, &e);
483  error::handle(e);
484  return roi;
485  }
486 
487  operator bool() const { return _sensor.get() != nullptr; }
488  };
489 
490  class depth_sensor : public sensor
491  {
492  public:
494  : sensor(s.get())
495  {
496  rs2_error* e = nullptr;
498  {
499  _sensor.reset();
500  }
501  error::handle(e);
502  }
503 
507  float get_depth_scale() const
508  {
509  rs2_error* e = nullptr;
510  auto res = rs2_get_depth_scale(_sensor.get(), &e);
511  error::handle(e);
512  return res;
513  }
514 
515  operator bool() const { return _sensor.get() != nullptr; }
516  explicit depth_sensor(std::shared_ptr<rs2_sensor> dev) : depth_sensor(sensor(dev)) {}
517  };
518 
520  {
521  public:
523  {
524  rs2_error* e = nullptr;
526  {
527  _sensor.reset();
528  }
529  error::handle(e);
530  }
531 
535  float get_stereo_baseline() const
536  {
537  rs2_error* e = nullptr;
538  auto res = rs2_get_stereo_baseline(_sensor.get(), &e);
539  error::handle(e);
540  return res;
541  }
542 
543  operator bool() const { return _sensor.get() != nullptr; }
544  };
545 
546 
547  class pose_sensor : public sensor
548  {
549  public:
551  : sensor(s.get())
552  {
553  rs2_error* e = nullptr;
555  {
556  _sensor.reset();
557  }
558  error::handle(e);
559  }
560 
570  bool import_localization_map(const std::vector<uint8_t>& lmap_buf) const
571  {
572  rs2_error* e = nullptr;
573  auto res = rs2_import_localization_map(_sensor.get(), lmap_buf.data(), uint32_t(lmap_buf.size()), &e);
574  error::handle(e);
575  return !!res;
576  }
577 
583  std::vector<uint8_t> export_localization_map() const
584  {
585  std::vector<uint8_t> results;
586  rs2_error* e = nullptr;
588  error::handle(e);
589  std::shared_ptr<const rs2_raw_data_buffer> loc_map(map, rs2_delete_raw_data);
590 
591  auto start = rs2_get_raw_data(loc_map.get(), &e);
592  error::handle(e);
593 
594  if (start)
595  {
596  auto size = rs2_get_raw_data_size(loc_map.get(), &e);
597  error::handle(e);
598 
599  results = std::vector<uint8_t>(start, start + size);
600  }
601  return results;
602  }
603 
614  bool set_static_node(const std::string& guid, const rs2_vector& pos, const rs2_quaternion& orient) const
615  {
616  rs2_error* e = nullptr;
617  auto res = rs2_set_static_node(_sensor.get(), guid.c_str(), pos, orient, &e);
618  error::handle(e);
619  return !!res;
620  }
621 
622 
634  bool get_static_node(const std::string& guid, rs2_vector& pos, rs2_quaternion& orient) const
635  {
636  rs2_error* e = nullptr;
637  auto res = rs2_get_static_node(_sensor.get(), guid.c_str(), &pos, &orient, &e);
638  error::handle(e);
639  return !!res;
640  }
641 
646  bool remove_static_node(const std::string& guid) const
647  {
648  rs2_error* e = nullptr;
649  auto res = rs2_remove_static_node(_sensor.get(), guid.c_str(), &e);
650  error::handle(e);
651  return !!res;
652  }
653 
654  operator bool() const { return _sensor.get() != nullptr; }
655  explicit pose_sensor(std::shared_ptr<rs2_sensor> dev) : pose_sensor(sensor(dev)) {}
656  };
657 
658  class wheel_odometer : public sensor
659  {
660  public:
662  : sensor(s.get())
663  {
664  rs2_error* e = nullptr;
666  {
667  _sensor.reset();
668  }
669  error::handle(e);
670  }
671 
676  bool load_wheel_odometery_config(const std::vector<uint8_t>& odometry_config_buf) const
677  {
678  rs2_error* e = nullptr;
679  auto res = rs2_load_wheel_odometry_config(_sensor.get(), odometry_config_buf.data(), uint32_t(odometry_config_buf.size()), &e);
680  error::handle(e);
681  return !!res;
682  }
683 
690  bool send_wheel_odometry(uint8_t wo_sensor_id, uint32_t frame_num, const rs2_vector& translational_velocity)
691  {
692  rs2_error* e = nullptr;
693  auto res = rs2_send_wheel_odometry(_sensor.get(), wo_sensor_id, frame_num, translational_velocity, &e);
694  error::handle(e);
695  return !!res;
696  }
697 
698  operator bool() const { return _sensor.get() != nullptr; }
699  explicit wheel_odometer(std::shared_ptr<rs2_sensor> dev) : wheel_odometer(sensor(dev)) {}
700  };
701 
703  {
704  public:
706  : sensor(s.get())
707  {
708  rs2_error* e = nullptr;
710  {
711  _sensor.reset();
712  }
713  error::handle(e);
714  }
715 
716  operator bool() const { return _sensor.get() != nullptr; }
717 
722  {
723  rs2_error* e = nullptr;
724  auto res = rs2_get_max_usable_depth_range(_sensor.get(), &e);
725  error::handle(e);
726  return res;
727  }
728  };
729 
731  {
732  public:
734  : sensor( s.get() )
735  {
736  rs2_error * e = nullptr;
738  {
739  _sensor.reset();
740  }
741  error::handle( e );
742  }
743 
744  operator bool() const { return _sensor.get() != nullptr; }
745 
750  std::vector< stream_profile > get_debug_stream_profiles() const
751  {
752  std::vector< stream_profile > results;
753 
754  rs2_error * e = nullptr;
755  std::shared_ptr< rs2_stream_profile_list > list(
758  error::handle( e );
759 
760  auto size = rs2_get_stream_profiles_count( list.get(), &e );
761  error::handle( e );
762 
763  for( auto i = 0; i < size; i++ )
764  {
765  stream_profile profile( rs2_get_stream_profile( list.get(), i, &e ) );
766  error::handle( e );
767  results.push_back( profile );
768  }
769 
770  return results;
771  }
772  };
773 
775  {
776  public:
778  : sensor(s.get())
779  {
780  rs2_error* e = nullptr;
782  {
783  _sensor.reset();
784  }
785  error::handle(e);
786  }
787  operator bool() const { return _sensor.get() != nullptr; }
788  };
789 
790 }
791 #endif // LIBREALSENSE_RS2_SENSOR_HPP
notification(rs2_notification *nt)
Definition: rs_sensor.hpp:18
Definition: rs_types.hpp:115
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:655
Definition: rs_sensor.hpp:103
bool operator==(const sensor &lhs, const sensor &rhs)
Definition: rs_sensor.hpp:399
Definition: rs_frame.hpp:354
struct rs2_raw_data_buffer rs2_raw_data_buffer
Definition: rs_types.h:278
Definition: rs_types.hpp:207
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:384
void stop() const
Definition: rs_sensor.hpp:196
std::vector< stream_profile > get_stream_profiles() const
Definition: rs_sensor.hpp:220
region_of_interest get_region_of_interest() const
Definition: rs_sensor.hpp:478
Definition: rs_types.h:181
fisheye_sensor(sensor s)
Definition: rs_sensor.hpp:444
void on_notification(rs2_notification *_notification) override
Definition: rs_sensor.hpp:94
Definition: rs_types.hpp:47
Definition: rs_types.h:197
Definition: rs_sensor.hpp:490
void start(T callback) const
Definition: rs_sensor.hpp:186
int min_x
Definition: rs_types.hpp:209
depth_mapping_sensor(sensor s)
Definition: rs_sensor.hpp:777
Definition: rs_sensor.hpp:774
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)
void rs2_delete_embedded_filter(rs2_embedded_filter *embedded_filter)
Definition: rs_sensor.hpp:441
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:493
std::vector< embedded_filter > query_embedded_filters() const
Definition: rs_sensor.hpp:299
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:382
void rs2_stop(const rs2_sensor *sensor, rs2_error **error)
std::vector< filter > get_recommended_filters() const
Definition: rs_sensor.hpp:274
debug_stream_sensor(sensor s)
Definition: rs_sensor.hpp:733
depth_stereo_sensor(sensor s)
Definition: rs_sensor.hpp:522
std::vector< uint8_t > export_localization_map() const
Definition: rs_sensor.hpp:583
void release() override
Definition: rs_sensor.hpp:99
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:126
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:634
notification()=default
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
Definition: rs_types.h:146
int max_y
Definition: rs_types.hpp:212
sensor(std::shared_ptr< rs2_sensor > dev)
Definition: rs_sensor.hpp:375
friend roi_sensor
Definition: rs_sensor.hpp:386
void set_region_of_interest(const region_of_interest &roi)
Definition: rs_sensor.hpp:471
int max_x
Definition: rs_types.hpp:211
Definition: rs_sensor.hpp:425
rs2_notification_category get_category() const
Definition: rs_sensor.hpp:39
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:92
bool load_wheel_odometery_config(const std::vector< uint8_t > &odometry_config_buf) const
Definition: rs_sensor.hpp:676
Quaternion used to represent rotation.
Definition: rs_types.h:105
Definition: rs_types.h:192
Definition: rs_frame.hpp:1308
rs2_embedded_filter * rs2_create_embedded_filter(const rs2_embedded_filter_list *list, int index, rs2_error **error)
rs2_stream_profile_list * rs2_get_debug_stream_profiles(rs2_sensor *sensor, rs2_error **error)
double get_timestamp() const
Definition: rs_sensor.hpp:56
void open(const stream_profile &profile) const
Definition: rs_sensor.hpp:112
void set_notifications_callback(T callback) const
Definition: rs_sensor.hpp:208
struct rs2_notification rs2_notification
Definition: rs_types.h:308
std::shared_ptr< rs2_sensor > _sensor
Definition: rs_sensor.hpp:388
Definition: rs_types.h:145
max_usable_range_sensor(sensor s)
Definition: rs_sensor.hpp:705
bool remove_static_node(const std::string &guid) const
Definition: rs_sensor.hpp:646
Definition: rs_sensor.hpp:15
std::vector< stream_profile > get_debug_stream_profiles() const
Definition: rs_sensor.hpp:750
float rs2_get_stereo_baseline(rs2_sensor *sensor, rs2_error **error)
friend device_base
Definition: rs_sensor.hpp:385
Definition: rs_types.h:156
Definition: rs_types.h:182
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:349
int rs2_remove_static_node(const rs2_sensor *sensor, const char *guid, rs2_error **error)
Definition: rs_types.h:183
depth_sensor(std::shared_ptr< rs2_sensor > dev)
Definition: rs_sensor.hpp:516
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:702
Definition: rs_options.hpp:155
T as() const
Definition: rs_sensor.hpp:369
pose_sensor(sensor s)
Definition: rs_sensor.hpp:550
void rs2_delete_processing_block(rs2_processing_block *block)
T get_embedded_filter() const
Definition: rs_sensor.hpp:325
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:721
int rs2_get_embedded_filters_count(const rs2_embedded_filter_list *list, rs2_error **error)
struct rs2_options rs2_options
Definition: rs_types.h:303
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:570
Definition: rs_sensor.hpp:88
static void handle(rs2_error *e)
Definition: rs_types.hpp:167
rs2_sensor * get_sensor()
Definition: rs_frame.hpp:456
std::string get_serialized_data() const
Definition: rs_sensor.hpp:74
bool is() const
Definition: rs_sensor.hpp:362
void close() const
Definition: rs_sensor.hpp:174
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:146
Definition: rs_types.h:130
void open(const std::vector< stream_profile > &profiles) const
Definition: rs_sensor.hpp:152
wheel_odometer(sensor s)
Definition: rs_sensor.hpp:661
Definition: rs_processing.hpp:1275
float get_stereo_baseline() const
Definition: rs_sensor.hpp:535
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:174
rs2_log_severity get_severity() const
Definition: rs_sensor.hpp:65
Definition: rs_sensor.hpp:409
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:193
bool set_static_node(const std::string &guid, const rs2_vector &pos, const rs2_quaternion &orient) const
Definition: rs_sensor.hpp:614
motion_sensor(sensor s)
Definition: rs_sensor.hpp:428
options & operator=(const options &other)
Definition: rs_options.hpp:323
Definition: rs_sensor.hpp:658
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:457
friend device_list
Definition: rs_sensor.hpp:383
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:690
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:173
const rs2_raw_data_buffer * rs2_export_localization_map(const rs2_sensor *sensor, rs2_error **error)
rs2_embedded_filter_list * rs2_query_embedded_filters(const rs2_sensor *sensor, rs2_error **error)
std::string get_description() const
Definition: rs_sensor.hpp:47
Definition: rs_sensor.hpp:730
float get_depth_scale() const
Definition: rs_sensor.hpp:507
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:342
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:356
struct rs2_error rs2_error
Definition: rs_types.h:276
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:519
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:547
color_sensor(sensor s)
Definition: rs_sensor.hpp:412
std::vector< stream_profile > get_active_streams() const
Definition: rs_sensor.hpp:247
void rs2_delete_embedded_filter_list(rs2_embedded_filter_list *embedded_filter_list)
sensor & operator=(const std::shared_ptr< rs2_sensor > other)
Definition: rs_sensor.hpp:334
const char * get_info(rs2_camera_info info) const
Definition: rs_sensor.hpp:139
wheel_odometer(std::shared_ptr< rs2_sensor > dev)
Definition: rs_sensor.hpp:699
std::shared_ptr< sensor > sensor_from_frame(frame f)
Definition: rs_sensor.hpp:393
int min_y
Definition: rs_types.hpp:210
roi_sensor(sensor s)
Definition: rs_sensor.hpp:460