ds5/advanced_mode/advanced_mode.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2017 Intel Corporation. All Rights Reserved.
3 
4 #include "core/advanced_mode.h"
5 #include "ds5/ds5-active.h"
7 #include "json_loader.hpp"
8 #include "ds5/ds5-color.h"
9 
10 namespace librealsense
11 {
12  ds5_advanced_mode_base::ds5_advanced_mode_base(std::shared_ptr<hw_monitor> hwm,
14  : _hw_monitor(hwm),
15  _depth_sensor(depth_sensor),
16  _color_sensor(nullptr)
17  {
18  _enabled = [this]() {
21  return results[4] > 0;
22  };
23 
24  // "Remove IR Pattern" visual preset is available only for D400, D410, D415, D460, D465
25  _preset_opt = std::make_shared<advanced_mode_preset_option>(*this,
27  option_range{ 0,
28  depth_sensor.get_preset_max_value(),
29  1,
31  _depth_sensor.register_option(RS2_OPTION_VISUAL_PRESET, _preset_opt);
32  _color_sensor = [this]() {
33  auto& dev = _depth_sensor.get_device();
34  for (size_t i = 0; i < dev.get_sensors_count(); ++i)
35  {
36  if (auto s = dynamic_cast<const ds5_color_sensor*>(&(dev.get_sensor(i))))
37  {
38  return const_cast<ds5_color_sensor*>(s);
39  }
40  }
41  return (ds5_color_sensor*)nullptr;
42  };
43  _amplitude_factor_support = [this]() {
44  auto fw_ver = firmware_version(_depth_sensor.get_device().get_info(rs2_camera_info::RS2_CAMERA_INFO_FIRMWARE_VERSION));
45  return (fw_ver >= firmware_version("5.11.9.0"));
46  };
47  _rgb_exposure_gain_bind = [this]() {
48  auto fw_ver = firmware_version(_depth_sensor.get_device().get_info(rs2_camera_info::RS2_CAMERA_INFO_FIRMWARE_VERSION));
49  return (fw_ver >= firmware_version("5.11.9.0"));
50  };
51  }
52 
54  {
55  return *_enabled;
56  }
57 
59  {
62  }
63 
64  void ds5_advanced_mode_base::apply_preset(const std::vector<platform::stream_profile>& configuration,
67  {
68  auto p = get_all();
69  res_type res;
70  // configuration is empty before first streaming - so set default res
71  if (configuration.empty())
72  res = low_resolution;
73  else
74  res = get_res_type(configuration.front().width, configuration.front().height);
75 
76  switch (preset)
77  {
79  switch (device_pid)
80  {
81  case ds::RS410_PID:
82  case ds::RS415_PID:
83  default_410(p);
84  break;
85  case ds::RS430_PID:
86  case ds::RS430I_PID:
87  case ds::RS435_RGB_PID:
88  case ds::RS465_PID:
89  case ds::RS435I_PID:
90  default_430(p);
91  break;
92  case ds::RS455_PID:
93  case ds::RS457_PID:
95  switch (res)
96  {
97  case low_resolution:
98  case medium_resolution:
99  //applied defaultly
100  break;
101  case high_resolution:
103  break;
104  default:
105  throw invalid_value_exception(to_string() << "apply_preset(...) failed! Given device doesn't support Default Preset (pid=0x" <<
106  std::hex << device_pid << ")");
107  break;
108  }
109  case ds::RS405U_PID:
110  default_405u(p);
111  break;
112  case ds::RS405_PID:
113  default_405(p);
114  break;
115  case ds::RS400_PID:
116  default_400(p);
117  break;
118  case ds::RS420_PID:
119  default_420(p);
120  break;
121  default:
122  throw invalid_value_exception(to_string() << "apply_preset(...) failed! Given device doesn't support Default Preset (pid=0x" <<
123  std::hex << device_pid << ")");
124  break;
125  }
126  break;
128  hand_gesture(p);
129  // depth units for D405
130  if (device_pid == ds::RS405_PID)
131  p.depth_table.depthUnits = 100; // 0.1mm
132  break;
134  high_accuracy(p);
135  break;
137  high_density(p);
138  break;
140  mid_density(p);
141  break;
143  {
144  static const firmware_version remove_ir_pattern_fw_ver{ "5.9.10.0" };
145  if (fw_version < remove_ir_pattern_fw_ver)
146  throw invalid_value_exception(to_string() << "apply_preset(...) failed! FW version doesn't support Remove IR Pattern Preset (curr_fw_ver=" <<
147  fw_version << " ; required_fw_ver=" << remove_ir_pattern_fw_ver << ")");
148 
149  switch (device_pid)
150  {
151  case ds::RS400_PID:
152  case ds::RS410_PID:
153  case ds::RS415_PID:
154  case ds::RS465_PID://TODO: verify
155  d415_remove_ir(p);
156  break;
157  case ds::RS460_PID:
158  d460_remove_ir(p);
159  break;
160  default:
161  throw invalid_value_exception(to_string() << "apply_preset(...) failed! Given device doesn't support Remove IR Pattern Preset (pid=0x" <<
162  std::hex << device_pid << ")");
163  break;
164  }
165  }
166  break;
167  default:
168  throw invalid_value_exception(to_string() << "apply_preset(...) failed! Invalid preset! (" << preset << ")");
169  }
170  set_all(p);
171  }
172 
174  {
175  *ptr = get<STDepthControlGroup>(advanced_mode_traits<STDepthControlGroup>::group, nullptr, mode);
176  }
177 
179  {
180  *ptr = get<STRsm>(advanced_mode_traits<STRsm>::group, nullptr, mode);
181  }
182 
184  {
185  *ptr = get<STRauSupportVectorControl>(advanced_mode_traits<STRauSupportVectorControl>::group, nullptr, mode);
186  }
187 
189  {
190  *ptr = get<STColorControl>(advanced_mode_traits<STColorControl>::group, nullptr, mode);
191  }
192 
194  {
195  *ptr = get<STRauColorThresholdsControl>(advanced_mode_traits<STRauColorThresholdsControl>::group, nullptr, mode);
196  }
197 
199  {
200  *ptr = get<STSloColorThresholdsControl>(advanced_mode_traits<STSloColorThresholdsControl>::group, nullptr, mode);
201  }
202 
204  {
205  *ptr = get<STSloPenaltyControl>(advanced_mode_traits<STSloPenaltyControl>::group, nullptr, mode);
206  }
207 
209  {
210  *ptr = get<STHdad>(advanced_mode_traits<STHdad>::group, nullptr, mode);
211  }
212 
214  {
215  *ptr = get<STColorCorrection>(advanced_mode_traits<STColorCorrection>::group, nullptr, mode);
216  }
217 
219  {
220  *ptr = get<STDepthTableControl>(advanced_mode_traits<STDepthTableControl>::group, nullptr, mode);
221  }
222 
224  {
225  *ptr = get<STAEControl>(advanced_mode_traits<STAEControl>::group, nullptr, mode);
226  }
227 
229  {
230  *ptr = get<STCensusRadius>(advanced_mode_traits<STCensusRadius>::group, nullptr, mode);
231  }
232 
234  {
235  *ptr = *_amplitude_factor_support ? get<STAFactor>(advanced_mode_traits<STAFactor>::group, nullptr, mode) :
236  []() { STAFactor af; af.amplitude = 0.f; return af; }();
237  }
238 
240  {
241  return sensor.supports_option(opt);
242  }
243 
245  {
247  {
249  ptr->was_set = true;
250  }
251  }
252 
254  {
256  {
258  ptr->was_set = true;
259  }
260  }
261 
263  {
265  {
266  ptr->exposure = sensor.get_option(RS2_OPTION_EXPOSURE).query();
267  ptr->was_set = true;
268  }
269  }
270 
272  {
274  {
275  ptr->auto_exposure = static_cast<int>(sensor.get_option(RS2_OPTION_ENABLE_AUTO_EXPOSURE).query());
276  ptr->was_set = true;
277  }
278  }
279 
281  {
283  }
284 
286  {
288  }
289 
291  {
293  {
295  ptr->was_set = true;
296  }
297  }
298 
300  {
302  {
304  ptr->was_set = true;
305  }
306  }
307 
309  {
310  if (*_color_sensor)
311  {
312  get_exposure(**_color_sensor, ptr);
313  }
314  }
315 
317  {
318  if (*_color_sensor)
319  {
321  }
322  }
323 
325  {
327  {
328  ptr->backlight_compensation = static_cast<int>((*_color_sensor)->get_option(RS2_OPTION_BACKLIGHT_COMPENSATION).query());
329  ptr->was_set = true;
330  }
331  }
332 
334  {
336  {
337  ptr->brightness = (*_color_sensor)->get_option(RS2_OPTION_BRIGHTNESS).query();
338  ptr->was_set = true;
339  }
340  }
341 
343  {
345  {
346  ptr->contrast = (*_color_sensor)->get_option(RS2_OPTION_CONTRAST).query();
347  ptr->was_set = true;
348  }
349  }
350 
352  {
354  {
355  ptr->gain = (*_color_sensor)->get_option(RS2_OPTION_GAIN).query();
356  ptr->was_set = true;
357  }
358  }
359 
361  {
363  {
364  ptr->gamma = (*_color_sensor)->get_option(RS2_OPTION_GAMMA).query();
365  ptr->was_set = true;
366  }
367  }
368 
370  {
372  {
373  ptr->hue = (*_color_sensor)->get_option(RS2_OPTION_HUE).query();
374  ptr->was_set = true;
375  }
376  }
377 
379  {
381  {
382  ptr->saturation = (*_color_sensor)->get_option(RS2_OPTION_SATURATION).query();
383  ptr->was_set = true;
384  }
385  }
386 
388  {
390  {
391  ptr->sharpness = (*_color_sensor)->get_option(RS2_OPTION_SHARPNESS).query();
392  ptr->was_set = true;
393  }
394  }
395 
397  {
399  {
400  ptr->white_balance = (*_color_sensor)->get_option(RS2_OPTION_WHITE_BALANCE).query();
401  ptr->was_set = true;
402  }
403  }
404 
406  {
408  {
409  ptr->auto_white_balance = static_cast<int>((*_color_sensor)->get_option(RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE).query());
410  ptr->was_set = true;
411  }
412  }
413 
415  {
417  {
418  ptr->power_line_frequency = static_cast<int>((*_color_sensor)->get_option(RS2_OPTION_POWER_LINE_FREQUENCY).query());
419  ptr->was_set = true;
420  }
421  }
422 
424  {
427  }
428 
430  {
433  }
434 
436  {
439  }
440 
442  {
445  }
446 
448  {
451  }
452 
454  {
457  }
458 
460  {
463  }
464 
466  {
469  }
470 
472  {
475  }
476 
478  {
481  }
482 
484  {
487  }
488 
490  {
493  }
494 
496  {
498  {
501  }
502  }
503 
505  {
506  if (val.was_set)
508  }
509 
511  {
512  if (val.was_set)
514  }
515 
517  {
519  }
520 
522  {
524  }
525 
527  {
528  if (val.was_set)
530  }
531 
533  {
534  if (val.was_set)
536  }
537 
539  {
540  if (val.was_set)
542  }
543 
545  {
546  if (val.was_set)
548  }
549 
551  {
552  if (val.was_set && !*_color_sensor)
553  throw invalid_value_exception("Can't set color_exposure value! Color sensor not found.");
554 
555  if (val.was_set)
556  set_exposure(**_color_sensor, val);
557  }
558 
560  {
561  if (val.was_set && !*_color_sensor)
562  throw invalid_value_exception("Can't set color_auto_exposure value! Color sensor not found.");
563 
564  if (val.was_set)
566  }
567 
569  {
570  if (val.was_set && !*_color_sensor)
571  throw invalid_value_exception("Can't set color_backlight_compensation value! Color sensor not found.");
572 
573  if (val.was_set)
574  (*_color_sensor)->get_option(RS2_OPTION_BACKLIGHT_COMPENSATION).set((float)val.backlight_compensation);
575  }
576 
578  {
579  if (val.was_set && !*_color_sensor)
580  throw invalid_value_exception("Can't set color_brightness value! Color sensor not found.");
581 
582  if (val.was_set)
583  (*_color_sensor)->get_option(RS2_OPTION_BRIGHTNESS).set(val.brightness);
584  }
585 
587  {
588  if (val.was_set && !*_color_sensor)
589  throw invalid_value_exception("Can't set color_contrast value! Color sensor not found.");
590 
591  if (val.was_set)
592  (*_color_sensor)->get_option(RS2_OPTION_CONTRAST).set(val.contrast);
593  }
594 
596  {
597  if (val.was_set && !*_color_sensor)
598  throw invalid_value_exception("Can't set color_gain value! Color sensor not found.");
599 
600  if (val.was_set)
601  (*_color_sensor)->get_option(RS2_OPTION_GAIN).set(val.gain);
602  }
603 
605  {
606  if (val.was_set && !*_color_sensor)
607  throw invalid_value_exception("Can't set color_gamma value! Color sensor not found.");
608 
609  if (val.was_set)
610  (*_color_sensor)->get_option(RS2_OPTION_GAMMA).set(val.gamma);
611  }
612 
614  {
615  if (val.was_set && !*_color_sensor)
616  throw invalid_value_exception("Can't set color_hue value! Color sensor not found.");
617 
618  if (val.was_set)
619  (*_color_sensor)->get_option(RS2_OPTION_HUE).set(val.hue);
620  }
621 
623  {
624  if (val.was_set && !*_color_sensor)
625  throw invalid_value_exception("Can't set color_saturation value! Color sensor not found.");
626 
627  if (val.was_set)
628  (*_color_sensor)->get_option(RS2_OPTION_SATURATION).set(val.saturation);
629  }
630 
632  {
633  if (val.was_set && !*_color_sensor)
634  throw invalid_value_exception("Can't set color_sharpness value! Color sensor not found.");
635 
636  if (val.was_set)
637  (*_color_sensor)->get_option(RS2_OPTION_SHARPNESS).set(val.sharpness);
638  }
639 
641  {
642  if (val.was_set && !*_color_sensor)
643  throw invalid_value_exception("Can't set color_white_balance value! Color sensor not found.");
644 
645  if (val.was_set)
646  (*_color_sensor)->get_option(RS2_OPTION_WHITE_BALANCE).set(val.white_balance);
647  }
648 
650  {
651  if (val.was_set && !*_color_sensor)
652  throw invalid_value_exception("Can't set color_auto_white_balance value! Color sensor not found.");
653 
654  if (val.was_set)
655  (*_color_sensor)->get_option(RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE).set((float)val.auto_white_balance);
656  }
657 
659  {
660  if (val.was_set && !*_color_sensor)
661  throw invalid_value_exception("Can't set color_power_line_frequency value! Color sensor not found.");
662 
663  if (val.was_set)
664  (*_color_sensor)->get_option(RS2_OPTION_POWER_LINE_FREQUENCY).set((float)val.power_line_frequency);
665  }
666 
667  std::vector<uint8_t> ds5_advanced_mode_base::serialize_json() const
668  {
669  if (!is_enabled())
670  throw wrong_api_call_sequence_exception(to_string() << "serialize_json() failed! Device is not in Advanced-Mode.");
671 
672  auto p = get_all();
674  }
675 
676  void ds5_advanced_mode_base::load_json(const std::string& json_content)
677  {
678  if (!is_enabled())
679  throw wrong_api_call_sequence_exception(to_string() << "load_json(...) failed! Device is not in Advanced-Mode.");
680 
681  auto p = get_all();
682  update_structs(_depth_sensor.get_device(), json_content, p);
683  set_all(p);
685  }
686 
688  {
689  preset p;
691  get_rsm(&p.rsm);
697  get_hdad(&p.hdad);
700  get_ae_control(&p.ae);
722  return p;
723  }
724 
726  {
735 
736  // Setting auto-white-balance control before colorCorrection parameters
739 
745 
747  if (p.laser_state.was_set && p.laser_state.laser_state == 1) // 1 - on
749 
752  {
755  }
756 
759  {
762  }
763 
771 
775 
776  // TODO: W/O due to a FW bug of power_line_frequency control on Windows OS
777  //set_color_power_line_frequency(p.color_power_line_frequency);
778  }
779 
780  std::vector<uint8_t> ds5_advanced_mode_base::send_receive(const std::vector<uint8_t>& input) const
781  {
782  auto res = _hw_monitor->send(input);
783  if (res.empty())
784  {
785  throw std::runtime_error("Advanced mode write failed!");
786  }
787  return res;
788  }
789 
791  {
792  return (c0 << 24) | (c1 << 16) | (c2 << 8) | c3;
793  }
794 
795  std::vector<uint8_t> ds5_advanced_mode_base::assert_no_error(ds::fw_cmd opcode, const std::vector<uint8_t>& results)
796  {
797  if (results.size() < sizeof(uint32_t)) throw std::runtime_error("Incomplete operation result!");
798  auto opCodeAsUint32 = pack(results[3], results[2], results[1], results[0]);
799  if (opCodeAsUint32 != static_cast<uint32_t>(opcode))
800  {
801  std::stringstream ss;
802  ss << "Operation failed with error code=" << static_cast<int>(opCodeAsUint32);
803  throw std::runtime_error(ss.str());
804  }
805  std::vector<uint8_t> result;
806  result.resize(results.size() - sizeof(uint32_t));
807  std::copy(results.data() + sizeof(uint32_t),
808  results.data() + results.size(), result.data());
809  return result;
810  }
811 
813  uint32_t p1,
814  uint32_t p2,
815  uint32_t p3,
816  uint32_t p4,
817  std::vector<uint8_t> data) const
818  {
819  std::vector<uint8_t> raw_data;
820  auto cmd_op_code = static_cast<uint32_t>(opcode);
821 
822  const uint16_t pre_header_data = 0xcdab;
823  raw_data.resize(HW_MONITOR_BUFFER_SIZE);
824  auto write_ptr = raw_data.data();
825  auto header_size = 4;
826 
827  size_t cur_index = 2;
828  *reinterpret_cast<uint16_t *>(write_ptr + cur_index) = pre_header_data;
829  cur_index += sizeof(uint16_t);
830  *reinterpret_cast<unsigned int *>(write_ptr + cur_index) = cmd_op_code;
831  cur_index += sizeof(unsigned int);
832 
833  // Parameters
834  *reinterpret_cast<unsigned*>(write_ptr + cur_index) = p1;
835  cur_index += sizeof(unsigned);
836  *reinterpret_cast<unsigned*>(write_ptr + cur_index) = p2;
837  cur_index += sizeof(unsigned);
838  *reinterpret_cast<unsigned*>(write_ptr + cur_index) = p3;
839  cur_index += sizeof(unsigned);
840  *reinterpret_cast<unsigned*>(write_ptr + cur_index) = p4;
841  cur_index += sizeof(unsigned);
842 
843  // Data
844  std::copy(data.begin(), data.end(), reinterpret_cast<uint8_t*>(write_ptr + cur_index));
845  cur_index += data.size();
846 
847  *reinterpret_cast<uint16_t*>(raw_data.data()) = static_cast<uint16_t>(cur_index - header_size);// Length doesn't include hdr.
848  raw_data.resize(cur_index);
849  return raw_data;
850  }
851 
853  synthetic_sensor& ep, const option_range& opt_range)
854  : option_base(opt_range),
855  _ep(ep),
856  _advanced(advanced),
857  _last_preset(RS2_RS400_VISUAL_PRESET_CUSTOM)
858  {
859  _ep.register_on_open([this](std::vector<platform::stream_profile> configurations) {
860  std::lock_guard<std::mutex> lock(_mtx);
861  auto uvc_sen = As<uvc_sensor, sensor_base>(_ep.get_raw_sensor());
863  _advanced.apply_preset(configurations, _last_preset, get_device_pid(*uvc_sen), get_firmware_version(*uvc_sen));
864  });
865  }
866 
868  {
869  return (static_cast<rs2_rs400_visual_preset>((int)x));
870  }
871 
873  {
874  std::lock_guard<std::mutex> lock(_mtx);
875  if (!is_valid(value))
876  throw invalid_value_exception(to_string() << "set(advanced_mode_preset_option) failed! Given value " << value << " is out of range.");
877 
878  if (!_advanced.is_enabled())
879  throw wrong_api_call_sequence_exception(to_string() << "set(advanced_mode_preset_option) failed! Device is not in Advanced-Mode.");
880 
881  auto preset = to_preset(value);
883  {
885  return;
886  }
887 
888  auto uvc_sen = As<uvc_sensor, sensor_base>(_ep.get_raw_sensor());
889  auto configurations = uvc_sen->get_configuration();
890  _advanced.apply_preset(configurations, preset, get_device_pid(*uvc_sen), get_firmware_version(*uvc_sen));
892  _recording_function(*this);
893  }
894 
896  {
897  return static_cast<float>(_last_preset);
898  }
899 
901  {
902  return true;
903  }
904 
906  {
907  return "Advanced-Mode Preset";
908  }
909 
911  {
912  try {
914  }
915  catch (std::out_of_range)
916  {
917  throw invalid_value_exception(to_string() << "advanced_mode_preset: get_value_description(...) failed! Description of value " << val << " is not found.");
918  }
919  }
920 
922  {
923  auto str_pid = sensor.get_info(RS2_CAMERA_INFO_PRODUCT_ID);
924  uint16_t device_pid{};
925  std::stringstream ss;
926  ss << std::hex << str_pid;
927  ss >> device_pid;
928  return device_pid;
929  }
930 
932  {
934  }
935 }
void get_depth_table_control(STDepthTableControl *ptr, int mode=0) const override
void high_accuracy(preset &p)
Definition: presets.cpp:539
void set_color_saturation(const saturation_control &val)
void get_depth_exposure(exposure_control *ptr) const
static const textual_icon lock
Definition: model-views.h:219
void default_400(preset &p)
Definition: presets.cpp:8
void set_depth_table_control(const STDepthTableControl &val) override
void d460_remove_ir(preset &p)
Definition: presets.cpp:747
void default_430(preset &p)
Definition: presets.cpp:364
void set_color_correction(const STColorCorrection &val) override
const uint16_t RS457_PID
Definition: ds5-private.h:25
void get_auto_exposure(synthetic_sensor &sensor, auto_exposure_control *ptr) const
void set_laser_state(const laser_state_control &val)
static const uint16_t HW_MONITOR_BUFFER_SIZE
void default_405u(preset &p)
Definition: presets.cpp:75
GLuint GLfloat * val
void get_depth_auto_white_balance(auto_white_balance_control *ptr) const
ds5_advanced_mode_base(std::shared_ptr< hw_monitor > hwm, synthetic_sensor &depth_sensor)
std::vector< uint8_t > serialize_json() const override
void get_color_power_line_frequency(power_line_frequency_control *ptr) const
exposure_control color_exposure
Definition: presets.h:119
static std::vector< uint8_t > assert_no_error(ds::fw_cmd opcode, const std::vector< uint8_t > &results)
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
Definition: rs_option.h:22
STColorControl color_control
Definition: presets.h:103
GLdouble s
void get_slo_penalty_control(STSloPenaltyControl *ptr, int mode=0) const override
virtual void set(float value)=0
laser_power_control laser_power
Definition: presets.h:114
const char * get_value_description(float val) const override
void load_json(const std::string &json_content) override
firmware_version get_firmware_version(const uvc_sensor &sensor) const
virtual float get_preset_max_value() const
Definition: sensor.cpp:1737
STSloColorThresholdsControl sctc
Definition: presets.h:105
const uint16_t RS415_PID
Definition: ds5-private.h:28
void default_450_mid_low_res(preset &p)
Definition: presets.cpp:454
void get_depth_control_group(STDepthControlGroup *ptr, int mode=0) const override
auto_white_balance_control depth_auto_white_balance
Definition: presets.h:118
auto_exposure_control color_auto_exposure
Definition: presets.h:120
GLfloat value
std::shared_ptr< hw_monitor > _hw_monitor
STDepthControlGroup depth_controls
Definition: presets.h:100
const uint16_t RS460_PID
Definition: ds5-private.h:40
STCensusRadius census
Definition: presets.h:111
lazy< ds5_color_sensor * > _color_sensor
void get_laser_state(laser_state_control *ptr) const
const uint16_t RS435_RGB_PID
Definition: ds5-private.h:41
bool supports_option(rs2_option id) const override
Definition: options.h:51
STAEControl ae
Definition: presets.h:110
unsigned short uint16_t
Definition: stdint.h:79
std::vector< uint8_t > generate_json(const device_interface &dev, const preset &in_preset)
void get_color_brightness(brightness_control *ptr) const
void set_amp_factor(const STAFactor &val) override
void get_color_backlight_compensation(backlight_compensation_control *ptr) const
void set_census_radius(const STCensusRadius &val) override
unsigned char uint8_t
Definition: stdint.h:78
std::shared_ptr< advanced_mode_preset_option > _preset_opt
option & get_option(rs2_option id) override
Definition: options.h:58
virtual float query() const =0
void update_structs(const device_interface &dev, const std::string &content, preset &in_preset)
gain_control color_gain
Definition: presets.h:124
gain_control depth_gain
Definition: presets.h:117
std::vector< uint8_t > send_receive(const std::vector< uint8_t > &input) const
void set_laser_power(const laser_power_control &val)
void set_auto_exposure(synthetic_sensor &sensor, const auto_exposure_control &val)
void set_color_control(const STColorControl &val) override
void hand_gesture(preset &p)
Definition: presets.cpp:683
void get_ae_control(STAEControl *ptr, int mode=0) const override
static rs2_rs400_visual_preset to_preset(float x)
const uint16_t RS405U_PID
Definition: ds5-private.h:42
void set_depth_exposure(const exposure_control &val)
GLenum mode
laser_state_control laser_state
Definition: presets.h:113
void set_slo_penalty_control(const STSloPenaltyControl &val) override
const uint16_t RS455_PID
Definition: ds5-private.h:49
void d415_remove_ir(preset &p)
Definition: presets.cpp:731
uint16_t get_device_pid(const uvc_sensor &sensor) const
sharpness_control color_sharpness
Definition: presets.h:128
brightness_control color_brightness
Definition: presets.h:122
const uint16_t RS410_PID
Definition: ds5-private.h:27
double p[GRIDW][GRIDH]
Definition: wave.c:109
auto_exposure_control depth_auto_exposure
Definition: presets.h:116
white_balance_control color_white_balance
Definition: presets.h:129
GLdouble x
STSloPenaltyControl spc
Definition: presets.h:106
unsigned int uint32_t
Definition: stdint.h:80
void get_exposure(synthetic_sensor &sensor, exposure_control *ptr) const
STAFactor amplitude_factor
Definition: presets.h:112
void set_color_brightness(const brightness_control &val)
const std::string & get_info(rs2_camera_info info) const override
Definition: sensor.cpp:71
void set_exposure(synthetic_sensor &sensor, const exposure_control &val)
bool supports_option(const synthetic_sensor &sensor, rs2_option opt) const
STRauSupportVectorControl rsvc
Definition: presets.h:102
void set_depth_auto_exposure(const auto_exposure_control &val)
const uint16_t RS420_PID
Definition: ds5-private.h:35
hue_control color_hue
Definition: presets.h:126
void get_amp_factor(STAFactor *ptr, int mode=0) const override
gamma_control color_gamma
Definition: presets.h:125
void high_density(preset &p)
Definition: presets.cpp:587
void default_410(preset &p)
Definition: presets.cpp:215
void set_rau_support_vector_control(const STRauSupportVectorControl &val) override
std::vector< uint8_t > encode_command(ds::fw_cmd opcode, uint32_t p1=0, uint32_t p2=0, uint32_t p3=0, uint32_t p4=0, std::vector< uint8_t > data=std::vector< uint8_t >()) const
std::vector< std::pair< stream_profile, frame_callback > > configurations
Definition: recorder.h:486
void get_color_sharpness(sharpness_control *ptr) const
auto_white_balance_control color_auto_white_balance
Definition: presets.h:130
void set_ae_control(const STAEControl &val) override
void get_rau_support_vector_control(STRauSupportVectorControl *ptr, int mode=0) const override
std::function< void(const option &)> _recording_function
Definition: option.h:100
void get_color_correction(STColorCorrection *ptr, int mode=0) const override
advanced_mode_preset_option(ds5_advanced_mode_base &advanced, synthetic_sensor &ep, const option_range &opt_range)
const uint16_t RS430_PID
Definition: ds5-private.h:29
device_interface & get_device() override
Definition: sensor.cpp:257
void set_color_white_balance(const white_balance_control &val)
static uint32_t pack(uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3)
void set_depth_control_group(const STDepthControlGroup &val) override
const uint16_t RS435I_PID
Definition: ds5-private.h:43
void get_census_radius(STCensusRadius *ptr, int mode=0) const override
STDepthTableControl depth_table
Definition: presets.h:109
void mid_density(preset &p)
Definition: presets.cpp:635
void get_depth_auto_exposure(auto_exposure_control *ptr) const
void get_color_exposure(exposure_control *ptr) const
contrast_control color_contrast
Definition: presets.h:123
void get_laser_power(laser_power_control *ptr) const
std::shared_ptr< sensor_base > get_raw_sensor() const
Definition: sensor.h:232
void register_on_open(on_open callback)
Definition: sensor.h:68
rs2_rs400_visual_preset
For RS400 devices: provides optimized settings (presets) for specific types of usage.
Definition: rs_option.h:144
void get_hdad(STHdad *ptr, int mode=0) const override
bool is_valid(float value) const
Definition: option.cpp:6
void set_color_power_line_frequency(const power_line_frequency_control &val)
void default_420(preset &p)
Definition: presets.cpp:297
exposure_control depth_exposure
Definition: presets.h:115
saturation_control color_saturation
Definition: presets.h:127
void set_color_exposure(const exposure_control &val)
STColorCorrection cc
Definition: presets.h:108
void get_color_auto_exposure(auto_exposure_control *ptr) const
void set_color_contrast(const contrast_control &val)
backlight_compensation_control color_backlight_compensation
Definition: presets.h:121
int i
void get_color_white_balance(white_balance_control *ptr) const
void get_color_saturation(saturation_control *ptr) const
void set_depth_auto_white_balance(const auto_white_balance_control &val)
void set_color_auto_exposure(const auto_exposure_control &val)
void get_rsm(STRsm *ptr, int mode=0) const override
const char * rs2_rs400_visual_preset_to_string(rs2_rs400_visual_preset preset)
void default_405(preset &p)
Definition: presets.cpp:144
void get_slo_color_thresholds_control(STSloColorThresholdsControl *ptr, int mode=0) const override
power_line_frequency_control color_power_line_frequency
Definition: presets.h:131
const uint16_t RS465_PID
Definition: ds5-private.h:46
void set_rau_color_thresholds_control(const STRauColorThresholdsControl &val) override
const uint16_t RS400_PID
Definition: ds5-private.h:26
void get_color_contrast(contrast_control *ptr) const
void default_450_high_res(preset &p)
Definition: presets.cpp:448
void set_color_auto_white_balance(const auto_white_balance_control &val)
res_type
Definition: src/types.h:1533
const uint16_t RS430I_PID
Definition: ds5-private.h:45
void get_color_auto_white_balance(auto_white_balance_control *ptr) const
void get_color_control(STColorControl *ptr, int mode=0) const override
void set_slo_color_thresholds_control(const STSloColorThresholdsControl &val) override
void set_color_sharpness(const sharpness_control &val)
STRauColorThresholdsControl rctc
Definition: presets.h:104
Definition: parser.hpp:153
void set_color_backlight_compensation(const backlight_compensation_control &val)
void copy(void *dst, void const *src, size_t size)
Definition: types.cpp:255
const uint16_t RS405_PID
Definition: ds5-private.h:48
res_type get_res_type(uint32_t width, uint32_t height)
Definition: src/types.h:1539
void apply_preset(const std::vector< platform::stream_profile > &configuration, rs2_rs400_visual_preset preset, uint16_t device_pid, const firmware_version &fw_version) override
std::string to_string(T value)
void get_rau_color_thresholds_control(STRauColorThresholdsControl *ptr, int mode=0) const override


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Thu Dec 22 2022 03:41:41