Skip to content
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
84e4daa
Adding error checking to GL code
dorodnic Jul 27, 2019
c6898fa
Adding mouse picking to the GL pointcloud renderer
dorodnic Jul 27, 2019
21151f1
Allowing pointcloud selection
dorodnic Jul 27, 2019
8837a0c
More mouse selection
dorodnic Jul 27, 2019
2310e9b
Merge remote-tracking branch 'origin/development' into mouse_picking2
dorodnic May 6, 2020
1e2e339
Fixing exceptions from zero-order
dorodnic May 6, 2020
a1e4616
Adding shaded view
dorodnic May 6, 2020
0ad5227
Adding normals to 3D view
dorodnic May 6, 2020
c154124
fix compile error in get time
gwen2018 May 6, 2020
d849ab4
use pbo to improve readpixels performance
gwen2018 May 7, 2020
fab87bb
Normal optimisation
dorodnic May 7, 2020
70ebff5
Merge remote-tracking branch 'wen/point_cloud_measurement_gpu' into m…
dorodnic May 7, 2020
d79487c
work in progress on pbo transfer
dorodnic May 7, 2020
40f461f
Changing to RGB
dorodnic May 7, 2020
9eb6e03
Relative seperation distance for pointclouds
dorodnic May 7, 2020
44adb1f
More viewer behaviour
dorodnic May 7, 2020
bbb0c91
Adding skybox
dorodnic May 9, 2020
b2af73e
Small refactoring in the viewer
dorodnic May 9, 2020
d713a3b
Fixing for high dpi display
dorodnic May 9, 2020
3ce4384
Switching format to F16
dorodnic May 9, 2020
f3d01e5
Merge branch 'mouse_picking2' of https://github.com/dorodnic/libreals…
dorodnic May 9, 2020
3a14830
Remove RC firmware
dorodnic May 9, 2020
74ac3ce
Add notification delay
dorodnic May 9, 2020
df5fe6c
Small UI changes
dorodnic May 9, 2020
facce66
Merge branch 'mouse_picking2' of https://github.com/dorodnic/libreals…
dorodnic May 9, 2020
148afc2
Simplifying the pointclound shader a bit
dorodnic May 9, 2020
b3537db
Merge branch 'mouse_picking2' of https://github.com/dorodnic/libreals…
dorodnic May 9, 2020
55aa2a4
Extracting PBO
dorodnic May 9, 2020
2363c04
Minor changes
dorodnic May 9, 2020
b544626
Merge branch 'mouse_picking2' of https://github.com/dorodnic/libreals…
dorodnic May 9, 2020
305a140
Use half-floats?
dorodnic May 9, 2020
d943247
Merge branch 'mouse_picking2' of https://github.com/dorodnic/libreals…
dorodnic May 9, 2020
f45b4d9
Performance improvments + bug fix in occlusion invalidatio
dorodnic May 9, 2020
4c7b524
New 3D viewer design
dorodnic May 10, 2020
3dd75c5
Calculate normal in CPU
dorodnic May 10, 2020
ce3a617
Fixing the viewport
dorodnic May 10, 2020
e0d1453
Fixing opengl usage in couple of places
dorodnic May 10, 2020
31f3fe0
Fixing mouse picking in custom FB size
dorodnic May 10, 2020
44362c3
Reduce click effect
dorodnic May 10, 2020
1c8ed86
Merge branch 'mouse_picking2' of https://github.com/dorodnic/libreals…
dorodnic May 10, 2020
385ab83
Only mouse pick when needed
dorodnic May 11, 2020
7a1cb55
Optimisations for integrated graphics
dorodnic May 11, 2020
6e6cf74
More UX improvements
dorodnic May 11, 2020
8b96829
Adding basic measurement functionality
dorodnic May 11, 2020
21e1527
Merge remote-tracking branch 'dorodnic/mouse_picking2' into translate…
gwen2018 May 12, 2020
2d9dbde
demo 3d to 2d translation
gwen2018 May 13, 2020
2950553
add measurement label and origin occlusion detection, validate 3d to …
gwen2018 May 15, 2020
e7a6dc0
fix matrix multiplication inconsistency, ruler label position, and 3d…
gwen2018 May 15, 2020
9511442
fix origin
gwen2018 May 15, 2020
33c1b13
Small UI improvements
dorodnic May 16, 2020
bde8e5d
WIP on frustum decomposition
dorodnic May 16, 2020
7c8817b
Merge remote-tracking branch 'wen/translate_demo' into mouse_picking2
dorodnic May 16, 2020
8b696cc
Make camera model occlusion gradual
dorodnic May 16, 2020
0945fb1
Zoomed in mouse-picking
dorodnic May 16, 2020
0991f50
Simplifying the shader and refactoring
dorodnic May 16, 2020
105935e
Build cleanup
dorodnic May 16, 2020
ed445bd
Fixing small issues
dorodnic May 16, 2020
c0ce8ba
Improved measurement label
dorodnic May 16, 2020
b0df362
Improved UI and more agressive diffuse shading
dorodnic May 16, 2020
2d4cf35
Small UI fixes
dorodnic May 17, 2020
6271b21
Small measurements enhancements
dorodnic May 18, 2020
8371097
Allow moving the measurement points
dorodnic May 18, 2020
44952cf
Code review fixes
dorodnic May 24, 2020
5dd40d2
Enable confidence as texture source, auto switch to new textures and …
dorodnic May 24, 2020
a153223
Refactoring everything measurement related to a dedicated file
dorodnic May 24, 2020
55a60df
More measurement enhancements
dorodnic May 25, 2020
d141545
Merge branch 'development' into mouse_picking2
dorodnic Jun 1, 2020
69f98bc
Fixing code review comment
dorodnic Jun 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ set(COMMON_SRC
"${CMAKE_CURRENT_LIST_DIR}/fw-update-helper.cpp"
"${CMAKE_CURRENT_LIST_DIR}/metadata-helper.h"
"${CMAKE_CURRENT_LIST_DIR}/metadata-helper.cpp"
"${CMAKE_CURRENT_LIST_DIR}/skybox.h"
"${CMAKE_CURRENT_LIST_DIR}/skybox.cpp"
"${CMAKE_CURRENT_LIST_DIR}/on-chip-calib.h"
"${CMAKE_CURRENT_LIST_DIR}/on-chip-calib.cpp"
"${CMAKE_CURRENT_LIST_DIR}/decompress-huffman.h"
Expand Down
14 changes: 1 addition & 13 deletions common/fw-update-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@

#ifdef INTERNAL_FW
#include "common/fw/D4XX_FW_Image.h"
#include "common/fw/D4XX_RC_Image.h"
#include "common/fw/SR3XX_FW_Image.h"
#else
#define FW_D4XX_FW_IMAGE_VERSION ""
#define FW_D4XX_RC_IMAGE_VERSION ""
#define FW_SR3XX_FW_IMAGE_VERSION ""
const char* fw_get_D4XX_FW_Image(int) { return NULL; }
const char* fw_get_D4XX_RC_Image(int) { return NULL; }
const char* fw_get_SR3XX_FW_Image(int) { return NULL; }
#endif // INTERNAL_FW

Expand Down Expand Up @@ -56,8 +53,7 @@ namespace rs2
{
bool allow_rc_firmware = config_file::instance().get_or_default(configurations::update::allow_rc_firmware, false);

if (product_line == RS2_PRODUCT_LINE_D400 && allow_rc_firmware) return FW_D4XX_RC_IMAGE_VERSION;
else if (product_line == RS2_PRODUCT_LINE_D400) return FW_D4XX_FW_IMAGE_VERSION;
if (product_line == RS2_PRODUCT_LINE_D400) return FW_D4XX_FW_IMAGE_VERSION;
//else if (product_line == RS2_PRODUCT_LINE_SR300) return FW_SR3XX_FW_IMAGE_VERSION;
else return "";
}
Expand All @@ -76,14 +72,6 @@ namespace rs2
rv[RS2_PRODUCT_LINE_D400] = vec;
}

