l500-depth.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2018 Intel Corporation. All Rights Reserved.
3 
4 #include <vector>
5 #include "device.h"
6 #include "context.h"
7 #include "stream.h"
8 #include "l500-depth.h"
9 #include "l500-color.h"
10 #include "l500-private.h"
11 #include "proc/decimation-filter.h"
12 #include "proc/threshold.h"
13 #include "proc/spatial-filter.h"
14 #include "proc/temporal-filter.h"
16 #include "proc/zero-order.h"
17 #include <cstddef>
18 #include "metadata-parser.h"
19 #include "l500-options.h"
20 #include "ac-trigger.h"
22 #include "algo/depth-to-rgb-calibration/utils.h" // validate_dsm_params
24 
25 
26 #define MM_TO_METER 1/1000
27 #define MIN_ALGO_VERSION 115
28 
29 namespace librealsense
30 {
31  using namespace ivcam2;
32 
34  {
35  // Get RAW data from firmware
36  AC_LOG(DEBUG, "DPT_INTRINSICS_FULL_GET");
37  std::vector< uint8_t > response_vec = _hw_monitor->send( command{ DPT_INTRINSICS_FULL_GET } );
38 
39  if (response_vec.empty())
40  throw invalid_value_exception("Calibration data invalid,buffer size is zero");
41 
42  auto resolutions_depth_table_ptr = reinterpret_cast<const ivcam2::intrinsic_depth *>(response_vec.data());
43 
44  auto num_of_resolutions = resolutions_depth_table_ptr->resolution.num_of_resolutions;
45  // Get full maximum size of the resolution array and deduct the unused resolutions size from it
46  size_t expected_size = sizeof( ivcam2::intrinsic_depth ) -
48  - num_of_resolutions)
49  * sizeof( intrinsic_per_resolution ) );
50 
51  // Validate table size
52  // FW API guarantee only as many bytes as required for the given number of resolutions,
53  // The FW keeps the right to send more bytes.
54  if (expected_size > response_vec.size() ||
55  num_of_resolutions > MAX_NUM_OF_DEPTH_RESOLUTIONS)
56  {
58  to_string() << "Calibration data invalid, number of resolutions is: " << num_of_resolutions <<
59  ", expected size: " << expected_size << " , actual size: " << response_vec.size() );
60  }
61 
62  // Set a new memory allocated intrinsics struct (Full size 5 resolutions)
63  // Copy the relevant data from the dynamic resolution received from the FW
64  ivcam2::intrinsic_depth resolutions_depth_table_output;
65  librealsense::copy(&resolutions_depth_table_output, resolutions_depth_table_ptr, expected_size);
66 
67  return resolutions_depth_table_output;
68  }
69 
70  l500_depth::l500_depth(std::shared_ptr<context> ctx,
72  :device(ctx, group),
73  l500_device(ctx, group)
74  {
75  _calib_table = [this]() { return read_intrinsics_table(); };
76 
78  auto& raw_depth_sensor = get_raw_depth_sensor();
79 
80  depth_sensor.register_option(
82  std::make_shared< l500_temperature_options >( this,
84  "Laser Driver temperature" ) );
85 
86  depth_sensor.register_option(
88  std::make_shared< l500_temperature_options >( this,
90  "Mems Controller temperature" ) );
91 
92  depth_sensor.register_option(
94  std::make_shared< l500_temperature_options >( this,
96  "DSP controller temperature" ) );
97 
98  depth_sensor.register_option(
100  std::make_shared< l500_temperature_options >( this,
102  "Avalanche Photo Diode temperature" ) );
103 
104  depth_sensor.register_option(
106  std::make_shared< l500_temperature_options >( this,
108  "Humidity temperature" ) );
109 
110  depth_sensor.register_option(
112  std::make_shared< nest_option >( this, "Noise estimation" ) );
113 
116 
120 
121  auto error_control = std::make_shared<uvc_xu_option<int>>(raw_depth_sensor, ivcam2::depth_xu, L500_ERROR_REPORTING, "Error reporting");
122 
123  _polling_error_handler = std::make_shared<polling_error_handler>(1000,
124  error_control,
125  raw_depth_sensor.get_notifications_processor(),
126  std::make_shared<l500_notification_decoder>());
127 
128  depth_sensor.register_option(RS2_OPTION_ERROR_POLLING_ENABLED, std::make_shared<polling_errors_disable>(_polling_error_handler));
129 
130  // option to enable workaround for help weak usb hosts to support L515 devices
131  // with improved performance and stability
132  if(_fw_version >= firmware_version( "1.5.1.0" ) )
133  {
134  rs2_host_perf_mode launch_perf_mode = RS2_HOST_PERF_DEFAULT;
135 
136 #ifdef __ANDROID__
137  // android devices most likely low power low performance host
138  launch_perf_mode = RS2_HOST_PERF_LOW;
139 #else
140  // other hosts use default settings from firmware, user still have the option to change later after launch
141  launch_perf_mode = RS2_HOST_PERF_DEFAULT;
142 #endif
143 
144  depth_sensor.register_option(RS2_OPTION_HOST_PERFORMANCE, std::make_shared<librealsense::float_option_with_description<rs2_host_perf_mode>>(option_range{ RS2_HOST_PERF_DEFAULT, RS2_HOST_PERF_COUNT - 1, 1, (float) launch_perf_mode }, "Optimize based on host performance, low power low performance host or high power high performance host"));
145 
146  }
147 
148  // attributes of md_capture_timing
149  auto md_prop_offset = offsetof(metadata_raw, mode) +
150  offsetof(md_l500_depth, intel_capture_timing);
151 
156 
157  // attributes of md_depth_control
158  md_prop_offset = offsetof(metadata_raw, mode) +
159  offsetof(md_l500_depth, intel_depth_control);
160 
163  }
164 
165  std::vector<tagged_profile> l500_depth::get_profiles_tags() const
166  {
167  std::vector<tagged_profile> tags;
168 
170 
171  int width = usb3mode ? 640 : 320;
172  int height = usb3mode ? 480 : 240;
173 
177  tags.push_back({ RS2_STREAM_DEPTH, -1, -1, -1, RS2_FORMAT_FG, -1, profile_tag::PROFILE_TAG_DEBUG } );
178  return tags;
179  }
180 
181  std::shared_ptr<matcher> l500_depth::create_matcher(const frame_holder& frame) const
182  {
183  std::vector<std::shared_ptr<matcher>> depth_matchers;
184 
185  std::vector<stream_interface*> streams = { _depth_stream.get(), _ir_stream.get(), _confidence_stream.get() };
186 
187  for (auto& s : streams)
188  {
189  depth_matchers.push_back(std::make_shared<identity_matcher>(s->get_unique_id(), s->get_stream_type()));
190  }
191  std::vector<std::shared_ptr<matcher>> matchers;
192  matchers.push_back(std::make_shared<timestamp_composite_matcher>(depth_matchers));
193 
194  return std::make_shared<timestamp_composite_matcher>(matchers);
195  }
196 
197  // If the user did not ask for IR, The open function will add it anyway.
198  // This class filters the IR frames is this case so they will not get to the user callback function
199  // Note: This is a workaround , theoretically we did not need to add manually the IR profile to the "open" function,
200  // The processing block should take care of it, this caused a syncer bug to pop-up so we avoid this solution for now.
202  {
203  public:
204  explicit frame_filter(frame_callback_ptr user_callback, const stream_profiles &user_requests) :
205  _user_callback(user_callback),
206  _user_requests(user_requests) {}
207 
208  void on_frame( rs2_frame * f ) override
209  {
210  if( is_user_requested_frame( (frame_interface *)f ) )
211  {
212  _user_callback->on_frame( f );
213  }
214  else
215  {
216  // No RAII - explicit release is required
217  ( (frame_interface *)f )->release();
218  }
219  }
220 
221  void release() override {}
222 
223  private:
225  {
226  return std::find_if(_user_requests.begin(), _user_requests.end(), [&](std::shared_ptr<stream_profile_interface> sp)
227  {
228  return stream_profiles_equal(frame->get_stream().get(), sp.get());
229  }) != _user_requests.end();
230  }
231 
233  {
234  auto vl = dynamic_cast<video_stream_profile_interface*>(l);
235  auto vr = dynamic_cast<video_stream_profile_interface*>(r);
236 
237  if (!vl || !vr)
238  return false;
239 
240  return l->get_framerate() == r->get_framerate() &&
241  vl->get_width() == vr->get_width() &&
242  vl->get_height() == vr->get_height() &&
243  vl->get_stream_type() == vr->get_stream_type();
244  }
245 
248  };
249 
251  l500_device* owner,
252  std::shared_ptr<uvc_sensor> uvc_sensor,
253  std::map<uint32_t, rs2_format> l500_depth_fourcc_to_rs2_format_map,
254  std::map<uint32_t, rs2_stream> l500_depth_fourcc_to_rs2_stream_map
255  )
256  : synthetic_sensor( "L500 Depth Sensor",
257  uvc_sensor,
258  owner,
259  l500_depth_fourcc_to_rs2_format_map,
260  l500_depth_fourcc_to_rs2_stream_map )
261  , _owner( owner )
262  {
263 
264  register_option( RS2_OPTION_DEPTH_UNITS, std::make_shared<const_value_option>( "Number of meters represented by a single depth unit",
265  lazy<float>( [&]() {
266  return read_znorm(); } ) ) );
267 
268  register_option( RS2_OPTION_DEPTH_OFFSET, std::make_shared<const_value_option>( "Offset from sensor to depth origin in millimetrers",
269  lazy<float>( [&]() {
270  return get_depth_offset(); } ) ) );
271 
272  }
273 
275  {
277  }
278 
280  {
281  const int algo_version_address = 0xa0020bd8;
282  command cmd(ivcam2::fw_cmd::MRD, algo_version_address, algo_version_address + 4);
283  auto res = _owner->_hw_monitor->send(cmd);
284  if (res.size() < 2)
285  {
286  throw std::runtime_error("Invalid result size!");
287  }
288  auto data = (uint8_t*)res.data();
289  auto ver = data[0] + 100* data[1];
290  return ver;
291  }
292 
294  {
295  throw librealsense::not_implemented_exception( "depth sensor does not support intrinsics override" );
296  }
297 
299  {
300  throw librealsense::not_implemented_exception( "depth sensor does not support extrinsics override" );
301  }
302 
304  {
305  ac_depth_results table = { { 0 } };
306  read_fw_table( *_owner->_hw_monitor, table.table_id, &table, nullptr,
307  [&]()
308  {
309  //time_t t;
310  //time( &t ); // local time
311  //table.params.timestamp = mktime( gmtime( &t ) ); // UTC time
312  // Leave the timestamp & version at 0, so it's recognizable as "new"
313  //table.params.version = table.this_version;
314  table.params.model = RS2_DSM_CORRECTION_AOT;
315  table.params.h_scale = table.params.v_scale = 1.;
316  } );
317  return table.params;
318  }
319 
321  {
322  try
323  {
325  }
326  catch( invalid_value_exception const & e )
327  {
328  if( ! getenv( "RS2_AC_IGNORE_LIMITERS" ))
329  throw;
330  AC_LOG( ERROR, "Ignoring (RS2_AC_IGNORE_LIMITERS) " << e.what() );
331  }
332 
333  ac_depth_results table( dsm_params );
334  // table.params.timestamp = std::chrono::system_clock::now().time_since_epoch().count();
335  time_t t;
336  time( &t ); // local time
337  table.params.timestamp = mktime( gmtime( &t ) ); // UTC time
338  table.params.version = ac_depth_results::this_version;
339 
340  AC_LOG( INFO, "Overriding DSM : " << table.params );
342  }
343 
345  {
347  _owner->_hw_monitor->send( cmd );
348  AC_LOG( INFO, "Depth sensor calibration has been reset" );
349  }
350 
352  {
353  using namespace algo::max_usable_range;
354 
356  throw librealsense::wrong_api_call_sequence_exception( "max usable range option is not supported" );
357 
359  throw librealsense::wrong_api_call_sequence_exception( "max usable range option is not on" );
360 
361  if( ! is_streaming() )
362  {
363  throw librealsense::wrong_api_call_sequence_exception("depth sensor is not streaming!");
364  }
365 
366  float noise_estimation = static_cast<float>(_owner->get_temperatures().nest_avg);
367 
368  return l500::max_usable_range(noise_estimation);
369  }
370 
372  {
374  }
375 
376  // We want to disable max-usable-range when not in a particular preset:
378  {
379  auto res = _owner->_hw_monitor->send(command(ivcam2::IRB, 0x6C, 0x2, 0x1));
380 
381  if (res.size() < sizeof(uint8_t))
382  {
384  to_string() << "Gain trim FW command failed: size expected: " << sizeof(uint8_t)
385  << " , size received: " << res.size());
386  }
387 
388  int gtr = static_cast<int>(res[0]);
389  int apd = static_cast<int>(get_option(RS2_OPTION_AVALANCHE_PHOTO_DIODE).query());
390  int laser_power = static_cast<int>(get_option(RS2_OPTION_LASER_POWER).query());
391  int max_laser_power = static_cast<int>(get_option(RS2_OPTION_LASER_POWER).get_range().max);
392 
393  return ((apd == 9) && (gtr == 0) && (laser_power == max_laser_power)); // indicates max_range preset
394  }
395 
396 
398  {
399  const int baseline_address = 0xa00e0868;
400  command cmd(ivcam2::fw_cmd::MRD, baseline_address, baseline_address + 4);
401  auto res = _owner->_hw_monitor->send(cmd);
402  if (res.size() < 1)
403  {
404  throw std::runtime_error("Invalid result size!");
405  }
406  auto data = (float*)res.data();
407  return *data;
408  }
409 
411  {
412  auto intrin = get_intrinsic();
413  if (intrin.resolution.num_of_resolutions < 1)
414  {
415  throw std::runtime_error("Invalid intrinsics!");
416  }
417  auto znorm = intrin.resolution.intrinsic_resolution[0].world.znorm;
418  return 1/znorm* MM_TO_METER;
419  }
420 
422  {
423  using namespace ivcam2;
424  auto & intrinsic = *_owner->_calib_table;
425  return intrinsic.orient.depth_offset;
426  }
427 
429  {
430  std::lock_guard<std::recursive_mutex> lock(_mtx);
431 
432  auto f = std::dynamic_pointer_cast<librealsense::frame>(frame);
433  if (has_metadata_ts(frame))
434  {
435  auto md = (librealsense::metadata_raw*)(f->additional_data.metadata_blob.data());
436  return (double)(md->header.timestamp)*TIMESTAMP_USEC_TO_MSEC;
437  }
438  else
439  {
440  if (!one_time_note)
441  {
442  LOG_WARNING("UVC metadata payloads are not available for stream "
443  //<< std::hex << mode.pf->fourcc << std::dec << (mode.profile.format)
444  << ". Please refer to installation chapter for details.");
445  one_time_note = true;
446  }
447  return _backup_timestamp_reader->get_frame_timestamp(frame);
448  }
449  }
450 
451  unsigned long long l500_timestamp_reader_from_metadata::get_frame_counter(const std::shared_ptr<frame_interface>& frame) const
452  {
453  std::lock_guard<std::recursive_mutex> lock(_mtx);
454 
455  auto f = std::dynamic_pointer_cast<librealsense::frame>(frame);
456  if (has_metadata_fc(frame))
457  {
458  auto md = (byte*)(f->additional_data.metadata_blob.data());
459  // WA until we will have the struct of metadata
460  return ((int*)md)[7];
461  }
462 
463  return _backup_timestamp_reader->get_frame_counter(frame);
464  }
465 
467  {
468  std::lock_guard<std::recursive_mutex> lock(_mtx);
469  one_time_note = false;
470  _backup_timestamp_reader->reset();
471  ts_wrap.reset();
472  }
473 
475  {
476  std::lock_guard<std::recursive_mutex> lock(_mtx);
477 
478  return (has_metadata_ts(frame)) ? RS2_TIMESTAMP_DOMAIN_HARDWARE_CLOCK : _backup_timestamp_reader->get_frame_timestamp_domain(frame);
479  }
480 
482  {
484  res.push_back(std::make_shared<temporal_filter>());
485  return res;
486  }
487 
489  {
491  {
492  // option to improve performance and stability on weak android hosts
493  // please refer to following bug report for details
494  // RS5-8011 [Android-L500 Hard failure] Device detach and disappear from system during stream
495 
496  auto host_perf = get_option(RS2_OPTION_HOST_PERFORMANCE).query();
497 
498  if (host_perf == RS2_HOST_PERF_LOW || host_perf == RS2_HOST_PERF_HIGH)
499  {
500  // TPROC USB Granularity and TRB threshold settings for improved performance and stability
501  // on hosts with weak cpu and system performance
502  // settings values are validated through many experiments, do not change
503 
504  // on low power low performance host, usb trb set to larger granularity to reduce number of transactions
505  // and improve performance
506  int ep2_usb_trb = 7; // 7 KB
507  int ep3_usb_trb = 3; // 3 KB
508  int ep4_usb_trb = 3; // 3 KB
509 
510  if (host_perf == RS2_HOST_PERF_LOW)
511  {
512  ep2_usb_trb = 16; // 16 KB
513  ep3_usb_trb = 12; // 12 KB
514  ep4_usb_trb = 6; // 6 KB
515  }
516 
517  try {
518  // Keep the USB power on while triggering multiple calls on it.
519  ivcam2::group_multiple_fw_calls(*this, [&]() {
520  // endpoint 2 (depth)
521  command cmdTprocGranEp2(ivcam2::TPROC_USB_GRAN_SET, 2, ep2_usb_trb);
522  _owner->_hw_monitor->send(cmdTprocGranEp2);
523 
524  command cmdTprocThresholdEp2(ivcam2::TPROC_TRB_THRSLD_SET, 2, 1);
525  _owner->_hw_monitor->send(cmdTprocThresholdEp2);
526 
527  // endpoint 3 (IR)
528  command cmdTprocGranEp3(ivcam2::TPROC_USB_GRAN_SET, 3, ep3_usb_trb);
529  _owner->_hw_monitor->send(cmdTprocGranEp3);
530 
531  command cmdTprocThresholdEp3(ivcam2::TPROC_TRB_THRSLD_SET, 3, 1);
532  _owner->_hw_monitor->send(cmdTprocThresholdEp3);
533 
534  // endpoint 4 (confidence)
535  command cmdTprocGranEp4(ivcam2::TPROC_USB_GRAN_SET, 4, ep4_usb_trb);
536  _owner->_hw_monitor->send(cmdTprocGranEp4);
537 
538  command cmdTprocThresholdEp4(ivcam2::TPROC_TRB_THRSLD_SET, 4, 1);
539  _owner->_hw_monitor->send(cmdTprocThresholdEp4);
540  });
541  LOG_DEBUG("Depth and IR usb tproc granularity and TRB threshold updated.");
542  } catch (...)
543  {
544  LOG_WARNING("FAILED TO UPDATE depth usb tproc granularity and TRB threshold. performance and stability maybe impacted on certain platforms.");
545  }
546  }
547  else if (host_perf == RS2_HOST_PERF_DEFAULT)
548  {
549  LOG_DEBUG("Default host performance mode, Depth/IR/Confidence usb tproc granularity and TRB threshold not changed");
550  }
551  }
552 
553  // The delay is here as a work around to a firmware bug [RS5-5453]
555  synthetic_sensor::start( std::make_shared< frame_filter >( callback, _user_requests ) );
556 
558 
559  if( _owner->_autocal )
560  _owner->_autocal->start();
561  } );
562  }
563 
565  {
566  // The delay is here as a work around to a firmware bug [RS5-5453]
568 
569  if( _owner->_autocal )
570  _owner->_autocal->stop();
571 
573 
574  }
575 
577  {
578  auto vl = dynamic_cast<video_stream_profile_interface*>(l);
579  auto vr = dynamic_cast<video_stream_profile_interface*>(r);
580 
581  if (!vl || !vr)
582  return false;
583 
584  return l->get_framerate() == r->get_framerate() &&
585  vl->get_width() == vr->get_width() &&
586  vl->get_height() == vr->get_height();
587  }
588 
589 
590  std::shared_ptr< stream_profile_interface > l500_depth_sensor::is_color_sensor_needed() const
591  {
592  // If AC is off, we don't need the color stream on
593  if( !_owner->_autocal )
594  return {};
595 
596  auto is_rgb_requested
597  = std::find_if( _user_requests.begin(),
598  _user_requests.end(),
599  []( std::shared_ptr< stream_profile_interface > const & sp )
600  { return sp->get_stream_type() == RS2_STREAM_COLOR; } )
601  != _user_requests.end();
602  if( is_rgb_requested )
603  return {};
604 
605  // Find a profile that's acceptable for RGB:
606  // 1. has the same framerate
607  // 2. format is RGB8
608  // 2. has the right resolution (1280x720 should be good enough)
609  auto user_request
610  = std::find_if( _user_requests.begin(),
611  _user_requests.end(),
612  []( std::shared_ptr< stream_profile_interface > const & sp ) {
613  return sp->get_stream_type() == RS2_STREAM_DEPTH;
614  } );
615  if( user_request == _user_requests.end() )
616  {
617  AC_LOG( ERROR, "Depth input stream profiles do not contain depth!" );
618  return {};
619  }
620  auto requested_depth_profile
621  = dynamic_cast< video_stream_profile * >( user_request->get() );
622 
623  auto & color_sensor = *_owner->get_color_sensor();
624  auto color_profiles = color_sensor.get_stream_profiles();
625  auto rgb_profile = std::find_if(
626  color_profiles.begin(),
627  color_profiles.end(),
628  [&]( std::shared_ptr< stream_profile_interface > const & sp )
629  {
630  auto vsp = dynamic_cast< video_stream_profile * >( sp.get() );
631  return vsp->get_stream_type() == RS2_STREAM_COLOR
632  && vsp->get_framerate() == requested_depth_profile->get_framerate()
633  && vsp->get_format() == RS2_FORMAT_RGB8
634  && vsp->get_width() == 1280 // flipped
635  && vsp->get_height() == 720;
636  } );
637  if( rgb_profile == color_profiles.end() )
638  {
639  AC_LOG( ERROR,
640  "Can't find color stream corresponding to depth; AC will not work" );
641  return {};
642  }
643  return *rgb_profile;
644  }
645 
647  {
648  try
649  {
650  _user_requests = requests;
651 
652  auto is_ir_requested
653  = std::find_if( requests.begin(),
654  requests.end(),
655  []( std::shared_ptr< stream_profile_interface > const & sp ) {
656  return sp->get_stream_type() == RS2_STREAM_INFRARED;
657  } )
658  != requests.end();
659 
660  auto is_ir_needed
661  = std::find_if( requests.begin(),
662  requests.end(),
663  []( std::shared_ptr< stream_profile_interface > const & sp ) {
664  return sp->get_format() != RS2_FORMAT_FG;
665  } )
666  != requests.end();
667 
668  _validator_requests = requests;
669 
670  // Enable IR stream if user didn't asked for IR
671  // IR stream improves depth frames
672  if( ! is_ir_requested && is_ir_needed )
673  {
674  auto user_request = std::find_if(requests.begin(), requests.end(), [](std::shared_ptr<stream_profile_interface> sp)
675  {return sp->get_stream_type() != RS2_STREAM_INFRARED;});
676 
677  if (user_request == requests.end())
678  throw std::runtime_error(to_string() << "input stream_profiles is invalid");
679 
680  auto user_request_profile = dynamic_cast<video_stream_profile*>(user_request->get());
681 
683 
684  auto corresponding_ir = std::find_if(sp.begin(), sp.end(), [&](std::shared_ptr<stream_profile_interface> sp)
685  {
686  auto vs = dynamic_cast<video_stream_profile*>(sp.get());
687  return sp->get_stream_type() == RS2_STREAM_INFRARED && stream_profiles_correspond(sp.get(), user_request_profile);
688  });
689 
690  if (corresponding_ir == sp.end())
691  throw std::runtime_error(to_string() << "can't find ir stream corresponding to user request");
692 
693  _validator_requests.push_back(*corresponding_ir);
694  }
695 
696 
697  auto dp = std::find_if( requests.begin(),
698  requests.end(),
699  []( std::shared_ptr< stream_profile_interface > sp ) {
700  return sp->get_stream_type() == RS2_STREAM_DEPTH;
701  } );
702  if( dp != requests.end() && supports_option( RS2_OPTION_SENSOR_MODE ) )
703  {
705  auto vs = dynamic_cast<video_stream_profile*>((*dp).get());
706  if( vs->get_format() == RS2_FORMAT_Z16 )
707  sensor_mode_option.set(float(get_resolution_from_width_height(vs->get_width(), vs->get_height())));
708  }
709 
711  }
712  catch( ... )
713  {
714  LOG_ERROR( "Exception caught in l500_depth_sensor::open" );
715  throw;
716  }
717  }
718 
719 } // namespace librealsense
rs2_sensor_mode get_resolution_from_width_height(int width, int height)
std::shared_ptr< hw_monitor > _hw_monitor
Definition: l500-device.h:91
static const textual_icon lock
Definition: model-views.h:218
virtual void register_option(rs2_option id, std::shared_ptr< option > option)
Definition: sensor.cpp:1070
const uint8_t L500_ERROR_REPORTING
Definition: l500-private.h:32
float get_max_usable_depth_range() const override
Definition: l500-depth.cpp:351
bool stream_profiles_equal(stream_profile_interface *l, stream_profile_interface *r)
Definition: l500-depth.cpp:232
static const double TIMESTAMP_USEC_TO_MSEC
Definition: src/types.h:92
rs2_stream get_stream_type() const override
Definition: src/stream.cpp:52
frame_callback_ptr _user_callback
Definition: l500-depth.cpp:246
void open(const stream_profiles &requests) override
Definition: sensor.cpp:1422
metadata_raw - metadata structure layout as transmitted and received by backend
Definition: src/metadata.h:678
GLdouble s
std::shared_ptr< rs2_frame_callback > frame_callback_ptr
Definition: src/types.h:1071
l500_depth(std::shared_ptr< context > ctx, const platform::backend_device_group &group)
Definition: l500-depth.cpp:70
#define LOG_WARNING(...)
Definition: src/types.h:241
stream_profiles get_stream_profiles(int tag=profile_tag::PROFILE_TAG_ANY) const override
Definition: sensor.cpp:196
Video DSM (Digital Sync Module) parameters for calibration (same layout as in FW ac_depth_params) Thi...
Definition: rs_types.h:74
virtual l500_color_sensor * get_color_sensor()=0
std::shared_ptr< stream_profile_interface > is_color_sensor_needed() const
Definition: l500-depth.cpp:590
rs2_intrinsics intrin
void register_same_extrinsics(const stream_interface &from, const stream_interface &to)
Definition: environment.cpp:23
static processing_blocks get_l500_recommended_proccesing_blocks()
Definition: l500-depth.cpp:481
bool supports_option(rs2_option id) const override
Definition: options.h:51
bool is_user_requested_frame(frame_interface *frame)
Definition: l500-depth.cpp:224
platform::usb_spec _usb_mode
Definition: l500-device.h:114
rs2_host_perf_mode
values for RS2_OPTION_HOST_PERFORMANCE option.
Definition: rs_option.h:202
virtual option_range get_range() const =0
unsigned char uint8_t
Definition: stdint.h:78
e
Definition: rmse.py:177
option & get_option(rs2_option id) override
Definition: options.h:58
ivcam2::intrinsic_depth get_intrinsic() const override
Definition: l500-depth.h:218
std::shared_ptr< stream_interface > _depth_stream
Definition: l500-device.h:98
virtual float query() const =0
void open(const stream_profiles &requests) override
Definition: l500-depth.cpp:646
std::shared_ptr< ivcam2::ac_trigger > _autocal
Definition: l500-device.h:102
stream_profiles _user_requests
Definition: l500-depth.cpp:247
std::vector< tagged_profile > get_profiles_tags() const override
Definition: l500-depth.cpp:165
std::shared_ptr< stream_interface > _confidence_stream
Definition: l500-device.h:100
GLdouble t
stream_profiles _user_requests
Definition: l500-depth.h:270
GLdouble f
firmware_version _fw_version
Definition: l500-device.h:97
GLenum mode
l500_depth_sensor(l500_device *owner, std::shared_ptr< uvc_sensor > uvc_sensor, std::map< uint32_t, rs2_format > l500_depth_sourcc_to_rs2_format_map, std::map< uint32_t, rs2_stream > l500_depth_sourcc_to_rs2_stream_map)
Definition: l500-depth.cpp:250
dictionary streams
Definition: t265_stereo.py:140
stream_profiles get_debug_stream_profiles() const override
Definition: l500-depth.cpp:371
void start(frame_callback_ptr callback) override
Definition: sensor.cpp:1491
GLdouble GLdouble r
GLboolean GLuint group
Definition: glext.h:5688
GLdouble GLdouble x2
std::shared_ptr< stream_interface > _ir_stream
Definition: l500-device.h:99
l500_depth_sensor & get_depth_sensor()
#define MM_TO_METER
Definition: l500-depth.cpp:26
GLint GLsizei GLsizei height
def callback(frame)
Definition: t265_stereo.py:91
void do_after_delay(std::function< void()> action, int milliseconds=2000)
Definition: l500-device.h:133
void override_intrinsics(rs2_intrinsics const &intr) override
Definition: l500-depth.cpp:293
lazy< ivcam2::intrinsic_depth > _calib_table
Definition: l500-device.h:96
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.
uvc_sensor & get_raw_depth_sensor()
Definition: l500-device.h:46
#define LOG_ERROR(...)
Definition: src/types.h:242
rs2_time_t get_frame_timestamp(const std::shared_ptr< frame_interface > &frame) override
Definition: l500-depth.cpp:428
void write_fw_table(hw_monitor &hwm, uint16_t const table_id, T const &table, uint16_t const version=0x0100)
Definition: l500-private.h:149
frame_filter(frame_callback_ptr user_callback, const stream_profiles &user_requests)
Definition: l500-depth.cpp:204
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
Definition: streaming.h:165
unsigned long long get_frame_counter(const std::shared_ptr< frame_interface > &frame) const override
Definition: l500-depth.cpp:451
float read_baseline() const override
Definition: l500-depth.cpp:397
bool is_streaming() const override
Definition: sensor.cpp:1619
static environment & get_instance()
#define AC_LOG(TYPE, MSG)
extrinsics_graph & get_extrinsics_graph()
ivcam2::intrinsic_depth read_intrinsics_table() const
Definition: l500-depth.cpp:33
bool stream_profiles_correspond(stream_profile_interface *l, stream_profile_interface *r)
Definition: l500-depth.cpp:576
GLenum GLenum GLsizei void * table
void validate_dsm_params(struct rs2_dsm_params const &dsm_params)
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
Definition: rs_sensor.h:96
virtual std::shared_ptr< stream_profile_interface > get_stream() const =0
GLuint GLfloat GLfloat GLfloat x1
Definition: glext.h:9721
void set(float value) override
unsigned char byte
Definition: src/types.h:52
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...
void override_dsm_params(rs2_dsm_params const &dsm_params) override
Definition: l500-depth.cpp:320
GLenum query
std::shared_ptr< polling_error_handler > _polling_error_handler
Definition: l500-device.h:94
const char * what() const noexceptoverride
Definition: src/types.h:284
rs2_extrinsics extr
Definition: test-pose.cpp:258
void on_frame(rs2_frame *f) override
Definition: l500-depth.cpp:208
rs2_timestamp_domain get_frame_timestamp_domain(const std::shared_ptr< frame_interface > &frame) const override
Definition: l500-depth.cpp:474
Video stream intrinsics.
Definition: rs_types.h:58
void start(frame_callback_ptr callback) override
Definition: l500-depth.cpp:488
void register_stream_to_extrinsic_group(const stream_interface &stream, uint32_t groupd_index)
Definition: device.cpp:246
void read_fw_table(hw_monitor &hwm, int table_id, T *ptable, table_header *pheader=nullptr, std::function< void() > init=nullptr)
Definition: l500-private.h:109
auto group_multiple_fw_calls(synthetic_sensor &s, T action) -> decltype(action())
Definition: l500-private.h:615
virtual uint32_t get_framerate() const =0
#define offsetof(STRUCTURE, FIELD)
Definition: sqlite3.c:11372
GLuint res
Definition: glext.h:8856
#define INFO(msg)
Definition: catch.hpp:17429
l500_device *const _owner
Definition: l500-depth.h:268
const platform::extension_unit depth_xu
Definition: l500-private.h:43
#define LOG_DEBUG(...)
Definition: src/types.h:239
static const int MAX_NUM_OF_DEPTH_RESOLUTIONS
Definition: l500-private.h:13
double rs2_time_t
Definition: rs_types.h:300
GLboolean * data
stream_profiles _validator_requests
Definition: l500-depth.h:271
void override_extrinsics(rs2_extrinsics const &extr) override
Definition: l500-depth.cpp:298
rs2_dsm_params get_dsm_params() const override
Definition: l500-depth.cpp:303
std::shared_ptr< matcher > create_matcher(const frame_holder &frame) const override
Definition: l500-depth.cpp:181
ivcam2::extended_temperatures get_temperatures() const
Definition: parser.hpp:150
struct rs2_frame rs2_frame
Definition: rs_types.h:261
GLint GLsizei width
void copy(void *dst, void const *src, size_t size)
Definition: types.cpp:836
std::string to_string(T value)
rs2_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.
Definition: rs_frame.h:19


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