Skip to content

Commit

Permalink
Merge pull request #4541 from aangerma/development
Browse files Browse the repository at this point in the history
Updates to l500
  • Loading branch information
ev-mp authored Aug 1, 2019
2 parents 5f7a275 + 8e23141 commit 125d650
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
23 changes: 20 additions & 3 deletions common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,17 @@ namespace rs2
}
catch (...) {}

auto filters = s->get_recommended_filters();

auto it = std::find_if(filters.begin(), filters.end(), [&](const filter &f)
{
if (f.is<zero_order_invalidation>())
return true;
return false;
});

auto is_zo = it != filters.end();

for (auto&& f : s->get_recommended_filters())
{
auto shared_filter = std::make_shared<filter>(f);
Expand All @@ -936,12 +947,18 @@ namespace rs2
//if (shared_filter->is<disparity_transform>())
// model->visible = false;

if (shared_filter->is<zero_order_invalidation>())
if (is_zo)
{
zero_order_artifact_fix = model;
viewer.zo_sensors++;
if (shared_filter->is<zero_order_invalidation>())
{
zero_order_artifact_fix = model;
viewer.zo_sensors++;
}
else
model->enabled = false;
}


if (shared_filter->is<hole_filling_filter>())
model->enabled = false;

Expand Down
11 changes: 6 additions & 5 deletions src/l500/l500-factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,14 @@ namespace librealsense
if (!ivcam2::try_fetch_usb_device(group.usb_devices, depth, hwm))
LOG_WARNING("try_fetch_usb_device(...) failed.");

if (g.second.size() < 2)
{
LOG_WARNING("L500 partial enum: " << g.second.size() << " HID devices were recognized (2+ expected)");
if(g.first[0].pid != L500_PID)
if (g.second.size() < 2)
{
LOG_WARNING("L500 partial enum: " << g.second.size() << " HID devices were recognized (2+ expected)");
#if !defined(ANDROID) && !defined(__APPLE__) // Not supported by android & macos
continue;
continue;
#endif // Not supported by android & macos
}
}

auto info = std::make_shared<l500_info>(ctx, g.first, hwm, g.second);
chosen.push_back(depth);
Expand Down
5 changes: 4 additions & 1 deletion src/mf/mf-hid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <initguid.h>
#include <propkeydef.h>
#include <comutil.h>
#include <string>

#pragma comment(lib, "Sensorsapi.lib")
#pragma comment(lib, "PortableDeviceGuids.lib")
Expand Down Expand Up @@ -443,7 +444,9 @@ namespace librealsense
}
if (IsEqualPropertyKey(propertyKey, SENSOR_PROPERTY_SERIAL_NUMBER))
{
info.serial_number = std::string(propertyValue.pwszVal, propertyValue.pwszVal + wcslen(propertyValue.pwszVal));
auto str = std::string(propertyValue.pwszVal, propertyValue.pwszVal + wcslen(propertyValue.pwszVal));
std::transform(begin(str), end(str), begin(str), ::tolower);
info.serial_number = str;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/proc/zero-order.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "option.h"
#include "l500/l500-private.h"

#define IR_THRESHOLD 115
#define RTD_THRESHOLD 200
#define IR_THRESHOLD 120
#define RTD_THRESHOLD 50
#define BASELINE -10
#define PATCH_SIZE 5
#define Z_MAX_VALUE 1200
Expand Down

0 comments on commit 125d650

Please sign in to comment.