d400-device.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include "d400-private.h"
7 
8 #include "algo.h"
9 #include "error-handling.h"
10 #include "core/debug.h"
11 #include "core/advanced_mode.h"
12 #include "device.h"
15 #include "d400-auto-calibration.h"
16 #include "d400-options.h"
17 
18 #include "ds/ds-device-common.h"
19 #include "backend-device.h"
20 
21 namespace librealsense
22 {
23  class hdr_config;
24  class d400_thermal_monitor;
25 
27  : public virtual backend_device
28  , public debug_interface
29  , public global_time_interface
30  , public updatable
31  , public auto_calibrated
32  {
33  public:
34  std::shared_ptr<synthetic_sensor> create_depth_device(std::shared_ptr<context> ctx,
35  const std::vector<platform::uvc_device_info>& all_device_infos);
36 
38  {
39  return dynamic_cast<synthetic_sensor&>(get_sensor(_depth_device_idx));
40  }
41 
42  std::shared_ptr< uvc_sensor > get_raw_depth_sensor()
43  {
45  return std::dynamic_pointer_cast< uvc_sensor >( depth_sensor.get_raw_sensor() );
46  }
47 
48  d400_device( std::shared_ptr< const d400_info > const & );
49 
50  std::vector<uint8_t> send_receive_raw_data(const std::vector<uint8_t>& input) override;
51 
52  std::vector<uint8_t> build_command(uint32_t opcode,
53  uint32_t param1 = 0,
54  uint32_t param2 = 0,
55  uint32_t param3 = 0,
56  uint32_t param4 = 0,
57  uint8_t const * data = nullptr,
58  size_t dataLength = 0) const override;
59 
60  void hardware_reset() override;
61 
63  virtual double get_device_time_ms() override;
64 
65  void enter_update_state() const override;
66  std::vector<uint8_t> backup_flash( rs2_update_progress_callback_sptr callback) override;
67  void update_flash(const std::vector<uint8_t>& image, rs2_update_progress_callback_sptr callback, int update_mode) override;
68  bool check_fw_compatibility(const std::vector<uint8_t>& image) const override;
69 
70  protected:
71  std::shared_ptr<ds_device_common> _ds_device_common;
72 
73  std::vector<uint8_t> get_d400_raw_calibration_table(ds::d400_calibration_table_id table_id) const;
74  std::vector<uint8_t> get_new_calibration_table() const;
75 
76  bool is_camera_in_advanced_mode() const;
77 
78  float get_stereo_baseline_mm() const;
79 
80  ds::ds_caps parse_device_capabilities( const std::vector<uint8_t> &gvd_buf ) const;
81 
82  //TODO - add these to device class as pure virtual methods
85 
86  void register_metadata(const synthetic_sensor& depth_sensor, const firmware_version& hdr_firmware_version) const;
87  void register_metadata_mipi(const synthetic_sensor& depth_sensor, const firmware_version& hdr_firmware_version) const;
88 
89  void init(std::shared_ptr<context> ctx, const platform::backend_device_group& group);
90  void register_features();
91 
92  friend class d400_depth_sensor;
93 
94  std::shared_ptr<hw_monitor> _hw_monitor;
98 
99  std::shared_ptr<stream_interface> _depth_stream;
100  std::shared_ptr<stream_interface> _left_ir_stream;
101  std::shared_ptr<stream_interface> _right_ir_stream;
102  std::shared_ptr<stream_interface> _color_stream;
103 
105 
108 
109  std::shared_ptr<polling_error_handler> _polling_error_handler;
110  std::shared_ptr<d400_thermal_monitor> _thermal_monitor;
111  std::shared_ptr< rsutils::lazy< rs2_extrinsics > > _left_right_extrinsics;
113  std::shared_ptr< rsutils::lazy< rs2_extrinsics > > _color_extrinsic;
114  bool _is_locked = true;
115 
116  std::shared_ptr<auto_gain_limit_option> _gain_limit_value_control;
117  std::shared_ptr<auto_exposure_limit_option> _ae_limit_value_control;
118  };
119 
120  class ds5u_device : public d400_device
121  {
122  public:
123  ds5u_device( std::shared_ptr< const d400_info > const & );
124 
125  std::shared_ptr<synthetic_sensor> create_ds5u_depth_device(std::shared_ptr<context> ctx,
126  const std::vector<platform::uvc_device_info>& all_device_infos);
127 
128  protected:
129  friend class ds5u_depth_sensor;
130  };
131 
132  // Update device name according capability in it.
134 }
realdds::topics::control::hwm::key::param3
const std::string param3
rs2_update_progress_callback_sptr
std::shared_ptr< rs2_update_progress_callback > rs2_update_progress_callback_sptr
Definition: rs_types.hpp:97
librealsense
Definition: algo.h:18
d400-private.h
uint8_t
unsigned char uint8_t
Definition: stdint.h:78
librealsense::d400_device::_ae_limit_value_control
std::shared_ptr< auto_exposure_limit_option > _ae_limit_value_control
Definition: d400-device.h:117
librealsense::d400_device::get_flash_logs_command
command get_flash_logs_command() const
Definition: d400-device.cpp:1235
rsutils::version
Definition: version.h:20
librealsense::d400_device::_depth_stream
std::shared_ptr< stream_interface > _depth_stream
Definition: d400-device.h:99
rs-imu-calibration.input
input
Definition: rs-imu-calibration.py:35
librealsense::d400_device::send_receive_raw_data
std::vector< uint8_t > send_receive_raw_data(const std::vector< uint8_t > &input) override
Definition: d400-device.cpp:87
librealsense::d400_device::get_new_calibration_table
std::vector< uint8_t > get_new_calibration_table() const
Definition: d400-device.cpp:420
librealsense::debug_interface
Definition: src/core/debug.h:10
librealsense::param4
Definition: d400-auto-calibration.cpp:163
librealsense::d400_device::init
void init(std::shared_ptr< context > ctx, const platform::backend_device_group &group)
Definition: d400-device.cpp:522
rsutils::lazy
Definition: lazy.h:16
librealsense::d400_device::_thermal_monitor
std::shared_ptr< d400_thermal_monitor > _thermal_monitor
Definition: d400-device.h:110
librealsense::d400_device::_new_calib_table_raw
rsutils::lazy< std::vector< uint8_t > > _new_calib_table_raw
Definition: d400-device.h:107
librealsense::d400_device::_depth_device_idx
uint8_t _depth_device_idx
Definition: d400-device.h:104
librealsense::update_device_name
void update_device_name(std::string &device_name, const ds::ds_caps cap)
Definition: d400-device.cpp:1176
data
Definition: parser.hpp:153
librealsense::d400_device::get_device_time_ms
virtual double get_device_time_ms() override
Definition: d400-device.cpp:1206
realdds::topics::control::hwm::key::param1
const std::string param1
string
GLsizei const GLchar *const * string
Definition: glad/glad/glad.h:2861
librealsense::d400_device::get_raw_depth_sensor
std::shared_ptr< uvc_sensor > get_raw_depth_sensor()
Definition: d400-device.h:42
librealsense::d400_device::d400_device
d400_device(std::shared_ptr< const d400_info > const &)
Definition: d400-device.cpp:509
realdds::topics::control::hwm::key::param2
const std::string param2
librealsense::d400_device::_color_stream
std::shared_ptr< stream_interface > _color_stream
Definition: d400-device.h:102
librealsense::d400_device::check_fw_compatibility
bool check_fw_compatibility(const std::vector< uint8_t > &image) const override
Definition: d400-device.cpp:125
librealsense::platform::usb_spec
usb_spec
Definition: usb-types.h:112
librealsense::platform::backend_device_group
Definition: backend-device-group.h:50
device.h
librealsense::d400_device::backup_flash
std::vector< uint8_t > backup_flash(rs2_update_progress_callback_sptr callback) override
Definition: d400-device.cpp:115
librealsense::d400_device::is_camera_in_advanced_mode
bool is_camera_in_advanced_mode() const
Definition: d400-device.cpp:402
algo.h
librealsense::ds5u_device::create_ds5u_depth_device
std::shared_ptr< synthetic_sensor > create_ds5u_depth_device(std::shared_ptr< context > ctx, const std::vector< platform::uvc_device_info > &all_device_infos)
Definition: d400-device.cpp:1240
librealsense::d400_device::register_features
void register_features()
Definition: d400-device.cpp:956
librealsense::d400_device::_hw_monitor
std::shared_ptr< hw_monitor > _hw_monitor
Definition: d400-device.h:94
librealsense::d400_device::get_depth_sensor
synthetic_sensor & get_depth_sensor()
Definition: d400-device.h:37
fw-update-device-interface.h
librealsense::d400_device::_polling_error_handler
std::shared_ptr< polling_error_handler > _polling_error_handler
Definition: d400-device.h:109
librealsense::depth_sensor
Definition: depth-sensor.h:9
librealsense::d400_device::_is_locked
bool _is_locked
Definition: d400-device.h:114
uint32_t
unsigned int uint32_t
Definition: stdint.h:80
librealsense::d400_device::_color_calib_table_raw
rsutils::lazy< std::vector< uint8_t > > _color_calib_table_raw
Definition: d400-device.h:112
ds-device-common.h
librealsense::d400_device::_fw_version
firmware_version _fw_version
Definition: d400-device.h:95
librealsense::d400_device::_device_capabilities
ds::ds_caps _device_capabilities
Definition: d400-device.h:97
librealsense::d400_device::get_d400_raw_calibration_table
std::vector< uint8_t > get_d400_raw_calibration_table(ds::d400_calibration_table_id table_id) const
Definition: d400-device.cpp:414
d400-options.h
d400-auto-calibration.h
librealsense::d400_device::enter_update_state
void enter_update_state() const override
Definition: d400-device.cpp:110
librealsense::d400_device::hardware_reset
void hardware_reset() override
Definition: d400-device.cpp:103
librealsense::ds5u_device
Definition: d400-device.h:120
librealsense::d400_device::register_metadata_mipi
void register_metadata_mipi(const synthetic_sensor &depth_sensor, const firmware_version &hdr_firmware_version) const
Definition: d400-device.cpp:1070
librealsense::d400_depth_sensor
Definition: d400-device.cpp:149
librealsense::global_time_interface
Definition: global_timestamp_reader.h:111
global_timestamp_reader.h
librealsense::updatable
Definition: fw-update-device-interface.h:20
librealsense::ds::ds_caps
ds_caps
Definition: ds-private.h:191
librealsense::d400_device::register_metadata
void register_metadata(const synthetic_sensor &depth_sensor, const firmware_version &hdr_firmware_version) const
Definition: d400-device.cpp:980
librealsense::synthetic_sensor
Definition: sensor.h:208
librealsense::d400_device::get_firmware_logs_command
command get_firmware_logs_command() const
Definition: d400-device.cpp:1230
librealsense::d400_device::_color_extrinsic
std::shared_ptr< rsutils::lazy< rs2_extrinsics > > _color_extrinsic
Definition: d400-device.h:113
librealsense::d400_device::build_command
std::vector< uint8_t > build_command(uint32_t opcode, uint32_t param1=0, uint32_t param2=0, uint32_t param3=0, uint32_t param4=0, uint8_t const *data=nullptr, size_t dataLength=0) const override
Definition: d400-device.cpp:92
librealsense::d400_device::_gain_limit_value_control
std::shared_ptr< auto_gain_limit_option > _gain_limit_value_control
Definition: d400-device.h:116
librealsense::d400_device::update_flash
void update_flash(const std::vector< uint8_t > &image, rs2_update_progress_callback_sptr callback, int update_mode) override
Definition: d400-device.cpp:120
librealsense::d400_device::parse_device_capabilities
ds::ds_caps parse_device_capabilities(const std::vector< uint8_t > &gvd_buf) const
Definition: d400-device.cpp:430
librealsense::d400_device::_recommended_fw_version
firmware_version _recommended_fw_version
Definition: d400-device.h:96
debug.h
librealsense::d400_device::create_depth_device
std::shared_ptr< synthetic_sensor > create_depth_device(std::shared_ptr< context > ctx, const std::vector< platform::uvc_device_info > &all_device_infos)
Definition: d400-device.cpp:470
librealsense::d400_device::get_stereo_baseline_mm
float get_stereo_baseline_mm() const
Definition: d400-device.cpp:407
image
GLenum GLenum GLsizei void * image
Definition: glad/glad/glad.h:3587
librealsense::backend_device
Definition: backend-device.h:20
test-projection-from-recording.ctx
ctx
Definition: test-projection-from-recording.py:16
librealsense::d400_device::_coefficients_table_raw
rsutils::lazy< std::vector< uint8_t > > _coefficients_table_raw
Definition: d400-device.h:106
error-handling.h
librealsense::ds5u_device::ds5u_device
ds5u_device(std::shared_ptr< const d400_info > const &)
Definition: d400-device.cpp:1269
librealsense::auto_calibrated
Definition: d400-auto-calibration.h:29
librealsense::ds::d400_calibration_table_id
d400_calibration_table_id
Definition: d400-private.h:181
librealsense::d400_device::_left_ir_stream
std::shared_ptr< stream_interface > _left_ir_stream
Definition: d400-device.h:100
test-emitter-frequency.device_name
device_name
Definition: test-emitter-frequency.py:26
librealsense::d400_device::_left_right_extrinsics
std::shared_ptr< rsutils::lazy< rs2_extrinsics > > _left_right_extrinsics
Definition: d400-device.h:111
librealsense::d400_device::_ds_device_common
std::shared_ptr< ds_device_common > _ds_device_common
Definition: d400-device.h:71
librealsense::d400_device::_right_ir_stream
std::shared_ptr< stream_interface > _right_ir_stream
Definition: d400-device.h:101
librealsense::ds5u_depth_sensor
Definition: d400-device.cpp:344
librealsense::d400_device::get_usb_spec
platform::usb_spec get_usb_spec() const
Definition: d400-device.cpp:1194
librealsense::command
Definition: hw-monitor.h:247
advanced_mode.h
librealsense::device::get_sensor
sensor_interface & get_sensor(size_t subdevice) override
Definition: device.cpp:101
backend-device.h
realdds::topics::control::hwm::key::opcode
const std::string opcode
librealsense::d400_device
Definition: d400-device.h:26


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:02