Skip to content

Commit 125d650

Browse files
authored
Merge pull request #4541 from aangerma/development
Updates to l500
2 parents 5f7a275 + 8e23141 commit 125d650

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

common/model-views.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,17 @@ namespace rs2
926926
}
927927
catch (...) {}
928928

929+
auto filters = s->get_recommended_filters();
930+
931+
auto it = std::find_if(filters.begin(), filters.end(), [&](const filter &f)
932+
{
933+
if (f.is<zero_order_invalidation>())
934+
return true;
935+
return false;
936+
});
937+
938+
auto is_zo = it != filters.end();
939+
929940
for (auto&& f : s->get_recommended_filters())
930941
{
931942
auto shared_filter = std::make_shared<filter>(f);
@@ -936,12 +947,18 @@ namespace rs2
936947
//if (shared_filter->is<disparity_transform>())
937948
// model->visible = false;
938949

939-
if (shared_filter->is<zero_order_invalidation>())
950+
if (is_zo)
940951
{
941-
zero_order_artifact_fix = model;
942-
viewer.zo_sensors++;
952+
if (shared_filter->is<zero_order_invalidation>())
953+
{
954+
zero_order_artifact_fix = model;
955+
viewer.zo_sensors++;
956+
}
957+
else
958+
model->enabled = false;
943959
}
944960

961+
945962
if (shared_filter->is<hole_filling_filter>())
946963
model->enabled = false;
947964

src/l500/l500-factory.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,14 @@ namespace librealsense
106106
if (!ivcam2::try_fetch_usb_device(group.usb_devices, depth, hwm))
107107
LOG_WARNING("try_fetch_usb_device(...) failed.");
108108

109-
if (g.second.size() < 2)
110-
{
111-
LOG_WARNING("L500 partial enum: " << g.second.size() << " HID devices were recognized (2+ expected)");
109+
if(g.first[0].pid != L500_PID)
110+
if (g.second.size() < 2)
111+
{
112+
LOG_WARNING("L500 partial enum: " << g.second.size() << " HID devices were recognized (2+ expected)");
112113
#if !defined(ANDROID) && !defined(__APPLE__) // Not supported by android & macos
113-
continue;
114+
continue;
114115
#endif // Not supported by android & macos
115-
}
116+
}
116117

117118
auto info = std::make_shared<l500_info>(ctx, g.first, hwm, g.second);
118119
chosen.push_back(depth);

src/mf/mf-hid.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <initguid.h>
2525
#include <propkeydef.h>
2626
#include <comutil.h>
27+
#include <string>
2728

2829
#pragma comment(lib, "Sensorsapi.lib")
2930
#pragma comment(lib, "PortableDeviceGuids.lib")
@@ -443,7 +444,9 @@ namespace librealsense
443444
}
444445
if (IsEqualPropertyKey(propertyKey, SENSOR_PROPERTY_SERIAL_NUMBER))
445446
{
446-
info.serial_number = std::string(propertyValue.pwszVal, propertyValue.pwszVal + wcslen(propertyValue.pwszVal));
447+
auto str = std::string(propertyValue.pwszVal, propertyValue.pwszVal + wcslen(propertyValue.pwszVal));
448+
std::transform(begin(str), end(str), begin(str), ::tolower);
449+
info.serial_number = str;
447450
}
448451
}
449452

src/proc/zero-order.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#include "option.h"
99
#include "l500/l500-private.h"
1010

11-
#define IR_THRESHOLD 115
12-
#define RTD_THRESHOLD 200
11+
#define IR_THRESHOLD 120
12+
#define RTD_THRESHOLD 50
1313
#define BASELINE -10
1414
#define PATCH_SIZE 5
1515
#define Z_MAX_VALUE 1200

0 commit comments

Comments
 (0)