if (strlen(FW_D4XX_RC_IMAGE_VERSION) && allow_rc_firmware)
{
int size = 0;
auto hex = fw_get_D4XX_RC_Image(size);
auto vec = std::vector<uint8_t>(hex, hex + size);
rv[RS2_PRODUCT_LINE_D400] = vec;
}

if (strlen(FW_SR3XX_FW_IMAGE_VERSION))
{
int size = 0;
Expand Down
7 changes: 0 additions & 7 deletions common/fw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ message(STATUS "Fetching recommended firmwares:")
set(REALSENSE_FIRMWARE_URL "http://realsense-hw-public.s3.amazonaws.com" CACHE STRING
"URL to download firmware binaries from")

string(REGEX MATCH "D4XX_RC_FIRMWARE_VERSION \"([0-9]+.[0-9]+.[0-9]+.[0-9]+)\"" _ ${ver})
set(D4XX_RC_VERSION ${CMAKE_MATCH_1})
message(STATUS "D4XX_RC_VERSION: ${D4XX_RC_VERSION}")
set(D4XX_RC_SHA1 be77db800142110b35d1cc7f12dfc77e75ed9c8a)
set(D4XX_RC_URL "${REALSENSE_FIRMWARE_URL}/Releases/RS4xx/FW")

string(REGEX MATCH "D4XX_RECOMMENDED_FIRMWARE_VERSION \"([0-9]+.[0-9]+.[0-9]+.[0-9]+)\"" _ ${ver})
set(D4XX_FW_VERSION ${CMAKE_MATCH_1})
message(STATUS "D4XX_FW_VERSION: ${D4XX_FW_VERSION}")
Expand Down Expand Up @@ -78,7 +72,6 @@ function(target_binary url version sha1 symbol ext)
endfunction()

target_binary( "${D4XX_FW_URL}" "${D4XX_FW_VERSION}" "${D4XX_FW_SHA1}" D4XX_FW_Image .bin)
target_binary( "${D4XX_RC_URL}" "${D4XX_RC_VERSION}" "${D4XX_RC_SHA1}" D4XX_RC_Image .bin)
target_binary( "${SR3XX_FW_URL}" "${SR3XX_FW_VERSION}" "${SR3XX_FW_SHA1}" SR3XX_FW_Image .bin)
target_binary( "${T26X_FW_URL}" "${T26X_FW_VERSION}" "${T26X_FW_SHA1}" target .mvcmd)

Expand Down
1 change: 0 additions & 1 deletion common/fw/firmware-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@

#define D4XX_RECOMMENDED_FIRMWARE_VERSION "5.12.3.0"
#define SR3XX_RECOMMENDED_FIRMWARE_VERSION "3.26.1.0"
#define D4XX_RC_FIRMWARE_VERSION "5.12.3.0"
#define T26X_FIRMWARE_VERSION "0.2.0.951"
1 change: 0 additions & 1 deletion common/fw/fw.rc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "D4XX_FW_Image.rc"
#include "D4XX_RC_Image.rc"
#include "SR3XX_FW_Image.rc"
#include "target.rc"
20 changes: 15 additions & 5 deletions common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#include <imgui_internal.h>
#include <time.h>

#include "imgui-fonts-karla.hpp"
#include "imgui-fonts-fontawesome.hpp"

#include "os.h"

#include "metadata-helper.h"
Expand Down Expand Up @@ -140,9 +143,8 @@ namespace rs2

const int OVERSAMPLE = config_file::instance().get(configurations::performance::font_oversample);

static const ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 }; // will not be copied by AddFont* so keep in scope.
static const ImWchar icons_ranges[] = { 0xf000, 0xf999, 0 }; // will not be copied by AddFont* so keep in scope.

