ds5-motion.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2016 Intel Corporation. All Rights Reserved.
3 
4 #include "ds5-motion.h"
5 
6 #include <mutex>
7 #include <chrono>
8 #include <vector>
9 #include <map>
10 #include <iterator>
11 #include <cstddef>
12 
13 #include "ds5-timestamp.h"
14 #include "ds5-options.h"
15 #include "stream.h"
16 #include "proc/motion-transform.h"
18 
19 #include "../l500/l500-private.h"
20 
21 using namespace librealsense;
22 namespace librealsense
23 {
24  const std::map<uint32_t, rs2_format> fisheye_fourcc_to_rs2_format = {
25  {rs_fourcc('R','A','W','8'), RS2_FORMAT_RAW8},
26  {rs_fourcc('G','R','E','Y'), RS2_FORMAT_RAW8},
27  };
28  const std::map<uint32_t, rs2_stream> fisheye_fourcc_to_rs2_stream = {
29  {rs_fourcc('R','A','W','8'), RS2_STREAM_FISHEYE},
30  {rs_fourcc('G','R','E','Y'), RS2_STREAM_FISHEYE},
31  };
32 
34  {
35  public:
36  fisheye_auto_exposure_roi_method(std::shared_ptr<auto_exposure_mechanism> auto_exposure)
37  : _auto_exposure(auto_exposure)
38  {}
39 
40  void set(const region_of_interest& roi) override
41  {
42  _auto_exposure->update_auto_exposure_roi(roi);
43  _roi = roi;
44  }
45 
46  region_of_interest get() const override
47  {
48  return _roi;
49  }
50 
51  private:
52  std::shared_ptr<auto_exposure_mechanism> _auto_exposure;
54  };
55 
57  public motion_sensor
58  {
59  public:
61  std::shared_ptr<sensor_base> sensor,
62  device* device,
63  ds5_motion* owner)
64  : synthetic_sensor(name, sensor, device),
65  _owner(owner)
66  {}
67 
69  {
70  return _owner->get_motion_intrinsics(stream);
71  }
72 
74  {
77 
78  for (auto p : results)
79  {
80  // Register stream types
81  if (p->get_stream_type() == RS2_STREAM_ACCEL)
82  assign_stream(_owner->_accel_stream, p);
83  if (p->get_stream_type() == RS2_STREAM_GYRO)
84  assign_stream(_owner->_gyro_stream, p);
85 
86  //set motion intrinsics
87  if (p->get_stream_type() == RS2_STREAM_ACCEL || p->get_stream_type() == RS2_STREAM_GYRO)
88  {
89  auto motion = dynamic_cast<motion_stream_profile_interface*>(p.get());
90  assert(motion);
91  auto st = p->get_stream_type();
92  motion->set_intrinsics([this, st]() { return get_motion_intrinsics(st); });
93  }
94  }
95 
96  return results;
97  }
98 
99  private:
101  };
102 
104  {
105  public:
106  explicit ds5_fisheye_sensor(std::shared_ptr<sensor_base> sensor,
107  device* device,
108  ds5_motion* owner)
109  : synthetic_sensor("Wide FOV Camera", sensor, device, fisheye_fourcc_to_rs2_format, fisheye_fourcc_to_rs2_stream),
110  _owner(owner)
111  {}
112 
114  {
116  *_owner->_fisheye_calibration_table_raw,
118  profile.width, profile.height);
119  }
120 
122  {
124 
126  for (auto p : results)
127  {
128  // Register stream types
129  if (p->get_stream_type() == RS2_STREAM_FISHEYE)
130  assign_stream(_owner->_fisheye_stream, p);
131 
132  auto video = dynamic_cast<video_stream_profile_interface*>(p.get());
133 
134  auto profile = to_profile(p.get());
135  std::weak_ptr<ds5_fisheye_sensor> wp =
136  std::dynamic_pointer_cast<ds5_fisheye_sensor>(this->shared_from_this());
137  video->set_intrinsics([profile, wp]()
138  {
139  auto sp = wp.lock();
140  if (sp)
141  return sp->get_intrinsics(profile);
142  else
143  return rs2_intrinsics{};
144  });
145  }
146 
147  return results;
148  }
149 
150  std::shared_ptr<uvc_sensor> get_raw_sensor()
151  {
152  auto uvc_raw_sensor = As<uvc_sensor, sensor_base>(get_raw_sensor());
153  return uvc_raw_sensor;
154  }
155  private:
157  };
158 
160  {
161  if (stream == RS2_STREAM_ACCEL)
162  return create_motion_intrinsics(**_accel_intrinsic);
163 
164  if (stream == RS2_STREAM_GYRO)
165  return create_motion_intrinsics(**_gyro_intrinsic);
166 
167  throw std::runtime_error(to_string() << "Motion Intrinsics unknown for stream " << rs2_stream_to_string(stream) << "!");
168  }
169 
170  std::shared_ptr<synthetic_sensor> ds5_motion::create_hid_device(std::shared_ptr<context> ctx,
171  const std::vector<platform::hid_device_info>& all_hid_infos,
172  const firmware_version& camera_fw_version)
173  {
174  if (all_hid_infos.empty())
175  {
176  LOG_WARNING("No HID info provided, IMU is disabled");
177  return nullptr;
178  }
179 
180  static const char* custom_sensor_fw_ver = "5.6.0.0";
181 
182  std::unique_ptr<frame_timestamp_reader> iio_hid_ts_reader(new iio_hid_timestamp_reader());
183  std::unique_ptr<frame_timestamp_reader> custom_hid_ts_reader(new ds5_custom_hid_timestamp_reader());
184  auto enable_global_time_option = std::shared_ptr<global_time_option>(new global_time_option());
185 
186  // Dynamically populate the supported HID profiles according to the selected IMU module
187  std::vector<odr> accel_fps_rates;
188  std::map<unsigned, unsigned> fps_and_frequency_map;
189  if (ds::d400_caps::CAP_BMI_085 && _device_capabilities)
190  accel_fps_rates = { odr::IMU_FPS_100,odr::IMU_FPS_200 };
191  else // Applies to BMI_055 and unrecognized sensors
192  accel_fps_rates = { odr::IMU_FPS_63,odr::IMU_FPS_250 };
193 
194  for (auto&& elem : accel_fps_rates)
195  {
196  sensor_name_and_hid_profiles.push_back({ accel_sensor_name, { RS2_FORMAT_MOTION_XYZ32F, RS2_STREAM_ACCEL, 0, 1, 1, static_cast<uint16_t>(elem)} });
197  fps_and_frequency_map.emplace(unsigned(elem), hid_fps_translation.at(elem));
198  }
199  fps_and_sampling_frequency_per_rs2_stream[RS2_STREAM_ACCEL] = fps_and_frequency_map;
200 
201  auto raw_hid_ep = std::make_shared<hid_sensor>(ctx->get_backend().create_hid_device(all_hid_infos.front()),
202  std::unique_ptr<frame_timestamp_reader>(new global_timestamp_reader(std::move(iio_hid_ts_reader), _tf_keeper, enable_global_time_option)),
203  std::unique_ptr<frame_timestamp_reader>(new global_timestamp_reader(std::move(custom_hid_ts_reader), _tf_keeper, enable_global_time_option)),
204  fps_and_sampling_frequency_per_rs2_stream,
205  sensor_name_and_hid_profiles,
206  this);
207 
208  auto hid_ep = std::make_shared<ds5_hid_sensor>("Motion Module", raw_hid_ep, this, this);
209 
210  hid_ep->register_option(RS2_OPTION_GLOBAL_TIME_ENABLED, enable_global_time_option);
211 
212  // register pre-processing
213  std::shared_ptr<enable_motion_correction> mm_correct_opt = nullptr;
214 
215  // Motion intrinsic calibration presents is a prerequisite for motion correction.
216  try
217  {
218  if (_mm_calib)
219  {
220  mm_correct_opt = std::make_shared<enable_motion_correction>(hid_ep.get(),
221  option_range{ 0, 1, 1, 1 });
222  hid_ep->register_option(RS2_OPTION_ENABLE_MOTION_CORRECTION, mm_correct_opt);
223  }
224  }
225  catch (...) {}
226 
227  hid_ep->register_processing_block(
229  { {RS2_FORMAT_MOTION_XYZ32F, RS2_STREAM_ACCEL} },
230  [&, mm_correct_opt]() { return std::make_shared<acceleration_transform>(_mm_calib, mm_correct_opt);
231  });
232 
233  hid_ep->register_processing_block(
235  { {RS2_FORMAT_MOTION_XYZ32F, RS2_STREAM_GYRO} },
236  [&, mm_correct_opt]() { return std::make_shared<gyroscope_transform>(_mm_calib, mm_correct_opt);
237  });
238 
239  if ((camera_fw_version >= firmware_version(custom_sensor_fw_ver)) &&
241  {
242  hid_ep->register_option(RS2_OPTION_MOTION_MODULE_TEMPERATURE,
243  std::make_shared<motion_module_temperature_option>(*raw_hid_ep));
244  }
245 
246  return hid_ep;
247  }
248 
250  {
251  auto uvc_raw_sensor = As<uvc_sensor, sensor_base>(ep->get_raw_sensor());
252  auto gain_option = std::make_shared<uvc_pu_option>(*uvc_raw_sensor, RS2_OPTION_GAIN);
253 
254  auto exposure_option = std::make_shared<uvc_xu_option<uint16_t>>(*uvc_raw_sensor,
255  *fisheye_xu,
256  librealsense::ds::FISHEYE_EXPOSURE, "Exposure time of Fisheye camera");
257 
258  auto ae_state = std::make_shared<auto_exposure_state>();
259  auto auto_exposure = std::make_shared<auto_exposure_mechanism>(*gain_option, *exposure_option, *ae_state);
260 
261  auto auto_exposure_option = std::make_shared<enable_auto_exposure_option>(ep,
263  ae_state,
264  option_range{0, 1, 1, 1});
265 
266  ep->register_option(RS2_OPTION_ENABLE_AUTO_EXPOSURE,auto_exposure_option);
267 
268  ep->register_option(RS2_OPTION_AUTO_EXPOSURE_MODE,
269  std::make_shared<auto_exposure_mode_option>(auto_exposure,
270  ae_state,
271  option_range{0, 2, 1, 0},
272  std::map<float, std::string>{{0.f, "Static"},
273  {1.f, "Anti-Flicker"},
274  {2.f, "Hybrid"}}));
275  ep->register_option(RS2_OPTION_AUTO_EXPOSURE_CONVERGE_STEP,
276  std::make_shared<auto_exposure_step_option>(auto_exposure,
277  ae_state,
278  option_range{ 0.1f, 1.0f, 0.1f, ae_step_default_value }));
279  ep->register_option(RS2_OPTION_POWER_LINE_FREQUENCY,
280  std::make_shared<auto_exposure_antiflicker_rate_option>(auto_exposure,
281  ae_state,
282  option_range{50, 60, 10, 60},
283  std::map<float, std::string>{{50.f, "50Hz"},
284  {60.f, "60Hz"}}));
285 
286  ep->register_option(RS2_OPTION_GAIN,
287  std::make_shared<auto_disabling_control>(
288  gain_option,
289  auto_exposure_option));
290 
291  ep->register_option(RS2_OPTION_EXPOSURE,
292  std::make_shared<auto_disabling_control>(
293  exposure_option,
294  auto_exposure_option));
295 
296  ep->register_processing_block(
297  { {RS2_FORMAT_RAW8}},
299  [auto_exposure_option]() {
300  return std::make_shared<auto_exposure_processor>(RS2_STREAM_FISHEYE, *auto_exposure_option);
301  }
302  );
303  return auto_exposure;
304  }
305 
306  ds5_motion::ds5_motion(std::shared_ptr<context> ctx,
308  : device(ctx, group), ds5_device(ctx, group),
309  _fisheye_stream(new stream(RS2_STREAM_FISHEYE)),
310  _accel_stream(new stream(RS2_STREAM_ACCEL)),
311  _gyro_stream(new stream(RS2_STREAM_GYRO))
312  {
313  using namespace ds;
314 
315  std::vector<platform::hid_device_info> hid_infos = group.hid_devices;
316 
317  if (!hid_infos.empty())
318  {
319  // product id
320  _pid = static_cast<uint16_t>(strtoul(hid_infos.front().pid.data(), nullptr, 16));
321 
322  // motion correction
323  _mm_calib = std::make_shared<mm_calib_handler>(_hw_monitor, _pid);
324 
325  _accel_intrinsic = std::make_shared<lazy<ds::imu_intrinsic>>([this]() { return _mm_calib->get_intrinsic(RS2_STREAM_ACCEL); });
326  _gyro_intrinsic = std::make_shared<lazy<ds::imu_intrinsic>>([this]() { return _mm_calib->get_intrinsic(RS2_STREAM_GYRO); });
327 
328  // use predefined extrinsics
329  _depth_to_imu = std::make_shared<lazy<rs2_extrinsics>>([this]() { return _mm_calib->get_extrinsic(RS2_STREAM_ACCEL); });
330  }
331 
332  initialize_fisheye_sensor(ctx,group);
333 
334  // Make sure all MM streams are positioned with the same extrinsics
339 
340  // Try to add HID endpoint
341  auto hid_ep = create_hid_device(ctx, group.hid_devices, _fw_version);
342  if (hid_ep)
343  {
344  _motion_module_device_idx = static_cast<uint8_t>(add_sensor(hid_ep));
345 
346  // HID metadata attributes
347  hid_ep->get_raw_sensor()->register_metadata(RS2_FRAME_METADATA_FRAME_TIMESTAMP, make_hid_header_parser(&platform::hid_header::timestamp));
348  }
349  }
350 
352  {
353  using namespace ds;
354 
355  auto fisheye_infos = filter_by_mi(group.uvc_devices, 3);
356  fisheye_infos = filter_device_by_capability(fisheye_infos,d400_caps::CAP_FISHEYE_SENSOR);
357 
358  bool fe_dev_present = (fisheye_infos.size() == 1);
359  bool fe_capability = (d400_caps::CAP_UNDEFINED == _device_capabilities) ?
360  true : !!(static_cast<uint32_t>(_device_capabilities&d400_caps::CAP_FISHEYE_SENSOR));
361 
362  // Motion module w/o FishEye sensor
363  if (!(fe_dev_present | fe_capability)) return;
364 
365  // Inconsistent FW
366  if (fe_dev_present ^ fe_capability)
368  << "Inconsistent HW/FW setup, FW FishEye capability = " << fe_capability
369  << ", FishEye devices " << std::dec << fisheye_infos.size()
370  << " while expecting " << fe_capability);
371 
373  {
374  return _mm_calib->get_fisheye_calib_raw();
375  };
376 
377  std::unique_ptr<frame_timestamp_reader> ds5_timestamp_reader_backup(new ds5_timestamp_reader(environment::get_instance().get_time_service()));
378  auto&& backend = ctx->get_backend();
379  std::unique_ptr<frame_timestamp_reader> ds5_timestamp_reader_metadata(new ds5_timestamp_reader_from_metadata(std::move(ds5_timestamp_reader_backup)));
380  auto enable_global_time_option = std::shared_ptr<global_time_option>(new global_time_option());
381  auto raw_fisheye_ep = std::make_shared<uvc_sensor>("FishEye Sensor", backend.create_uvc_device(fisheye_infos.front()),
382  std::unique_ptr<frame_timestamp_reader>(new global_timestamp_reader(std::move(ds5_timestamp_reader_metadata), _tf_keeper, enable_global_time_option)), this);
383  auto fisheye_ep = std::make_shared<ds5_fisheye_sensor>(raw_fisheye_ep, this, this);
384 
385  fisheye_ep->register_option(RS2_OPTION_GLOBAL_TIME_ENABLED, enable_global_time_option);
386  raw_fisheye_ep->register_xu(fisheye_xu); // make sure the XU is initialized everytime we power the camera
387 
388  if (_fw_version >= firmware_version("5.6.3.0")) // Create Auto Exposure controls from FW version 5.6.3.0
389  {
390  auto fisheye_auto_exposure = register_auto_exposure_options(fisheye_ep.get(), &fisheye_xu);
391  fisheye_ep->set_roi_method(std::make_shared<fisheye_auto_exposure_roi_method>(fisheye_auto_exposure));
392  }
393  else
394  {
395  fisheye_ep->register_option(RS2_OPTION_GAIN,
396  std::make_shared<uvc_pu_option>(*raw_fisheye_ep.get(),
397  RS2_OPTION_GAIN));
398  fisheye_ep->register_option(RS2_OPTION_EXPOSURE,
399  std::make_shared<uvc_xu_option<uint16_t>>(*raw_fisheye_ep.get(),
400  fisheye_xu,
402  "Exposure time of Fisheye camera"));
403  }
404 
405  // Metadata registration
408 
409  // attributes of md_capture_timing
410  auto md_prop_offset = offsetof(metadata_raw, mode) +
411  offsetof(md_fisheye_mode, fisheye_mode) +
412  offsetof(md_fisheye_normal_mode, intel_capture_timing);
413 
417 
418  // attributes of md_capture_stats
419  md_prop_offset = offsetof(metadata_raw, mode) +
420  offsetof(md_fisheye_mode, fisheye_mode) +
421  offsetof(md_fisheye_normal_mode, intel_capture_stats);
422 
423  // attributes of md_capture_stats
424  md_prop_offset = offsetof(metadata_raw, mode) +
425  offsetof(md_fisheye_mode, fisheye_mode) +
426  offsetof(md_fisheye_normal_mode, intel_configuration);
427 
433 
434  // attributes of md_fisheye_control
435  md_prop_offset = offsetof(metadata_raw, mode) +
436  offsetof(md_fisheye_mode, fisheye_mode) +
437  offsetof(md_fisheye_normal_mode, intel_fisheye_control);
438 
441 
442  // Add fisheye endpoint
443  _fisheye_device_idx = add_sensor(fisheye_ep);
444  }
445 
446  mm_calib_handler::mm_calib_handler(std::shared_ptr<hw_monitor> hw_monitor, uint16_t pid) :
447  _hw_monitor(hw_monitor), _pid(pid)
448  {
449  _imu_eeprom_raw = [this]() {
450  if (_pid == L515_PID)
451  return get_imu_eeprom_raw_l515();
452  else
453  return get_imu_eeprom_raw();
454  };
455 
456  _calib_parser = [this]() {
457 
458  std::vector<uint8_t> raw(ds::tm1_eeprom_size);
459  uint16_t calib_id = ds::dm_v2_eeprom_id; //assume DM V2 IMU as default platform
460  bool valid = false;
461 
462  if (_pid == L515_PID) calib_id = ds::l500_eeprom_id;
463 
464  try
465  {
466  raw = *_imu_eeprom_raw;
467  calib_id = *reinterpret_cast<uint16_t*>(raw.data());
468  valid = true;
469  }
470  catch(const std::exception&)
471  {
472  // in case calibration table errors (invalid table, empty table, or corrupted table), data is invalid and default intrinsic and extrinsic will be used
473  LOG_WARNING("IMU Calibration is not available, default intrinsic and extrinsic will be used.");
474  }
475 
476  std::shared_ptr<mm_calib_parser> prs = nullptr;
477  switch (calib_id)
478  {
479  case ds::dm_v2_eeprom_id: // DM V2 id
480  prs = std::make_shared<dm_v2_imu_calib_parser>(raw, _pid, valid); break;
481  case ds::tm1_eeprom_id: // TM1 id
482  prs = std::make_shared<tm1_imu_calib_parser>(raw); break;
483  case ds::l500_eeprom_id: // L515
484  prs = std::make_shared<l500_imu_calib_parser>(raw, valid); break;
485  default:
486  throw recoverable_exception(to_string() << "Motion Intrinsics unresolved - "
487  << ((valid)? "device is not calibrated" : "invalid calib type "),
489  }
490  return prs;
491  };
492  }
493 
494  std::vector<uint8_t> mm_calib_handler::get_imu_eeprom_raw() const
495  {
496  const int offset = 0;
497  const int size = ds::eeprom_imu_table_size;
498  command cmd(ds::MMER, offset, size);
499  return _hw_monitor->send(cmd);
500  }
501 
502  std::vector<uint8_t> mm_calib_handler::get_imu_eeprom_raw_l515() const
503  {
504  // read imu calibration table on L515
505  // READ_TABLE 0x243 0
507  return _hw_monitor->send(cmd);
508  }
509 
511  {
512  return (*_calib_parser)->get_intrinsic(stream);
513  }
514 
516  {
517  return (*_calib_parser)->get_extrinsic_to(stream);
518  }
519 
520  const std::vector<uint8_t> mm_calib_handler::get_fisheye_calib_raw()
521  {
522  auto fe_calib_table = (*(ds::check_calib<ds::tm1_eeprom>(*_imu_eeprom_raw))).calibration_table.calib_model.fe_calibration;
523  uint8_t* fe_calib_ptr = reinterpret_cast<uint8_t*>(&fe_calib_table);
524  return std::vector<uint8_t>(fe_calib_ptr, fe_calib_ptr+ ds::fisheye_calibration_table_size);
525  }
526 }
fisheye_auto_exposure_roi_method(std::shared_ptr< auto_exposure_mechanism > auto_exposure)
Definition: ds5-motion.cpp:36
static const textual_icon lock
Definition: model-views.h:218
std::shared_ptr< md_attribute_parser_base > make_rs400_sensor_ts_parser(std::shared_ptr< md_attribute_parser_base > frame_ts_parser, std::shared_ptr< md_attribute_parser_base > sensor_ts_parser)
A helper function to create a specialized parser for RS4xx sensor timestamp.
std::shared_ptr< lazy< ds::imu_intrinsic > > _accel_intrinsic
Definition: ds5-motion.h:424
ds5_fisheye_sensor(std::shared_ptr< sensor_base > sensor, device *device, ds5_motion *owner)
Definition: ds5-motion.cpp:106
firmware_version _fw_version
Definition: ds5-device.h:88
std::shared_ptr< hw_monitor > _hw_monitor
Definition: ds5-device.h:87
GLuint const GLchar * name
metadata_raw - metadata structure layout as transmitted and received by backend
Definition: src/metadata.h:678
optional_value< uint8_t > _motion_module_device_idx
Definition: ds5-motion.h:421
std::shared_ptr< uvc_sensor > get_raw_sensor()
Definition: ds5-motion.cpp:150
static const float ae_step_default_value
Definition: algo.h:18
rs2_intrinsics get_intrinsics(const stream_profile &profile) const override
Definition: ds5-motion.cpp:113
GLfloat GLfloat p
Definition: glext.h:12687
std::shared_ptr< sensor_base > get_raw_sensor() const
Definition: sensor.h:218
constexpr size_t tm1_eeprom_size
Definition: ds5-private.h:520
bool val_in_range(const T &val, const std::initializer_list< T > &list)
Definition: src/types.h:174
#define LOG_WARNING(...)
Definition: src/types.h:241
std::shared_ptr< lazy< rs2_extrinsics > > _depth_to_imu
Definition: ds5-motion.h:427
const std::map< uint32_t, rs2_format > fisheye_fourcc_to_rs2_format
Definition: ds5-motion.cpp:24
virtual stream_profiles init_stream_profiles() override
Definition: sensor.cpp:1225
std::shared_ptr< stream_interface > _gyro_stream
Definition: ds5-motion.h:445
void register_same_extrinsics(const stream_interface &from, const stream_interface &to)
Definition: environment.cpp:23
unsigned short uint16_t
Definition: stdint.h:79
GLsizei const GLchar *const * string
const std::map< uint32_t, rs2_stream > fisheye_fourcc_to_rs2_stream
Definition: ds5-motion.cpp:28
rs2_motion_device_intrinsic get_motion_intrinsics(rs2_stream stream) const
Definition: ds5-motion.cpp:68
unsigned char uint8_t
Definition: stdint.h:78
lazy< std::vector< uint8_t > > _fisheye_calibration_table_raw
Definition: ds5-motion.h:426
rs2_extrinsics get_extrinsic(rs2_stream)
Definition: ds5-motion.cpp:515
const uint16_t RS400_IMU_PID
Definition: ds5-private.h:33
std::shared_ptr< time_diff_keeper > _tf_keeper
static const std::map< IMU_OUTPUT_DATA_RATES, unsigned > hid_fps_translation
Definition: ds5-motion.h:36
void register_extrinsics(const stream_interface &from, const stream_interface &to, std::weak_ptr< lazy< rs2_extrinsics >> extr)
Definition: environment.cpp:28
GLenum mode
std::vector< hid_device_info > hid_devices
Definition: backend.h:527
const uint16_t RS455_PID
Definition: ds5-private.h:48
GLsizeiptr size
void initialize_fisheye_sensor(std::shared_ptr< context > ctx, const platform::backend_device_group &group)
Definition: ds5-motion.cpp:351
optional_value< uint8_t > _fisheye_device_idx
Definition: ds5-motion.h:420
lazy< std::shared_ptr< mm_calib_parser > > _calib_parser
Definition: ds5-motion.h:390
constexpr size_t fisheye_calibration_table_size
Definition: ds5-private.h:455
GLboolean GLuint group
Definition: glext.h:5688
uint32_t rs_fourcc(const T a, const T b, const T c, const T d)
Definition: src/types.h:1846
std::shared_ptr< stream_interface > _depth_stream
Definition: ds5-device.h:92
const uint8_t FISHEYE_EXPOSURE
Definition: ds5-private.h:156
rs2_intrinsics get_intrinsic_by_resolution(const vector< uint8_t > &raw_data, calibration_table_id table_id, uint32_t width, uint32_t height)
stream_profiles init_stream_profiles() override
Definition: ds5-motion.cpp:121
std::shared_ptr< md_attribute_parser_base > make_uvc_header_parser(Attribute St::*attribute, attrib_modifyer mod=nullptr)
A utility function to create UVC metadata header parser.
ds::d400_caps _device_capabilities
Definition: ds5-device.h:90
std::shared_ptr< auto_exposure_mechanism > register_auto_exposure_options(synthetic_sensor *ep, const platform::extension_unit *fisheye_xu)
Definition: ds5-motion.cpp:249
const uint16_t L515_IMU_TABLE
Definition: l500-private.h:48
std::shared_ptr< hw_monitor > _hw_monitor
Definition: ds5-motion.h:389
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
Definition: streaming.h:165
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:42
static const std::string accel_sensor_name
Definition: ds5-motion.h:35
static environment & get_instance()
int add_sensor(const std::shared_ptr< sensor_interface > &sensor_base)
Definition: device.cpp:163
extrinsics_graph & get_extrinsics_graph()
std::shared_ptr< auto_exposure_mechanism > _auto_exposure
Definition: ds5-motion.cpp:52
ds5_hid_sensor(std::string name, std::shared_ptr< sensor_base > sensor, device *device, ds5_motion *owner)
Definition: ds5-motion.cpp:60
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
Definition: rs_sensor.h:96
mm_calib_handler(std::shared_ptr< hw_monitor > hw_monitor, uint16_t pid)
Definition: ds5-motion.cpp:446
const uint16_t RS435I_PID
Definition: ds5-private.h:42
std::shared_ptr< md_attribute_parser_base > make_attribute_parser(Attribute S::*attribute, Flag flag, unsigned long long offset, attrib_modifyer mod=nullptr)
A helper function to create a specialized attribute parser. Return it as a pointer to a base-class...
const std::vector< uint8_t > get_fisheye_calib_raw()
Definition: ds5-motion.cpp:520
std::vector< uint8_t > get_imu_eeprom_raw() const
Definition: ds5-motion.cpp:494
const char * rs2_stream_to_string(rs2_stream stream)
Definition: rs.cpp:1262
stream_profile to_profile(const stream_profile_interface *sp)
Definition: src/stream.h:185
const platform::extension_unit fisheye_xu
Definition: ds5-private.h:162
std::shared_ptr< lazy< ds::imu_intrinsic > > _gyro_intrinsic
Definition: ds5-motion.h:425
stream_profiles init_stream_profiles() override
Definition: ds5-motion.cpp:73
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
Video stream intrinsics.
Definition: rs_types.h:58
const uint16_t L515_PID
Definition: l500-private.h:22
const ds5_motion * _owner
Definition: ds5-motion.cpp:100
void register_stream_to_extrinsic_group(const stream_interface &stream, uint32_t groupd_index)
Definition: device.cpp:246
ds::imu_intrinsic get_intrinsic(rs2_stream)
Definition: ds5-motion.cpp:510
Motion device intrinsics: scale, bias, and variances.
Definition: rs_types.h:103
lazy< std::vector< uint8_t > > _imu_eeprom_raw
Definition: ds5-motion.h:391
#define offsetof(STRUCTURE, FIELD)
Definition: sqlite3.c:11372
constexpr size_t eeprom_imu_table_size
Definition: ds5-private.h:565
std::shared_ptr< md_attribute_parser_base > make_additional_data_parser(Attribute St::*attribute)
A utility function to create additional_data parser.
std::vector< platform::uvc_device_info > filter_by_mi(const std::vector< platform::uvc_device_info > &devices, uint32_t mi)
Definition: context.cpp:644
std::vector< uvc_device_info > uvc_devices
Definition: backend.h:525
ds5_motion(std::shared_ptr< context > ctx, const platform::backend_device_group &group)
Definition: ds5-motion.cpp:306
std::vector< platform::uvc_device_info > filter_device_by_capability(const std::vector< platform::uvc_device_info > &devices, d400_caps caps)
std::vector< uint8_t > get_imu_eeprom_raw_l515() const
Definition: ds5-motion.cpp:502
const uint16_t RS465_PID
Definition: ds5-private.h:45
std::shared_ptr< mm_calib_handler > _mm_calib
Definition: ds5-motion.h:423
std::shared_ptr< stream_interface > _accel_stream
Definition: ds5-motion.h:444
std::shared_ptr< md_attribute_parser_base > make_hid_header_parser(Attribute St::*attribute, attrib_modifyer mod=nullptr)
A utility function to create HID metadata header parser.
const uint16_t RS430I_PID
Definition: ds5-private.h:44
rs2_frame_metadata_value
Per-Frame-Metadata is the set of read-only properties that might be exposed for each individual frame...
Definition: rs_frame.h:29
const uint16_t RS405_PID
Definition: ds5-private.h:47
GLintptr offset
rs2_motion_device_intrinsic get_motion_intrinsics(rs2_stream) const
Definition: ds5-motion.cpp:159
std::shared_ptr< synthetic_sensor > create_hid_device(std::shared_ptr< context > ctx, const std::vector< platform::hid_device_info > &all_hid_infos, const firmware_version &camera_fw_version)
Definition: ds5-motion.cpp:170
std::string to_string(T value)
rs2_motion_device_intrinsic create_motion_intrinsics(imu_intrinsic data)
Definition: ds5-private.h:604


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:12