14 #include "../firmware_logger_device.h" 22 #include "../firmware_logger_device.h" 26 using namespace ivcam2;
38 bool register_device_notifications)
39 :
device(ctx, group, register_device_notifications),
47 get_firmware_logs_command(),
48 get_flash_logs_command())
51 std::shared_ptr<matcher> create_matcher(
const frame_holder&
frame)
const override;
55 std::vector<tagged_profile>
tags;
60 tags.insert(tags.begin(), depth_profiles.begin(), depth_profiles.end());
61 tags.insert(tags.begin(), color_profiles.begin(), color_profiles.end());
62 tags.insert(tags.begin(), motion_profiles.begin(), motion_profiles.end());
77 bool register_device_notifications)
78 :
device(ctx, group, register_device_notifications),
86 get_firmware_logs_command(),
87 get_flash_logs_command())
90 std::shared_ptr<matcher> create_matcher(
const frame_holder&
frame)
const override;
94 std::vector<tagged_profile>
tags;
99 tags.insert(tags.begin(), depth_profiles.begin(), depth_profiles.end());
100 tags.insert(tags.begin(), color_profiles.begin(), color_profiles.end());
101 tags.insert(tags.begin(), motion_profiles.begin(), motion_profiles.end());
112 bool register_device_notifications)
113 :
device(ctx, group, register_device_notifications),
117 get_firmware_logs_command(),
118 get_flash_logs_command())
123 std::shared_ptr<matcher> create_matcher(
const frame_holder&
frame)
const override;
127 bool register_device_notifications)
const 129 if (_depth.size() == 0)
throw std::runtime_error(
"Depth Camera not found!");
130 auto pid = _depth.front().pid;
136 return std::make_shared<rs500_device>(
ctx,
group, register_device_notifications);
139 return std::make_shared<l515_device>(
ctx,
group, register_device_notifications);
141 return std::make_shared<l535_device>(
ctx,
group, register_device_notifications);
143 throw std::runtime_error(
to_string() <<
"Unsupported L500 model! 0x" 144 << std::hex << std::setw(4) << std::setfill(
'0') << (
int)pid);
149 std::shared_ptr<context>
ctx,
152 std::vector<platform::uvc_device_info> chosen;
153 std::vector<std::shared_ptr<device_info>> results;
157 for (
auto&
g : group_devices)
165 LOG_DEBUG(
"try_fetch_usb_device(...) failed.");
168 if (
g.second.size() < 2)
170 LOG_DEBUG(
"L500 partial enum: " <<
g.second.size() <<
" HID devices were recognized (2+ expected)");
171 #if !defined(ANDROID) && !defined(__APPLE__) // Not supported by android & macos 173 #endif // Not supported by android & macos 176 auto info = std::make_shared<l500_info>(
ctx,
g.first, hwm,
g.second);
177 chosen.push_back(
depth);
178 results.push_back(
info);
182 LOG_DEBUG(
"L500 group_devices is empty.");
198 LOG_DEBUG(
"l515_device::create_matcher" );
200 std::make_shared<identity_matcher>(_color_stream->get_unique_id(), _color_stream->get_stream_type())};
202 auto ts_depth_rgb = std::make_shared<timestamp_composite_matcher>(depth_rgb_matchers);
204 auto identity_gyro = std::make_shared<identity_matcher>(_gyro_stream->get_unique_id(), _gyro_stream->get_stream_type());
205 auto identity_accel = std::make_shared<identity_matcher>(_accel_stream->get_unique_id(), _accel_stream->get_stream_type());
207 std::vector<std::shared_ptr<matcher>> depth_rgb_imu_matchers = {ts_depth_rgb, identity_gyro, identity_accel};
208 return std::make_shared<composite_identity_matcher>(depth_rgb_imu_matchers);
213 LOG_DEBUG(
"l535_device::create_matcher");
215 std::make_shared<identity_matcher>(_color_stream->get_unique_id(), _color_stream->get_stream_type()) };
217 auto ts_depth_rgb = std::make_shared<timestamp_composite_matcher>(depth_rgb_matchers);
219 auto identity_gyro = std::make_shared<identity_matcher>(_gyro_stream->get_unique_id(), _gyro_stream->get_stream_type());
220 auto identity_accel = std::make_shared<identity_matcher>(_accel_stream->get_unique_id(), _accel_stream->get_stream_type());
222 std::vector<std::shared_ptr<matcher>> depth_rgb_imu_matchers = { ts_depth_rgb, identity_gyro, identity_accel };
223 return std::make_shared<composite_identity_matcher>(depth_rgb_imu_matchers);
std::vector< tagged_profile > get_profiles_tags() const override
std::vector< platform::uvc_device_info > filter_by_product(const std::vector< platform::uvc_device_info > &devices, const std::set< uint16_t > &pid_list)
std::vector< tagged_profile > get_profiles_tags() const override
void trim_device_list(std::vector< platform::usb_device_info > &devices, const std::vector< platform::usb_device_info > &chosen)
l500_color_sensor * get_color_sensor() override
bool try_fetch_usb_device(std::vector< platform::usb_device_info > &devices, const platform::uvc_device_info &info, platform::usb_device_info &result)
GLint GLint GLsizei GLsizei GLsizei depth
std::shared_ptr< matcher > create_matcher(const frame_holder &frame) const override
l515_device(std::shared_ptr< context > ctx, const platform::backend_device_group &group, bool register_device_notifications)
std::vector< tagged_profile > get_profiles_tags() const override
def info(name, value, persistent=False)
std::vector< std::pair< std::vector< platform::uvc_device_info >, std::vector< platform::hid_device_info > > > group_devices_and_hids_by_unique_id(const std::vector< std::vector< platform::uvc_device_info >> &devices, const std::vector< platform::hid_device_info > &hids)
rs500_device(std::shared_ptr< context > ctx, const platform::backend_device_group &group, bool register_device_notifications)
std::vector< std::vector< platform::uvc_device_info > > group_devices_by_unique_id(const std::vector< platform::uvc_device_info > &devices)
l535_device(std::shared_ptr< context > ctx, const platform::backend_device_group &group, bool register_device_notifications)
std::shared_ptr< device_interface > create(std::shared_ptr< context > ctx, bool register_device_notifications) const override
platform::uvc_device_info get_mi(const std::vector< platform::uvc_device_info > &devices, uint32_t mi)
std::shared_ptr< matcher > create_matcher(const frame_holder &frame) const override
std::shared_ptr< matcher > create_matcher(const frame_holder &frame) const override
static std::vector< std::shared_ptr< device_info > > pick_l500_devices(std::shared_ptr< context > ctx, platform::backend_device_group &group)
std::vector< tagged_profile > get_profiles_tags() const override
std::vector< tagged_profile > get_profiles_tags() const override
const uint16_t L515_PID_PRE_PRQ
std::shared_ptr< matcher > create_matcher(const frame_holder &frame) const override
bool mi_present(const std::vector< platform::uvc_device_info > &devices, uint32_t mi)
std::string to_string(T value)