// Load 14px size fonts
{
ImFontConfig config_words;
config_words.OversampleV = OVERSAMPLE;
Expand Down Expand Up @@ -170,6 +172,7 @@ namespace rs2
config_glyphs.OversampleH = OVERSAMPLE;
font_18 = io.Fonts->AddFontFromMemoryCompressedTTF(font_awesome_compressed_data,
font_awesome_compressed_size, 20.f, &config_glyphs, icons_ranges);

}

style.WindowRounding = 0.0f;
Expand Down Expand Up @@ -3327,11 +3330,16 @@ namespace rs2
{
auto n = std::make_shared<fw_update_notification_model>(
msg.str(), manager, false);
viewer.not_model.add_notification(n);
n->delay_id = "dfu." + name.second;
n->enable_complex_dismiss = true;
if (!n->is_delayed())
{
viewer.not_model.add_notification(n);

fw_update_required = true;
fw_update_required = true;

related_notifications.push_back(n);
related_notifications.push_back(n);
}
}
}
}
Expand Down Expand Up @@ -3643,6 +3651,8 @@ namespace rs2
default: break;
}

pc->set_option(RS2_OPTION_FILTER_MAGNITUDE,
viewer.occlusion_invalidation ? 2.f : 1.f);
res.push_back(pc->calculate(depth));
}
if(auto texture = viewer.get_3d_texture_source(filtered))
Expand Down
8 changes: 6 additions & 2 deletions common/model-views.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#include <array>
#include <unordered_map>

