28 static const int pins = 3;
29 mutable std::vector<int64_t> counter;
30 std::shared_ptr<platform::time_service> _ts;
31 mutable std::recursive_mutex _mtx;
34 : counter(pins), _ts(ts)
41 std::lock_guard<std::recursive_mutex> lock(_mtx);
42 for (
auto i = 0; i < pins; ++i)
50 std::lock_guard<std::recursive_mutex> lock(_mtx);
51 return _ts->get_time();
56 std::lock_guard<std::recursive_mutex> lock(_mtx);
60 else if (mode.
pf->
fourcc == 0x43202020)
63 return ++counter[pin_index];
75 std::shared_ptr<device_interface> create(std::shared_ptr<context> ctx,
76 bool register_device_notifications)
const override;
79 std::vector<platform::uvc_device_info> depth,
82 _depth(
std::move(depth)),
86 static std::vector<std::shared_ptr<device_info>> pick_l500_devices(
87 std::shared_ptr<context> ctx,
88 std::vector<platform::uvc_device_info>& platform,
89 std::vector<platform::usb_device_info>& usb);
97 std::vector<platform::uvc_device_info> _depth;
108 std::unique_ptr<frame_timestamp_reader> timestamp_reader)
109 :
uvc_sensor(
"L500 Depth Sensor", uvc_device, move(timestamp_reader), owner), _owner(owner)
123 for (
auto p : results)
128 assign_stream(_owner->_depth_stream, p);
132 assign_stream(_owner->_ir_stream, p);
136 assign_stream(_owner->_confidence_stream, p);
141 if (video->get_width() == 640 && video->get_height() == 480 && video->get_format() ==
RS2_FORMAT_Z16 && video->get_framerate() == 30)
144 if (video->get_width() == 640 && video->get_height() == 480 && video->get_format() ==
RS2_FORMAT_Y8 && video->get_framerate() == 30)
145 video->make_default();
147 if (video->get_width() == 640 && video->get_height() == 480 && video->get_format() ==
RS2_FORMAT_RAW8 && video->get_framerate() == 30)
148 video->make_default();
151 std::weak_ptr<l500_depth_sensor> wp =
154 video->set_intrinsics([profile, wp]()
158 return sp->get_intrinsics(profile);
171 snapshot = std::make_shared<depth_sensor_snapshot>(get_depth_scale());
176 recording_function(*
this);
184 const std::vector<platform::uvc_device_info>& all_device_infos)
186 using namespace ivcam2;
187 auto&& backend = ctx->get_backend();
189 std::vector<std::shared_ptr<platform::uvc_device>> depth_devices;
191 depth_devices.push_back(backend.create_uvc_device(info));
193 auto depth_ep = std::make_shared<l500_depth_sensor>(
this, std::make_shared<platform::multi_pins_uvc_device>(depth_devices),
206 return _hw_monitor->send(input);
211 force_hardware_reset();
219 bool register_device_notifications);
221 void create_snapshot(std::shared_ptr<debug_interface>& snapshot)
const override;
222 void enable_recording(std::function<
void(
const debug_interface&)> record_action)
override;
225 virtual std::shared_ptr<matcher> create_matcher(
const frame_holder&
frame)
const override;
227 const uint8_t _depth_device_idx;
228 std::shared_ptr<hw_monitor> _hw_monitor;
229 std::shared_ptr<stream_interface> _depth_stream;
230 std::shared_ptr<stream_interface> _ir_stream;
231 std::shared_ptr<stream_interface> _confidence_stream;
233 void force_hardware_reset()
const;
const native_pixel_format pf_z16_l500
rs2_intrinsics get_intrinsics(const stream_profile &profile) const override
Definition: l500.h:112
stream_profiles init_stream_profiles() override
platform::backend_device_group get_device_data() const override
Definition: l500.h:91
Definition: rs_sensor.h:57
virtual void make_default()=0
Definition: rs_option.h:52
native_pixel_format * pf
Definition: types.h:609
uvc_sensor & get_depth_sensor()
Definition: l500.h:214
void reset() override
Definition: l500.h:39
const native_pixel_format pf_y8_l500
Definition: rs_sensor.h:48
std::shared_ptr< uvc_sensor > create_depth_device(std::shared_ptr< context > ctx, const std::vector< platform::uvc_device_info > &all_device_infos)
Definition: l500.h:183
void enable_recording(std::function< void(const depth_sensor &)> recording_function) override
Definition: l500.h:173
std::vector< uint8_t > send_receive_raw_data(const std::vector< uint8_t > &input) override
Definition: l500.h:204
const native_pixel_format pf_confidence_l500
const platform::extension_unit depth_xu
Definition: ds5-private.h:80
l500_timestamp_reader(std::shared_ptr< platform::time_service > ts)
Definition: l500.h:33
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
Definition: streaming.h:104
Definition: rs_sensor.h:40
Definition: rs_sensor.h:42
void hardware_reset() override
Definition: l500.h:209
rs2_timestamp_domain get_frame_timestamp_domain(const request_mapping &mode, const platform::frame_object &fo) const override
Definition: l500.h:66
std::vector< platform::uvc_device_info > filter_by_mi(const std::vector< platform::uvc_device_info > &devices, uint32_t mi)
extrinsics_graph & get_extrinsics_graph()
stream_profile to_profile(const stream_profile_interface *sp)
Definition: stream.h:170
Video stream intrinsics.
Definition: rs_types.h:55
void create_snapshot(std::shared_ptr< depth_sensor > &snapshot) const override
Definition: l500.h:169
l500_depth_sensor(l500_device *owner, std::shared_ptr< platform::uvc_device > uvc_device, std::unique_ptr< frame_timestamp_reader > timestamp_reader)
Definition: l500.h:107
stream_profiles init_stream_profiles() override
Definition: l500.h:118
rs2_time_t get_frame_timestamp(const request_mapping &mode, const platform::frame_object &fo) override
Definition: l500.h:48
Definition: streaming.h:158
double rs2_time_t
Definition: rs_types.h:179
l500_info(std::shared_ptr< context > ctx, std::vector< platform::uvc_device_info > depth, platform::usb_device_info hwm)
Definition: l500.h:78
Definition: rs_sensor.h:69
float get_depth_scale() const override
Definition: l500.h:167
static environment & get_instance()
const uint16_t L500_PID
Definition: l500.h:22
Definition: rs_frame.h:22
Definition: rs_sensor.h:65
unsigned long long get_frame_counter(const request_mapping &mode, const platform::frame_object &fo) const override
Definition: l500.h:54
rs2_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.
Definition: rs_frame.h:19