#include "imgui-fonts-karla.hpp"
#include "imgui-fonts-fontawesome.hpp"
#include "../third-party/json.hpp"
#include "objects-in-frame.h"
#include "processing-block-model.h"
Expand Down Expand Up @@ -163,6 +161,7 @@ namespace rs2
static const char* settings_tab { "viewer_model.settings_tab" };
static const char* sdk_version { "viewer_model.sdk_version" };
static const char* last_calib_notice { "viewer_model.last_calib_notice" };
static const char* is_measuring { "viewer_model.is_measuring" };

static const char* log_to_console { "viewer_model.log_to_console" };
static const char* log_to_file { "viewer_model.log_to_file" };
Expand All @@ -172,6 +171,7 @@ namespace rs2
static const char* show_map_ruler { "viewer_model.show_map_ruler" };
static const char* show_stream_details { "viewer_model.show_stream_details" };
static const char* metric_system { "viewer_model.metric_system" };
static const char* shading_mode { "viewer_model.shading_mode" };

static const char* last_ip { "viewer_model.last_ip" };
}
Expand All @@ -195,6 +195,8 @@ namespace rs2
static const char* show_fps { "performance.show_fps" };
static const char* vsync { "performance.vsync" };
static const char* font_oversample { "performance.font_oversample.v2" };
static const char* show_skybox { "performance.show_skybox" };
static const char* occlusion_invalidation { "performance.occlusion_invalidation" };
}
namespace ply
{
Expand Down Expand Up @@ -261,6 +263,8 @@ namespace rs2
static const textual_icon metadata { u8"\uF0AE" };
static const textual_icon check { u8"\uF00C" };
static const textual_icon mail { u8"\uF01C" };
static const textual_icon cube { u8"\uf1b2" };
static const textual_icon measure { u8"\uf545" };
}

class subdevice_model;
Expand Down
65 changes: 64 additions & 1 deletion common/notifications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,52 @@ namespace rs2
ImGui::SetCursorScreenPos({ float(x + width - 105), float(y + height - 25) });

string id = to_string() << "Dismiss" << "##" << index;

ImGui::PushStyleColor(ImGuiCol_Text, black);
ImGui::PushStyleColor(ImGuiCol_PopupBg, almost_white_bg);
ImGui::PushStyleColor(ImGuiCol_HeaderHovered, light_blue);
ImGui::PushStyleColor(ImGuiCol_TextSelectedBg, white);

ImGui::PushFont(win.get_font());

ImGui::SetNextWindowPos({ float(x + width - 125), float(y + height - 25) });
ImGui::SetNextWindowSize({ 120, 70 });

std::string dismiss_popup = to_string() << "Dismiss Options" << "##" << index;
if (ImGui::BeginPopup(dismiss_popup.c_str()))
{
if (ImGui::Selectable("Just this time"))
{
dismiss(true);
}

if (ImGui::Selectable("Remind me later"))
{
delay(7);
dismiss(true);
}

if (ImGui::Selectable("Don't show again"))
{
delay(1000);
dismiss(true);
}

ImGui::EndPopup();
}

ImGui::PopFont();
ImGui::PopStyleColor(4);

if (ImGui::Button(id.c_str(), { 100, 20 }))
{
dismiss(true);
if (enable_complex_dismiss)
ImGui::OpenPopup(dismiss_popup.c_str());
else dismiss(true);
}
if (ImGui::IsItemHovered())
{
win.link_hovered();
}
}

Expand Down Expand Up @@ -1039,4 +1082,24 @@ namespace rs2
ImGui::SetTooltip("%s", "Enables metadata on connected devices (you may be prompted for administrator privileges)");
}
}

bool notification_model::is_delayed() const
{
// Make sure we don't spam calibration remainders too often:
time_t rawtime;
time(&rawtime);
std::string str = to_string() << "notifications." << delay_id << ".next";
long long next_time = config_file::instance().get_or_default(str.c_str(), (long long)0);

return rawtime < next_time;
}

void notification_model::delay(int days)
{
// Make sure we don't spam calibration remainders too often:
time_t rawtime;
time(&rawtime);
std::string str = to_string() << "notifications." << delay_id << ".next";
config_file::instance().set(str.c_str(), (long long)(rawtime + days * 60 * 60 * 24));
}
}
6 changes: 6 additions & 0 deletions common/notifications.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ namespace rs2
bool enable_dismiss = true;
bool enable_expand = true;
bool enable_click = false;
bool enable_complex_dismiss = false;

std::string delay_id = "";

bool is_delayed() const;
void delay(int days);

float last_x, last_y;
bool animating = false;
Expand Down
Loading