From 62f80c8b1bbdd6752cd94b4f0974717bfc680088 Mon Sep 17 00:00:00 2001 From: Evgeni Raikhel Date: Wed, 3 Jun 2020 07:20:58 +0300 Subject: [PATCH 01/10] Libcurl Replace /MD with /MT Add thirdsparty/libcurl holder --- third-party/libcurl/CMakeLists.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 third-party/libcurl/CMakeLists.txt diff --git a/third-party/libcurl/CMakeLists.txt b/third-party/libcurl/CMakeLists.txt new file mode 100644 index 0000000000..70934d7ea0 --- /dev/null +++ b/third-party/libcurl/CMakeLists.txt @@ -0,0 +1,22 @@ +# ubuntu 12.04 LTS cmake version 2.8.7 +# ubuntu 14.04 LTS cmake version 2.8.12.2 +# ubuntu 16.04 LTS cmake version 3.5.1 +cmake_minimum_required(VERSION 2.8.3) + +project(curl) + +if(WIN32) + set_target_properties (curl PROPERTIES + FOLDER "3rd Party" + ) + + foreach(flag_var + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) + if(${flag_var} MATCHES "/MD") + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endif(${flag_var} MATCHES "/MD") + endforeach(flag_var) +endif() From 3faf295239b841fc3a13d950c533c80c593bc94a Mon Sep 17 00:00:00 2001 From: gwen2018 Date: Thu, 4 Jun 2020 08:05:41 -0700 Subject: [PATCH 02/10] rebase to rc3 - handle imu table read issue --- src/l500/l500-motion.cpp | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/src/l500/l500-motion.cpp b/src/l500/l500-motion.cpp index f45d6b5ba8..aa9476948c 100644 --- a/src/l500/l500-motion.cpp +++ b/src/l500/l500-motion.cpp @@ -98,7 +98,19 @@ namespace librealsense // read imu calibration table on L515 // READ_TABLE 0x243 0 command cmd(ivcam2::READ_TABLE, 0x243, 0); - return _hw_monitor->send(cmd); + + std::vector res; + + try + { + res = _hw_monitor->send(cmd); + } + catch (std::exception &e) { + LOG_WARNING(e.what()); + } + catch (...) {} + + return res; } std::shared_ptr l500_motion::create_hid_device(std::shared_ptr ctx, const std::vector& all_hid_infos) @@ -132,12 +144,11 @@ namespace librealsense // Motion intrinsic calibration presents is a prerequisite for motion correction. try { - // Writing to log to dereference underlying structure - LOG_INFO("Accel Sensitivity:" << (**_accel_intrinsic).sensitivity); - LOG_INFO("Gyro Sensitivity:" << (**_gyro_intrinsic).sensitivity); - - mm_correct_opt = std::make_shared(hid_ep.get(), option_range{ 0, 1, 1, 1 }); - hid_ep->register_option(RS2_OPTION_ENABLE_MOTION_CORRECTION, mm_correct_opt); + if (_mm_calib) + { + mm_correct_opt = std::make_shared(hid_ep.get(), option_range{ 0, 1, 1, 1 }); + hid_ep->register_option(RS2_OPTION_ENABLE_MOTION_CORRECTION, mm_correct_opt); + } } catch (...) {} @@ -163,12 +174,15 @@ namespace librealsense { _imu_eeprom_raw = [this]() { return get_imu_eeprom_raw(); }; - _mm_calib = std::make_shared(*_imu_eeprom_raw); + if (!_imu_eeprom_raw->empty()) + { + _mm_calib = std::make_shared(*_imu_eeprom_raw); - _accel_intrinsic = std::make_shared>([this]() { return _mm_calib->get_intrinsic(RS2_STREAM_ACCEL); }); - _gyro_intrinsic = std::make_shared>([this]() { return _mm_calib->get_intrinsic(RS2_STREAM_GYRO); }); - // use predefined values extrinsics - _depth_to_imu = std::make_shared>([this]() { return _mm_calib->get_extrinsic(RS2_STREAM_ACCEL); }); + _accel_intrinsic = std::make_shared>([this]() { return _mm_calib->get_intrinsic(RS2_STREAM_ACCEL); }); + _gyro_intrinsic = std::make_shared>([this]() { return _mm_calib->get_intrinsic(RS2_STREAM_GYRO); }); + // use predefined values extrinsics + _depth_to_imu = std::make_shared>([this]() { return _mm_calib->get_extrinsic(RS2_STREAM_ACCEL); }); + } // Make sure all MM streams are positioned with the same extrinsics environment::get_instance().get_extrinsics_graph().register_extrinsics(*_depth_stream, *_accel_stream, _depth_to_imu); From 66dcb1cc071cda7643f03d40a9b4af3a2ce29dd4 Mon Sep 17 00:00:00 2001 From: Evgeni Raikhel Date: Thu, 4 Jun 2020 18:06:15 +0300 Subject: [PATCH 03/10] Bump 2.35.2 --- include/librealsense2/rs.h | 2 +- package.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/librealsense2/rs.h b/include/librealsense2/rs.h index ac9341f811..6976fff839 100644 --- a/include/librealsense2/rs.h +++ b/include/librealsense2/rs.h @@ -24,7 +24,7 @@ extern "C" { #define RS2_API_MAJOR_VERSION 2 #define RS2_API_MINOR_VERSION 35 -#define RS2_API_PATCH_VERSION 1 +#define RS2_API_PATCH_VERSION 2 #define RS2_API_BUILD_VERSION 0 #ifndef STRINGIFY diff --git a/package.xml b/package.xml index 34b07c86b8..a6180fabb7 100644 --- a/package.xml +++ b/package.xml @@ -7,7 +7,7 @@ librealsense2 - 2.35.1 + 2.35.2 Library for capturing data from the Intel(R) RealSense(TM) SR300, D400 Depth cameras and T2xx Tracking devices. This effort was initiated to better support researchers, creative coders, and app developers in domains such as robotics, virtual reality, and the internet of things. Several often-requested features of RealSense(TM); devices are implemented in this project. From ba03444fc9ddcc0be9856eca4b8346fbc2d3baa2 Mon Sep 17 00:00:00 2001 From: NirAz Date: Thu, 4 Jun 2020 21:15:25 +0300 Subject: [PATCH 04/10] Fix multi build configurations with libcurl --- CMake/external_libcurl.cmake | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMake/external_libcurl.cmake b/CMake/external_libcurl.cmake index 6fbe570bff..4d7e1a4e65 100644 --- a/CMake/external_libcurl.cmake +++ b/CMake/external_libcurl.cmake @@ -2,7 +2,7 @@ if(CHECK_FOR_UPDATES) include(ExternalProject) message(STATUS "Building libcurl enabled") - set(CURL_FLAGS -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DUSE_WIN32_LDAP=OFF -DHTTP_ONLY=ON -DCURL_ZLIB=OFF -DCURL_DISABLE_CRYPTO_AUTH=ON -DCMAKE_USE_OPENSSL=OFF -DCMAKE_USE_LIBSSH2=OFF) + set(CURL_FLAGS -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DUSE_WIN32_LDAP=OFF -DHTTP_ONLY=ON -DCURL_ZLIB=OFF -DCURL_DISABLE_CRYPTO_AUTH=ON -DCMAKE_USE_OPENSSL=OFF -DCMAKE_USE_LIBSSH2=OFF -DBUILD_TESTING=OFF ) if (WIN32) set(CURL_FLAGS ${CURL_FLAGS} -DCURL_STATIC_CRT=ON ) endif() @@ -14,10 +14,16 @@ if(CHECK_FOR_UPDATES) GIT_TAG "53cdc2c963e33bc0cc1a51ad2df79396202e07f8" # curl-7_70_0 SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/third-party/libcurl TEST_COMMAND "" - CMAKE_ARGS -DCMAKE_CXX_STANDARD_LIBRARIES=${CMAKE_CXX_STANDARD_LIBRARIES} + CMAKE_ARGS -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} + -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} + -DCMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL} + -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} + -DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO} + -DCMAKE_CXX_STANDARD_LIBRARIES=${CMAKE_CXX_STANDARD_LIBRARIES} -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/libcurl/libcurl_install -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DANDROID_ABI=${ANDROID_ABI} -DANDROID_STL=${ANDROID_STL} ${CURL_FLAGS} ) From 5b38be6b6323ff33c8acdfb3a5fcc6f244c4eb41 Mon Sep 17 00:00:00 2001 From: NirAz Date: Sun, 7 Jun 2020 13:47:10 +0300 Subject: [PATCH 05/10] specify output lib dir --- CMake/external_libcurl.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/CMake/external_libcurl.cmake b/CMake/external_libcurl.cmake index 4d7e1a4e65..18ce553f00 100644 --- a/CMake/external_libcurl.cmake +++ b/CMake/external_libcurl.cmake @@ -23,6 +23,7 @@ if(CHECK_FOR_UPDATES) -DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO} -DCMAKE_CXX_STANDARD_LIBRARIES=${CMAKE_CXX_STANDARD_LIBRARIES} -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/libcurl/libcurl_install + -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DANDROID_ABI=${ANDROID_ABI} -DANDROID_STL=${ANDROID_STL} ${CURL_FLAGS} From acae2abc82c488c8ea812d8258863a3e6505e09f Mon Sep 17 00:00:00 2001 From: NirAz Date: Sun, 7 Jun 2020 15:26:59 +0300 Subject: [PATCH 06/10] Revert "Libcurl Replace /MD with /MT" This reverts commit 62f80c8b1bbdd6752cd94b4f0974717bfc680088. --- third-party/libcurl/CMakeLists.txt | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 third-party/libcurl/CMakeLists.txt diff --git a/third-party/libcurl/CMakeLists.txt b/third-party/libcurl/CMakeLists.txt deleted file mode 100644 index 70934d7ea0..0000000000 --- a/third-party/libcurl/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -# ubuntu 12.04 LTS cmake version 2.8.7 -# ubuntu 14.04 LTS cmake version 2.8.12.2 -# ubuntu 16.04 LTS cmake version 3.5.1 -cmake_minimum_required(VERSION 2.8.3) - -project(curl) - -if(WIN32) - set_target_properties (curl PROPERTIES - FOLDER "3rd Party" - ) - - foreach(flag_var - CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO - CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) - if(${flag_var} MATCHES "/MD") - string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - endif(${flag_var} MATCHES "/MD") - endforeach(flag_var) -endif() From 5e6e48fc38400ec9f0b963a6419447ea720e72c8 Mon Sep 17 00:00:00 2001 From: Evgeni Raikhel Date: Mon, 8 Jun 2020 00:51:04 +0300 Subject: [PATCH 07/10] Add L515 firmware to internal update Re-applies https://github.com/IntelRealSense/librealsense/pull/6492 Promotes L515 FW to 1.4.1.0 This reverts commit c5fe4cecbdf8129ff7941fc85d56fcf472622b7b. --- common/fw-update-helper.cpp | 14 ++++++++++++++ common/fw/CMakeLists.txt | 8 ++++++++ common/fw/firmware-version.h | 1 + common/fw/fw.rc | 1 + src/l500/l500-device.cpp | 4 ++++ src/l500/l500-device.h | 1 - tools/realsense-viewer/realsense-viewer.cpp | 2 ++ 7 files changed, 30 insertions(+), 1 deletion(-) diff --git a/common/fw-update-helper.cpp b/common/fw-update-helper.cpp index 3e444dba56..a5b08ac83d 100644 --- a/common/fw-update-helper.cpp +++ b/common/fw-update-helper.cpp @@ -16,11 +16,15 @@ #ifdef INTERNAL_FW #include "common/fw/D4XX_FW_Image.h" #include "common/fw/SR3XX_FW_Image.h" +#include "common/fw/L5XX_FW_Image.h" #else #define FW_D4XX_FW_IMAGE_VERSION "" #define FW_SR3XX_FW_IMAGE_VERSION "" +#define FW_L5XX_FW_IMAGE_VERSION "" const char* fw_get_D4XX_FW_Image(int) { return NULL; } const char* fw_get_SR3XX_FW_Image(int) { return NULL; } +const char* fw_get_L5XX_FW_Image(int) { return NULL; } + #endif // INTERNAL_FW constexpr const char* recommended_fw_url = "https://dev.intelrealsense.com/docs/firmware-releases"; @@ -46,6 +50,7 @@ namespace rs2 { if (id == "D400") return RS2_PRODUCT_LINE_D400; else if (id == "SR300") return RS2_PRODUCT_LINE_SR300; + else if (id == "L500") return RS2_PRODUCT_LINE_L500; else return -1; } @@ -55,6 +60,7 @@ namespace rs2 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 if (product_line == RS2_PRODUCT_LINE_L500) return FW_L5XX_FW_IMAGE_VERSION; else return ""; } @@ -80,6 +86,14 @@ namespace rs2 rv[RS2_PRODUCT_LINE_SR300] = vec; } + if (strlen(FW_L5XX_FW_IMAGE_VERSION)) + { + int size = 0; + auto hex = fw_get_L5XX_FW_Image(size); + auto vec = std::vector(hex, hex + size); + rv[RS2_PRODUCT_LINE_L500] = vec; + } + return rv; } diff --git a/common/fw/CMakeLists.txt b/common/fw/CMakeLists.txt index 4acc2d66e0..d0c7ed11a9 100644 --- a/common/fw/CMakeLists.txt +++ b/common/fw/CMakeLists.txt @@ -30,6 +30,12 @@ message(STATUS "T26X_FW_VERSION: ${T26X_FW_VERSION}") set(T26X_FW_SHA1 c3940ccbb0e3045603e4aceaa2d73427f96e24bc) set(T26X_FW_URL "${REALSENSE_FIRMWARE_URL}/Releases/TM2/FW/target/${T26X_FW_VERSION}") +string(REGEX MATCH "L5XX_RECOMMENDED_FIRMWARE_VERSION \"([0-9]+.[0-9]+.[0-9]+.[0-9]+)\"" _ ${ver}) +set(L5XX_FW_VERSION ${CMAKE_MATCH_1}) +message(STATUS "L5XX_FW_VERSION: ${L5XX_FW_VERSION}") +set(L5XX_FW_SHA1 5bb7d4e68994328f324559db66a0c586c3037afa) +set(L5XX_FW_URL "${REALSENSE_FIRMWARE_URL}/Releases/L5xx/FW") + add_library(${PROJECT_NAME} STATIC empty.c) if (MSVC) @@ -74,6 +80,8 @@ endfunction() target_binary( "${D4XX_FW_URL}" "${D4XX_FW_VERSION}" "${D4XX_FW_SHA1}" D4XX_FW_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) +target_binary( "${L5XX_FW_URL}" "${L5XX_FW_VERSION}" "${L5XX_FW_SHA1}" L5XX_FW_Image .bin) + install(TARGETS ${PROJECT_NAME} EXPORT realsense2Targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} diff --git a/common/fw/firmware-version.h b/common/fw/firmware-version.h index f1e9523335..086ce57923 100644 --- a/common/fw/firmware-version.h +++ b/common/fw/firmware-version.h @@ -6,3 +6,4 @@ #define D4XX_RECOMMENDED_FIRMWARE_VERSION "5.12.5.0" #define SR3XX_RECOMMENDED_FIRMWARE_VERSION "3.26.1.0" #define T26X_FIRMWARE_VERSION "0.2.0.951" +#define L5XX_RECOMMENDED_FIRMWARE_VERSION "1.4.1.0" diff --git a/common/fw/fw.rc b/common/fw/fw.rc index 966e995400..5a69fe5710 100644 --- a/common/fw/fw.rc +++ b/common/fw/fw.rc @@ -1,3 +1,4 @@ #include "D4XX_FW_Image.rc" #include "SR3XX_FW_Image.rc" +#include "L5XX_FW_Image.rc" #include "target.rc" diff --git a/src/l500/l500-device.cpp b/src/l500/l500-device.cpp index 3dd1d3933d..9a1187f712 100644 --- a/src/l500/l500-device.cpp +++ b/src/l500/l500-device.cpp @@ -21,6 +21,8 @@ #include "proc/syncer-processing-block.h" #include "proc/rotation-transform.h" #include "fw-update/fw-update-unsigned.h" +#include "../common/fw/firmware-version.h" + namespace librealsense { @@ -89,6 +91,7 @@ namespace librealsense auto asic_serial = _hw_monitor->get_module_serial_string(gvd_buff, module_asic_serial_offset, module_serial_size); auto fwv = _hw_monitor->get_firmware_version_string(gvd_buff, fw_version_offset); _fw_version = firmware_version(fwv); + firmware_version recommended_fw_version(L5XX_RECOMMENDED_FIRMWARE_VERSION); _is_locked = _hw_monitor->get_gvd_field(gvd_buff, is_camera_locked_offset); @@ -113,6 +116,7 @@ namespace librealsense register_info(RS2_CAMERA_INFO_ASIC_SERIAL_NUMBER, asic_serial); register_info(RS2_CAMERA_INFO_FIRMWARE_UPDATE_ID, asic_serial); register_info(RS2_CAMERA_INFO_FIRMWARE_VERSION, _fw_version); + register_info(RS2_CAMERA_INFO_RECOMMENDED_FIRMWARE_VERSION, recommended_fw_version); register_info(RS2_CAMERA_INFO_DEBUG_OP_CODE, std::to_string(static_cast(fw_cmd::GLD))); register_info(RS2_CAMERA_INFO_PHYSICAL_PORT, group.uvc_devices.front().device_path); register_info(RS2_CAMERA_INFO_PRODUCT_ID, pid_hex_str); diff --git a/src/l500/l500-device.h b/src/l500/l500-device.h index cce7590a98..73a62a1ab7 100644 --- a/src/l500/l500-device.h +++ b/src/l500/l500-device.h @@ -71,7 +71,6 @@ namespace librealsense lazy> _calib_table_raw; firmware_version _fw_version; - std::shared_ptr _depth_stream; std::shared_ptr _ir_stream; std::shared_ptr _confidence_stream; diff --git a/tools/realsense-viewer/realsense-viewer.cpp b/tools/realsense-viewer/realsense-viewer.cpp index 02083e195a..6553d579b7 100644 --- a/tools/realsense-viewer/realsense-viewer.cpp +++ b/tools/realsense-viewer/realsense-viewer.cpp @@ -28,9 +28,11 @@ #ifdef INTERNAL_FW #include "common/fw/D4XX_FW_Image.h" #include "common/fw/SR3XX_FW_Image.h" +#include "common/fw/L5XX_FW_Image.h" #else #define FW_D4XX_FW_IMAGE_VERSION "" #define FW_SR3XX_FW_IMAGE_VERSION "" +#define FW_L5XX_FW_IMAGE_VERSION "" #endif // INTERNAL_FW #include From 030fa0f1dc11e5999883e0d1339939097f556936 Mon Sep 17 00:00:00 2001 From: NirAz Date: Mon, 8 Jun 2020 09:09:48 +0300 Subject: [PATCH 08/10] SW update - UI updates --- common/model-views.cpp | 14 +- common/model-views.h | 2 +- common/sw-update/dev-updates-profile.cpp | 40 +- common/sw-update/dev-updates-profile.h | 4 + common/updates-model.cpp | 540 +++++++++++++---------- common/updates-model.h | 30 ++ 6 files changed, 382 insertions(+), 248 deletions(-) diff --git a/common/model-views.cpp b/common/model-views.cpp index 0092c7aedd..9e922a28cb 100644 --- a/common/model-views.cpp +++ b/common/model-views.cpp @@ -3252,7 +3252,7 @@ namespace rs2 { for (auto&& n : related_notifications) n->dismiss(false); - _updates->remove_profile(_updates_profile); + _updates->set_device_status(_updates_profile, false); } @@ -4342,15 +4342,23 @@ namespace rs2 bool sw_update_required = updates_profile.retrieve_updates(versions_db_manager::LIBREALSENSE); bool fw_update_required = updates_profile.retrieve_updates(versions_db_manager::FIRMWARE); + _updates_profile = updates_profile.get_update_profile(); + updates_model::update_profile_model updates_profile_model(_updates_profile, ctx, this); + if (sw_update_required || fw_update_required) { - _updates_profile = updates_profile.get_update_profile(); - updates_model::update_profile_model updates_profile_model(updates_profile.get_update_profile(), ctx, this); if (auto viewer_updates = updates_model_protected.lock()) { viewer_updates->add_profile(updates_profile_model); } } + else + { // For updating current device profile if exists (Could update firmware version) + if (auto viewer_updates = updates_model_protected.lock()) + { + viewer_updates->update_profile(updates_profile_model); + } + } } catch (const std::exception& e) { diff --git a/common/model-views.h b/common/model-views.h index 89b8bae37d..dd245dec28 100644 --- a/common/model-views.h +++ b/common/model-views.h @@ -233,7 +233,6 @@ namespace rs2 static const textual_icon camera { u8"\uf030" }; static const textual_icon video_camera { u8"\uf03d" }; static const textual_icon edit { u8"\uf044" }; - static const textual_icon check_square_o { u8"\uf046" }; static const textual_icon step_backward { u8"\uf048" }; static const textual_icon play { u8"\uf04b" }; static const textual_icon pause { u8"\uf04c" }; @@ -256,6 +255,7 @@ namespace rs2 static const textual_icon caret_down { u8"\uf0d7" }; static const textual_icon repeat { u8"\uf0e2" }; static const textual_icon circle { u8"\uf111" }; + static const textual_icon check_square_o { u8"\uf14a" }; static const textual_icon cubes { u8"\uf1b3" }; static const textual_icon toggle_off { u8"\uf204" }; static const textual_icon toggle_on { u8"\uf205" }; diff --git a/common/sw-update/dev-updates-profile.cpp b/common/sw-update/dev-updates-profile.cpp index 0086d8f9fe..dbb4f7e994 100644 --- a/common/sw-update/dev-updates-profile.cpp +++ b/common/sw-update/dev-updates-profile.cpp @@ -31,26 +31,30 @@ namespace rs2 { bool update_required(false); - std::map &versions_vec((comp == versions_db_manager::FIRMWARE)? - _update_profile.firmware_versions : _update_profile.software_versions); - - versions_db_manager::version ¤t_version((comp == versions_db_manager::FIRMWARE) ? _update_profile.firmware_version : _update_profile.software_version); + if (_update_profile.device_name.find("Recovery") == std::string::npos) { - update_description experimental_update; - if (try_parse_update(_versions_db, _update_profile.device_name, versions_db_manager::EXPERIMENTAL, comp, experimental_update)) - { - versions_vec[experimental_update.ver] = experimental_update; - } - update_description recommened_update; - if (try_parse_update(_versions_db, _update_profile.device_name, versions_db_manager::RECOMMENDED, comp, recommened_update)) - { - versions_vec[recommened_update.ver] = recommened_update; - } - update_description required_update; - if (try_parse_update(_versions_db, _update_profile.device_name, versions_db_manager::ESSENTIAL, comp, required_update)) + std::map &versions_vec((comp == versions_db_manager::FIRMWARE) ? + _update_profile.firmware_versions : _update_profile.software_versions); + + versions_db_manager::version ¤t_version((comp == versions_db_manager::FIRMWARE) ? _update_profile.firmware_version : _update_profile.software_version); { - versions_vec[required_update.ver] = required_update; - update_required = update_required || (current_version < required_update.ver); + update_description experimental_update; + if (try_parse_update(_versions_db, _update_profile.device_name, versions_db_manager::EXPERIMENTAL, comp, experimental_update)) + { + versions_vec[experimental_update.ver] = experimental_update; + } + update_description recommened_update; + if (try_parse_update(_versions_db, _update_profile.device_name, versions_db_manager::RECOMMENDED, comp, recommened_update)) + { + versions_vec[recommened_update.ver] = recommened_update; + } + update_description required_update; + if (try_parse_update(_versions_db, _update_profile.device_name, versions_db_manager::ESSENTIAL, comp, required_update)) + { + versions_vec[required_update.ver] = required_update; + // Ignore version zero as an indication of Recovery mode. + update_required = update_required || (current_version < required_update.ver); + } } } diff --git a/common/sw-update/dev-updates-profile.h b/common/sw-update/dev-updates-profile.h index 7965200ee1..1432c47df8 100644 --- a/common/sw-update/dev-updates-profile.h +++ b/common/sw-update/dev-updates-profile.h @@ -41,6 +41,10 @@ namespace rs2 std::map firmware_versions; device dev; + bool dev_active; + + update_profile() :dev_active(true){}; + }; explicit dev_updates_profile(const device& dev, const std::string &url, const bool use_url_as_local_path = false, http::user_callback_func_type download_callback = http::user_callback_func_type()); diff --git a/common/updates-model.cpp b/common/updates-model.cpp index a477c110e7..c0c5ca02d1 100644 --- a/common/updates-model.cpp +++ b/common/updates-model.cpp @@ -16,23 +16,12 @@ using namespace http; void updates_model::draw(ux_window& window, std::string& error_message) { // Protect resources - std::vector updates_copy; + static std::vector updates_copy; { std::lock_guard lock(_lock); updates_copy = _updates; } - // When devices model size changed reset inner variables. - static size_t prv_profiles_size(updates_copy.size()); - if (prv_profiles_size != updates_copy.size() && - _fw_update_state != fw_update_states::started) - { - _fw_update_state = fw_update_states::ready; - prv_profiles_size = updates_copy.size(); - emphasize_dismiss_text = false; - ignore = false; - } - // Prepare camera icon if (!_icon) { @@ -46,10 +35,13 @@ void updates_model::draw(ux_window& window, std::string& error_message) } const auto window_name = "Updates Window"; - + //Main window pop up only if essential updates exists - if (updates_copy.size() && !ignore) + if (!popup_opened && updates_copy.size() && !ignore) + { ImGui::OpenPopup(window_name); + popup_opened = true; + } position_params positions; @@ -71,17 +63,7 @@ void updates_model::draw(ux_window& window, std::string& error_message) if (ImGui::BeginPopupModal(window_name, nullptr, flags)) { - // End and close the pop up if no updates exists (Device removal) - if (updates_copy.size() == 0) - { - ImGui::CloseCurrentPopup(); - ImGui::EndPopup(); - ImGui::PopStyleColor(3); - ImGui::PopStyleVar(2); - std::lock_guard lock(_lock); - _updates.clear(); - return; - } + std::string title_message = "SOFTWARE UPDATES"; auto title_size = ImGui::CalcTextSize(title_message.c_str()); ImGui::SetCursorPosX(positions.w / 2 - title_size.x / 2); @@ -104,7 +86,7 @@ void updates_model::draw(ux_window& window, std::string& error_message) // Draw Left Pane // =========================================================================== - for (int i = 0; i < updates_copy.size(); i++) + for (int i = 0; i < static_cast(updates_copy.size()); i++) { auto& update = updates_copy[i]; @@ -145,17 +127,40 @@ void updates_model::draw(ux_window& window, std::string& error_message) auto& update = updates_copy[selected_index]; - // =========================================================================== - // Draw Software update Pane - // =========================================================================== - auto sw_update_needed = draw_software_section(window_name, update, positions, window); + bool sw_update_needed(false), fw_update_needed(false); - // =========================================================================== - // Draw Firmware update Pane - // =========================================================================== - auto fw_update_needed = draw_firmware_section(window_name, update, positions, window); + // Verify Device Exists + if (update.profile.dev_active || _fw_update_state == fw_update_states::started) + { + // =========================================================================== + // Draw Software update Pane + // =========================================================================== + sw_update_needed = draw_software_section(window_name, update, positions, window); + + // =========================================================================== + // Draw Firmware update Pane + // =========================================================================== + fw_update_needed = draw_firmware_section(window_name, update, positions, window); + } + else + { + ImGui::PushFont(window.get_large_font()); + ImGui::PushStyleColor(ImGuiCol_Text, white); + ImGui::SetCursorPos({ positions.orig_pos.x, positions.y0 - 100 }); + ImGui::SetWindowFontScale(1.5); + ImGui::Text("%s","THE DEVICE HAS BEEN DISCONNECTED,"); + ImGui::SetCursorPos({ positions.orig_pos.x - 100, positions.y0 - 70 }); + ImGui::Text("%s", "PLEASE RECONNECT IT OR CLOSE THE UPDATES WINDOW."); + ImGui::PopFont(); + ImGui::SetCursorPos({ positions.orig_pos.x + 230, positions.y0 }); + ImGui::SetWindowFontScale(3.); + ImGui::Text(textual_icons::lock); + ImGui::SetWindowFontScale(1.); + ImGui::PopStyleColor(); + + } // =========================================================================== // Draw Lower Pane // =========================================================================== @@ -183,16 +188,36 @@ void updates_model::draw(ux_window& window, std::string& error_message) auto enabled = ignore || no_update_needed; if (enabled) { - if (ImGui::Button("Close", { 120, 20 })) + if (_fw_update_state != fw_update_states::started) + { + if (ImGui::Button("Close", { 120, 20 })) + { + { + std::lock_guard lock(_lock); + _updates.clear(); + } + + ImGui::CloseCurrentPopup(); + popup_opened = false; + emphasize_dismiss_text = false; + ignore = false; + _fw_update_state = fw_update_states::ready; + ignore = false; + _fw_download_progress = 0; + } + } + else { - ImGui::CloseCurrentPopup(); - std::lock_guard lock(_lock); - _updates.clear(); - ignore = false; + ImGui::PushStyleColor(ImGuiCol_Button, sensor_bg); + ImGui::Button("Close", { 120, 20 }); + ImGui::PopStyleColor(); } } else { + ImGui::PushStyleColor(ImGuiCol_Button, sensor_bg); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, sensor_bg); + if (ImGui::Button("Close", { 120, 20 })) { emphasize_dismiss_text = true; @@ -201,15 +226,15 @@ void updates_model::draw(ux_window& window, std::string& error_message) { ImGui::SetTooltip("To close this window you must install all essential update\n" "or agree to the warning of closing without it"); - window.link_hovered(); + } + ImGui::PopStyleColor(2); } ImGui::EndPopup(); } ImGui::PopStyleColor(3); ImGui::PopStyleVar(2); - } bool updates_model::draw_software_section(const char * window_name, update_profile_model& selected_profile, position_params& pos, ux_window& window) @@ -225,17 +250,48 @@ bool updates_model::draw_software_section(const char * window_name, update_profi std::sort(software_updates.begin(), software_updates.end(), [](dev_updates_profile::update_description& a, dev_updates_profile::update_description& b) { return a.ver < b.ver; }); - if (software_updates.size() <= selected_software_update_index) selected_software_update_index = 0; + if (static_cast(software_updates.size()) <= selected_software_update_index) selected_software_update_index = 0; dev_updates_profile::update_description selected_software_update; if (software_updates.size() != 0) { - bool essential_found = software_updates[0].name.find("ESSENTIAL") != std::string::npos; - essential_sw_update_needed = essential_found && (selected_profile.profile.software_version < software_updates[0].ver); + bool essential_found(false); + bool recommended_found(false); + for (auto sw_update : software_updates) + { + if (!essential_found) + { + essential_found = essential_found || sw_update.name.find("ESSENTIAL") != std::string::npos; + essential_sw_update_needed = essential_sw_update_needed || essential_found && (selected_profile.profile.software_version < sw_update.ver); + } + + if (!recommended_found) + { + recommended_found = recommended_found || sw_update.name.find("RECOMMENDED") != std::string::npos; + recommended_sw_update_needed = recommended_sw_update_needed || recommended_found && (selected_profile.profile.software_version < sw_update.ver); + } + } - bool recommended_found = software_updates[0].name.find("RECOMMENDED") != std::string::npos; - recommended_sw_update_needed = recommended_found && (selected_profile.profile.software_version < software_updates[0].ver); + // If essential update found on DB but not needed - Remove it + if (essential_found && !essential_sw_update_needed) + { + auto it = std::find_if(software_updates.begin(), software_updates.end(), [&](dev_updates_profile::update_description& u) { + return (u.name.find("ESSENTIAL") != std::string::npos); + }); + if (it != software_updates.end()) + software_updates.erase(it); + } + // If recommended update found on DB but not needed - Remove it + if (recommended_found && !recommended_sw_update_needed) + { + auto it = std::find_if(software_updates.begin(), software_updates.end(), [&](dev_updates_profile::update_description& u) { + return (u.name.find("RECOMMENDED") != std::string::npos); + }); + if (it != software_updates.end()) + software_updates.erase(it); + } + if (essential_sw_update_needed || recommended_sw_update_needed) { selected_software_update = software_updates[selected_software_update_index]; @@ -260,8 +316,10 @@ bool updates_model::draw_software_section(const char * window_name, update_profi } else { - ImGui::PushStyleColor(ImGuiCol_Text, white); - ImGui::Text(u8"\uF046 Up to date."); + ImGui::PushStyleColor(ImGuiCol_Text, light_blue); + ImGui::Text(textual_icons::check_square_o); + ImGui::SameLine(); + ImGui::Text("%s", "Up to date."); } ImGui::PopStyleColor(); } @@ -430,7 +488,7 @@ bool updates_model::draw_software_section(const char * window_name, update_profi } ImGui::PopStyleColor(3); - ImGui::SetCursorScreenPos({ pos.orig_pos.x + 150, pos.mid_y - 25 }); + ImGui::SetCursorScreenPos({ pos.orig_pos.x + 150, pos.mid_y - 25 }); ImGui::Text("%s", "Visit the release page before download to identify the most suitable package."); } @@ -451,18 +509,49 @@ bool updates_model::draw_firmware_section(const char * window_name, update_profi std::sort(firmware_updates.begin(), firmware_updates.end(), [](dev_updates_profile::update_description& a, dev_updates_profile::update_description& b) { return a.ver < b.ver; }); - if (firmware_updates.size() <= selected_firmware_update_index) selected_firmware_update_index = 0; + if (static_cast(firmware_updates.size()) <= selected_firmware_update_index) selected_firmware_update_index = 0; dev_updates_profile::update_description selected_firmware_update; if (firmware_updates.size() != 0) { - bool essential_found = firmware_updates[0].name.find("ESSENTIAL") != std::string::npos; - essential_fw_update_needed = essential_found && (selected_profile.profile.firmware_version < firmware_updates[0].ver); + bool essential_found(false); + bool recommended_found(false); - bool recommended_found = firmware_updates[0].name.find("RECOMMENDED") != std::string::npos; - recommended_fw_update_needed = recommended_found && (selected_profile.profile.firmware_version < firmware_updates[0].ver); + for (auto fw_update : firmware_updates) + { + if (!essential_found) + { + essential_found = essential_found || fw_update.name.find("ESSENTIAL") != std::string::npos; + essential_fw_update_needed = essential_fw_update_needed || essential_found && (selected_profile.profile.firmware_version < fw_update.ver); + } + if (!recommended_found) + { + recommended_found = recommended_found || fw_update.name.find("RECOMMENDED") != std::string::npos; + recommended_fw_update_needed = recommended_fw_update_needed || recommended_found && (selected_profile.profile.firmware_version < fw_update.ver); + } + } + + // If essential update found on DB but not needed - Remove it + if (essential_found && !essential_fw_update_needed) + { + auto it = std::find_if(firmware_updates.begin(), firmware_updates.end(), [&](dev_updates_profile::update_description& u) { + return (u.name.find("ESSENTIAL") != std::string::npos); + }); + if (it != firmware_updates.end()) + firmware_updates.erase(it); + } + + // If recommended update found on DB but not needed - Remove it + if (recommended_found && !recommended_fw_update_needed) + { + auto it = std::find_if(firmware_updates.begin(), firmware_updates.end(), [&](dev_updates_profile::update_description& u) { + return (u.name.find("RECOMMENDED") != std::string::npos); + }); + if (it != firmware_updates.end()) + firmware_updates.erase(it); + } if (essential_fw_update_needed || recommended_fw_update_needed) { selected_firmware_update = firmware_updates[selected_firmware_update_index]; @@ -487,8 +576,10 @@ bool updates_model::draw_firmware_section(const char * window_name, update_profi } else { - ImGui::PushStyleColor(ImGuiCol_Text, white); - ImGui::Text(u8"\uF046 Up to date."); + ImGui::PushStyleColor(ImGuiCol_Text, light_blue); + ImGui::Text(textual_icons::check_square_o); + ImGui::SameLine(); + ImGui::Text("%s", "Up to date."); } ImGui::PopStyleColor(); } @@ -509,7 +600,7 @@ bool updates_model::draw_firmware_section(const char * window_name, update_profi ImGui::Text("%s", "Content:"); ImGui::SameLine(); ImGui::PopStyleColor(); ImGui::Text("%s", "Signed Firmware Image (.bin file)"); - + fw_text_pos.y += 50; ImGui::SetCursorScreenPos(fw_text_pos); ImGui::PushStyleColor(ImGuiCol_Text, white); @@ -519,202 +610,199 @@ bool updates_model::draw_firmware_section(const char * window_name, update_profi auto current_fw_ver_str = std::string(selected_profile.profile.firmware_version); ImGui::Text("%s", current_fw_ver_str.c_str()); - if (essential_fw_update_needed) - { - ImGui::SameLine(); - ImGui::PushStyleColor(ImGuiCol_Text, yellowish); - ImGui::Text("%s", " (Your version is older than the minimum version required for the proper functioning of your device)"); - ImGui::PopStyleColor(); - } - - if (selected_firmware_update.ver != versions_db_manager::version(0)) + if (_fw_update_state != fw_update_states::completed) { - fw_text_pos.y += 25; - ImGui::SetCursorScreenPos(fw_text_pos); - ImGui::PushStyleColor(ImGuiCol_Text, white); - - ImGui::Text("%s", (firmware_updates.size() >= 2) ? - "Versions available:" : - "Version to download:"); - ImGui::SameLine(); - ImGui::PopStyleColor(); - // Combo box for multiple versions - if (firmware_updates.size() >= 2) + if (essential_fw_update_needed) { - std::vector fwu_labels; - for (auto&& fwu : firmware_updates) - { - fwu_labels.push_back(fwu.name.c_str()); - } - - ImGui::PushStyleColor(ImGuiCol_BorderShadow, dark_grey); - ImGui::PushStyleColor(ImGuiCol_FrameBg, sensor_bg); - - std::string combo_id = "##Firmware Update Version"; - ImGui::PushItemWidth(200); - ImGui::SetCursorPosY(ImGui::GetCursorPosY() - 3); - ImGui::Combo(combo_id.c_str(), &selected_firmware_update_index, fwu_labels.data(), static_cast(fwu_labels.size())); - ImGui::PopItemWidth(); - ImGui::PopStyleColor(2); - ImGui::SetWindowFontScale(1.); - } - else - { // Single version - ImGui::Text("%s", std::string(selected_firmware_update.ver).c_str()); + ImGui::SameLine(); + ImGui::PushStyleColor(ImGuiCol_Text, yellowish); + ImGui::Text("%s", " (Your version is older than the minimum version required for the proper functioning of your device)"); + ImGui::PopStyleColor(); } - } - if (selected_firmware_update.release_page != "") - { - fw_text_pos.y += 25; - ImGui::SetCursorScreenPos(fw_text_pos); - ImGui::PushStyleColor(ImGuiCol_Text, white); - ImGui::Text("%s", "Release Link:"); ImGui::SameLine(); - ImGui::PopStyleColor(); - ImGui::PushStyleColor(ImGuiCol_Text, light_grey); - ImGui::Text("%s", selected_firmware_update.release_page.c_str()); + if (selected_firmware_update.ver != versions_db_manager::version(0)) + { + fw_text_pos.y += 25; + ImGui::SetCursorScreenPos(fw_text_pos); + ImGui::PushStyleColor(ImGuiCol_Text, white); - ImGui::SameLine(); - auto underline_start = ImVec2(ImGui::GetCursorScreenPos().x - (ImGui::CalcTextSize(selected_firmware_update.release_page.c_str()).x + 8), ImGui::GetCursorScreenPos().y + ImGui::GetFontSize()); - auto underline_end = ImVec2(ImGui::GetCursorScreenPos().x - 8, ImGui::GetCursorScreenPos().y + ImGui::GetFontSize()); - ImGui::GetWindowDrawList()->AddLine(underline_start, underline_end, ImColor(light_grey)); + ImGui::Text("%s", (firmware_updates.size() >= 2) ? + "Versions available:" : + "Version to download:"); + ImGui::SameLine(); + ImGui::PopStyleColor(); + // Combo box for multiple versions + if (firmware_updates.size() >= 2) + { + std::vector fwu_labels; + for (auto&& fwu : firmware_updates) + { + fwu_labels.push_back(fwu.name.c_str()); + } + ImGui::PushStyleColor(ImGuiCol_BorderShadow, dark_grey); + ImGui::PushStyleColor(ImGuiCol_FrameBg, sensor_bg); - ImGui::PopStyleColor(); - if (ImGui::IsItemHovered()) - window.link_hovered(); - if (ImGui::IsItemClicked()) - { - try - { - open_url(selected_firmware_update.release_page.c_str()); + std::string combo_id = "##Firmware Update Version"; + ImGui::PushItemWidth(200); + ImGui::SetCursorPosY(ImGui::GetCursorPosY() - 3); + ImGui::Combo(combo_id.c_str(), &selected_firmware_update_index, fwu_labels.data(), static_cast(fwu_labels.size())); + ImGui::PopItemWidth(); + ImGui::PopStyleColor(2); + ImGui::SetWindowFontScale(1.); } - catch (...) - { - LOG_ERROR("Error opening URL: " + selected_firmware_update.release_page); + else + { // Single version + ImGui::Text("%s", std::string(selected_firmware_update.ver).c_str()); } } - } - if (selected_firmware_update.description != "") - { - fw_text_pos.y += 25; - ImGui::SetCursorScreenPos(fw_text_pos); - ImGui::PushStyleColor(ImGuiCol_Text, white); - ImGui::Text("%s", "Description:"); - ImGui::PopStyleColor(); - - ImGui::PushTextWrapPos(pos.w - 150); - ImGui::PushStyleColor(ImGuiCol_Border, transparent); - ImGui::PushStyleColor(ImGuiCol_FrameBg, transparent); - ImGui::PushStyleColor(ImGuiCol_ScrollbarBg, transparent); - ImGui::PushStyleColor(ImGuiCol_ScrollbarGrab, transparent); - ImGui::PushStyleColor(ImGuiCol_ScrollbarGrabActive, transparent); - ImGui::PushStyleColor(ImGuiCol_ScrollbarGrabHovered, transparent); - ImGui::PushStyleColor(ImGuiCol_TextSelectedBg, regular_blue); - auto msg = selected_firmware_update.description.c_str(); - fw_text_pos.x -= 4; - fw_text_pos.y += 15; - ImGui::SetCursorScreenPos(fw_text_pos); - ImGui::InputTextMultiline("##Firmware Update Description", const_cast(msg), - strlen(msg) + 1, ImVec2(ImGui::GetContentRegionAvailWidth() - 150, 75), - ImGuiInputTextFlags_ReadOnly); - ImGui::PopStyleColor(7); - ImGui::PopTextWrapPos(); - } + if (selected_firmware_update.release_page != "") + { + fw_text_pos.y += 25; + ImGui::SetCursorScreenPos(fw_text_pos); + ImGui::PushStyleColor(ImGuiCol_Text, white); + ImGui::Text("%s", "Release Link:"); ImGui::SameLine(); + ImGui::PopStyleColor(); + ImGui::PushStyleColor(ImGuiCol_Text, light_grey); + ImGui::Text("%s", selected_firmware_update.release_page.c_str()); + ImGui::SameLine(); + auto underline_start = ImVec2(ImGui::GetCursorScreenPos().x - (ImGui::CalcTextSize(selected_firmware_update.release_page.c_str()).x + 8), ImGui::GetCursorScreenPos().y + ImGui::GetFontSize()); + auto underline_end = ImVec2(ImGui::GetCursorScreenPos().x - 8, ImGui::GetCursorScreenPos().y + ImGui::GetFontSize()); + ImGui::GetWindowDrawList()->AddLine(underline_start, underline_end, ImColor(light_grey)); - if (_fw_update_state == fw_update_states::ready && - (essential_fw_update_needed || recommended_fw_update_needed)) - { - ImGui::SetCursorScreenPos({ pos.orig_pos.x + pos.w - 150, pos.orig_pos.y + pos.h - 115 }); - ImGui::PushStyleColor(ImGuiCol_Text, white); - ImGui::PushStyleColor(ImGuiCol_Button, sensor_bg); - if (ImGui::Button("Download &\n Install", ImVec2(120, 40)) || _retry) - { - _retry = false; - auto link = selected_firmware_update.download_link; - std::thread download_thread([link, this]() { - std::vector vec; - http_downloader client; - - if (!client.download_to_bytes_vector(link, vec, - [this](uint64_t dl_current_bytes, uint64_t dl_total_bytes) -> callback_result { - _fw_download_progress = static_cast((dl_current_bytes * 100) / dl_total_bytes); - return callback_result::CONTINUE_DOWNLOAD; - })) + ImGui::PopStyleColor(); + if (ImGui::IsItemHovered()) + window.link_hovered(); + if (ImGui::IsItemClicked()) + { + try { - _fw_update_state = fw_update_states::failed_downloading; - LOG_ERROR("Error in download firmware version from: " + link); + open_url(selected_firmware_update.release_page.c_str()); } + catch (...) + { + LOG_ERROR("Error opening URL: " + selected_firmware_update.release_page); + } + } + } - _fw_image = vec; - - _fw_download_progress = 100; - }); - download_thread.detach(); + if (selected_firmware_update.description != "") + { + fw_text_pos.y += 25; + ImGui::SetCursorScreenPos(fw_text_pos); + ImGui::PushStyleColor(ImGuiCol_Text, white); + ImGui::Text("%s", "Description:"); + ImGui::PopStyleColor(); - _fw_update_state = fw_update_states::downloading; + ImGui::PushTextWrapPos(pos.w - 150); + ImGui::PushStyleColor(ImGuiCol_Border, transparent); + ImGui::PushStyleColor(ImGuiCol_FrameBg, transparent); + ImGui::PushStyleColor(ImGuiCol_ScrollbarBg, transparent); + ImGui::PushStyleColor(ImGuiCol_ScrollbarGrab, transparent); + ImGui::PushStyleColor(ImGuiCol_ScrollbarGrabActive, transparent); + ImGui::PushStyleColor(ImGuiCol_ScrollbarGrabHovered, transparent); + ImGui::PushStyleColor(ImGuiCol_TextSelectedBg, regular_blue); + auto msg = selected_firmware_update.description.c_str(); + fw_text_pos.x -= 4; + fw_text_pos.y += 15; + ImGui::SetCursorScreenPos(fw_text_pos); + ImGui::InputTextMultiline("##Firmware Update Description", const_cast(msg), + strlen(msg) + 1, ImVec2(ImGui::GetContentRegionAvailWidth() - 150, 75), + ImGuiInputTextFlags_ReadOnly); + ImGui::PopStyleColor(7); + ImGui::PopTextWrapPos(); } - if (ImGui::IsItemHovered()) + + + if ((_fw_update_state == fw_update_states::ready) && + (essential_fw_update_needed || recommended_fw_update_needed)) { - ImGui::SetTooltip("This will download selected firmware and install it to the device"); - window.link_hovered(); + ImGui::SetCursorScreenPos({ pos.orig_pos.x + pos.w - 150, pos.orig_pos.y + pos.h - 115 }); + ImGui::PushStyleColor(ImGuiCol_Text, white); + ImGui::PushStyleColor(ImGuiCol_Button, sensor_bg); + + if (ImGui::Button("Download &\n Install", ImVec2(120, 40)) || _retry) + { + _retry = false; + auto link = selected_firmware_update.download_link; + std::thread download_thread([link, this]() { + std::vector vec; + http_downloader client; + + if (!client.download_to_bytes_vector(link, vec, + [this](uint64_t dl_current_bytes, uint64_t dl_total_bytes) -> callback_result { + _fw_download_progress = static_cast((dl_current_bytes * 100) / dl_total_bytes); + return callback_result::CONTINUE_DOWNLOAD; + })) + { + _fw_update_state = fw_update_states::failed_downloading; + LOG_ERROR("Error in download firmware version from: " + link); + } + + _fw_image = vec; + + _fw_download_progress = 100; + }); + download_thread.detach(); + + _fw_update_state = fw_update_states::downloading; + } + if (ImGui::IsItemHovered()) + { + ImGui::SetTooltip("This will download selected firmware and install it to the device"); + window.link_hovered(); + } + ImGui::PopStyleColor(2); } - ImGui::PopStyleColor(2); - } - else if (_fw_update_state == fw_update_states::downloading) - { - ImGui::SetCursorScreenPos({ pos.orig_pos.x + 150, pos.orig_pos.y + pos.h - 95 }); - _progress.draw(window, static_cast(pos.w) - 170, _fw_download_progress / 3); - if (_fw_download_progress == 100) + else if (_fw_update_state == fw_update_states::downloading) { - _fw_update_state = fw_update_states::started; - - _update_manager = std::make_shared( - *selected_profile.dev_model, selected_profile.profile.dev, selected_profile.ctx, _fw_image, true - ); - auto invoke = [](std::function action) { action(); }; - _update_manager->start(invoke); - // update.dev = rs2::device{}; - // update.dev_model->dev = rs2::device{}; - } - } - else if (_fw_update_state == fw_update_states::started) - { - ImGui::SetCursorScreenPos({ pos.orig_pos.x + 150, pos.orig_pos.y + pos.h - 95 }); - _progress.draw(window, static_cast(pos.w) - 170, static_cast(_update_manager->get_progress() * 0.66 + 33)); - if (_update_manager->done()) { - _fw_update_state = fw_update_states::completed; - } + ImGui::SetCursorScreenPos({ pos.orig_pos.x + 150, pos.orig_pos.y + pos.h - 95 }); + _progress.draw(window, static_cast(pos.w) - 170, _fw_download_progress / 3); + if (_fw_download_progress == 100) + { + _fw_update_state = fw_update_states::started; - if (_update_manager->failed()) { - _fw_update_state = fw_update_states::failed_updating; - ImGui::CloseCurrentPopup(); + _update_manager = std::make_shared( + *selected_profile.dev_model, selected_profile.profile.dev, selected_profile.ctx, _fw_image, true + ); + auto invoke = [](std::function action) { action(); }; + _update_manager->start(invoke); + } } + else if (_fw_update_state == fw_update_states::started) + { + ImGui::SetCursorScreenPos({ pos.orig_pos.x + 150, pos.orig_pos.y + pos.h - 95 }); + _progress.draw(window, static_cast(pos.w) - 170, static_cast(_update_manager->get_progress() * 0.66 + 33)); + if (_update_manager->done()) { + _fw_update_state = fw_update_states::completed; + _fw_image.clear(); + } - } - else if (_fw_update_state == fw_update_states::completed) - { - _fw_update_state = fw_update_states::ready; - ImGui::SetCursorScreenPos({ pos.orig_pos.x + 150, pos.orig_pos.y + pos.h - 95 }); - //_progress.draw(window, w - 170, 100); - } - else if (_fw_update_state == fw_update_states::failed_downloading || - _fw_update_state == fw_update_states::failed_updating) - { - ImGui::SetCursorScreenPos({ pos.orig_pos.x + 150, pos.orig_pos.y + pos.h - 95 }); - ImGui::PushStyleColor(ImGuiCol_Text, white); - std::string text = _fw_update_state == fw_update_states::failed_downloading ? - "Firmware download failed, check connection and press to retry" : - "Firmware update process failed, press to retry"; - if (ImGui::Button(text.c_str(), ImVec2(pos.w - 170, 25))) + if (_update_manager->failed()) { + _fw_update_state = fw_update_states::failed_updating; + _fw_image.clear(); + _fw_download_progress = 0; + } + + } + else if (_fw_update_state == fw_update_states::failed_downloading || + _fw_update_state == fw_update_states::failed_updating) { - _fw_update_state = fw_update_states::ready; - _retry = true; + ImGui::SetCursorScreenPos({ pos.orig_pos.x + 150, pos.orig_pos.y + pos.h - 95 }); + ImGui::PushStyleColor(ImGuiCol_Text, white); + std::string text = _fw_update_state == fw_update_states::failed_downloading ? + "Firmware download failed, check connection and press to retry" : + "Firmware update process failed, press to retry"; + if (ImGui::Button(text.c_str(), ImVec2(pos.w - 170, 25))) + { + _fw_update_state = fw_update_states::ready; + _retry = true; + } + ImGui::PopStyleColor(); } - ImGui::PopStyleColor(); } ImGui::PopStyleColor(); diff --git a/common/updates-model.h b/common/updates-model.h index 4a832ffb68..714d019206 100644 --- a/common/updates-model.h +++ b/common/updates-model.h @@ -35,6 +35,22 @@ namespace rs2 }); if (it == _updates.end()) _updates.push_back(update); + else + { + *it = update; + } + } + + void update_profile(const update_profile_model& update) + { + std::lock_guard lock(_lock); + auto it = std::find_if(_updates.begin(), _updates.end(), [&](update_profile_model& p) { + return (p.profile.device_name == update.profile.device_name && p.profile.serial_number == update.profile.serial_number); + }); + if (it != _updates.end()) + { + *it = update; + } } void remove_profile(const sw_update::dev_updates_profile::update_profile &update) { @@ -46,6 +62,19 @@ namespace rs2 _updates.erase(it); } + // This is a helper function to indicate if a device is connected or not. + // It change its value on device connect/disconnect + // cause calling ctx.query_devices() is too slow for the UI + void set_device_status(const sw_update::dev_updates_profile::update_profile &update, bool active) + { + std::lock_guard lock(_lock); + auto it = std::find_if(_updates.begin(), _updates.end(), [&](update_profile_model& p) { + return (p.profile.device_name == update.device_name && p.profile.serial_number == update.serial_number); + }); + if (it != _updates.end()) + it->profile.dev_active = active; + } + void draw(ux_window& window, std::string& error_message); private: struct position_params @@ -71,6 +100,7 @@ namespace rs2 std::shared_ptr _icon = nullptr; std::mutex _lock; bool emphasize_dismiss_text = false; + bool popup_opened = false; std::shared_ptr _fw_update = nullptr; From 2680b04a0f6747aab2b2ce927405ec59c843ffeb Mon Sep 17 00:00:00 2001 From: NirAz Date: Tue, 9 Jun 2020 09:01:26 +0300 Subject: [PATCH 09/10] SW-Update - Fix debian build errors --- common/sw-update/versions-db-manager.cpp | 2 +- common/updates-model.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/sw-update/versions-db-manager.cpp b/common/sw-update/versions-db-manager.cpp index f8392697e2..523de59348 100644 --- a/common/sw-update/versions-db-manager.cpp +++ b/common/sw-update/versions-db-manager.cpp @@ -18,7 +18,7 @@ namespace rs2 using namespace http; // Get current platform - constexpr char* PLATFORM = + constexpr const char* PLATFORM = #ifdef _WIN64 "Windows amd64"; diff --git a/common/updates-model.cpp b/common/updates-model.cpp index c0c5ca02d1..094a71d474 100644 --- a/common/updates-model.cpp +++ b/common/updates-model.cpp @@ -155,7 +155,7 @@ void updates_model::draw(ux_window& window, std::string& error_message) ImGui::PopFont(); ImGui::SetCursorPos({ positions.orig_pos.x + 230, positions.y0 }); ImGui::SetWindowFontScale(3.); - ImGui::Text(textual_icons::lock); + ImGui::Text("%s", static_cast(textual_icons::lock)); ImGui::SetWindowFontScale(1.); ImGui::PopStyleColor(); @@ -317,7 +317,7 @@ bool updates_model::draw_software_section(const char * window_name, update_profi else { ImGui::PushStyleColor(ImGuiCol_Text, light_blue); - ImGui::Text(textual_icons::check_square_o); + ImGui::Text("%s", static_cast(textual_icons::check_square_o)); ImGui::SameLine(); ImGui::Text("%s", "Up to date."); } @@ -577,7 +577,7 @@ bool updates_model::draw_firmware_section(const char * window_name, update_profi else { ImGui::PushStyleColor(ImGuiCol_Text, light_blue); - ImGui::Text(textual_icons::check_square_o); + ImGui::Text("%s", static_cast(textual_icons::check_square_o)); ImGui::SameLine(); ImGui::Text("%s", "Up to date."); } From 141166e9e2310d7887d44e759c71b45c0a2c7d07 Mon Sep 17 00:00:00 2001 From: ev-mp Date: Tue, 9 Jun 2020 10:18:13 +0300 Subject: [PATCH 10/10] Revert "L515 motion correction 2" --- src/ds5/ds5-motion.cpp | 32 ++++++++---------- src/ds5/ds5-motion.h | 62 +++-------------------------------- src/ds5/ds5-options.h | 20 +++++++++++ src/ds5/ds5-private.h | 3 +- src/l500/l500-motion.cpp | 57 ++------------------------------ src/l500/l500-motion.h | 9 ----- src/l500/l500-private.h | 1 - src/option.h | 20 ----------- src/proc/motion-transform.cpp | 1 + 9 files changed, 42 insertions(+), 163 deletions(-) diff --git a/src/ds5/ds5-motion.cpp b/src/ds5/ds5-motion.cpp index 7d6d4c2efe..96fca6e417 100644 --- a/src/ds5/ds5-motion.cpp +++ b/src/ds5/ds5-motion.cpp @@ -311,14 +311,6 @@ namespace librealsense return auto_exposure; } - std::vector ds5_motion::get_imu_eeprom_raw() const - { - const int offset = 0; - const int size = ds::eeprom_imu_table_size; - command cmd(ds::MMER, offset, size); - return _hw_monitor->send(cmd); - } - ds5_motion::ds5_motion(std::shared_ptr ctx, const platform::backend_device_group& group) : device(ctx, group), ds5_device(ctx, group), @@ -328,9 +320,7 @@ namespace librealsense { using namespace ds; - _imu_eeprom_raw = [this]() { return get_imu_eeprom_raw(); }; - - _mm_calib = std::make_shared(*_imu_eeprom_raw,_device_capabilities); + _mm_calib = std::make_shared(_hw_monitor,_device_capabilities); _accel_intrinsic = std::make_shared>([this]() { return _mm_calib->get_intrinsic(RS2_STREAM_ACCEL); }); _gyro_intrinsic = std::make_shared>([this]() { return _mm_calib->get_intrinsic(RS2_STREAM_GYRO); }); @@ -451,10 +441,10 @@ namespace librealsense _fisheye_device_idx = add_sensor(fisheye_ep); } - mm_calib_handler::mm_calib_handler(std::vector imu_raw, ds::d400_caps dev_cap) : - _dev_cap(dev_cap) + mm_calib_handler::mm_calib_handler(std::shared_ptr hw_monitor, ds::d400_caps dev_cap) : + _hw_monitor(hw_monitor), _dev_cap(dev_cap) { - _imu_eeprom_raw = imu_raw; + _imu_eeprom_raw = [this]() { return get_imu_eeprom_raw(); }; _calib_parser = [this]() { @@ -464,7 +454,7 @@ namespace librealsense try { - raw = _imu_eeprom_raw; + raw = *_imu_eeprom_raw; calib_id = *reinterpret_cast(raw.data()); valid = true; } @@ -480,8 +470,6 @@ namespace librealsense prs = std::make_shared(raw, _dev_cap, valid); break; case ds::tm1_eeprom_id: // TM1 id prs = std::make_shared(raw); break; - case ds::l500_eeprom_id: // L515 - prs = std::make_shared(raw); break; default: throw recoverable_exception(to_string() << "Motion Intrinsics unresolved - " << ((valid)? "device is not calibrated" : "invalid calib type "), @@ -491,6 +479,14 @@ namespace librealsense }; } + std::vector mm_calib_handler::get_imu_eeprom_raw() const + { + const int offset = 0; + const int size = ds::eeprom_imu_table_size; + command cmd(ds::MMER, offset, size); + return _hw_monitor->send(cmd); + } + ds::imu_intrinsic mm_calib_handler::get_intrinsic(rs2_stream stream) { return (*_calib_parser)->get_intrinsic(stream); @@ -503,7 +499,7 @@ namespace librealsense const std::vector mm_calib_handler::get_fisheye_calib_raw() { - auto fe_calib_table = (*(ds::check_calib(_imu_eeprom_raw))).calibration_table.calib_model.fe_calibration; + auto fe_calib_table = (*(ds::check_calib(*_imu_eeprom_raw))).calibration_table.calib_model.fe_calibration; uint8_t* fe_calib_ptr = reinterpret_cast(&fe_calib_table); return std::vector(fe_calib_ptr, fe_calib_ptr+ ds::fisheye_calibration_table_size); } diff --git a/src/ds5/ds5-motion.h b/src/ds5/ds5-motion.h index 77a45bc90f..dc767def47 100644 --- a/src/ds5/ds5-motion.h +++ b/src/ds5/ds5-motion.h @@ -193,63 +193,10 @@ namespace librealsense float3x3 _imu_2_depth_rot; }; - class l500_imu_calib_parser : public mm_calib_parser - { - public: - l500_imu_calib_parser(const std::vector& raw_data) - { - imu_calib_table = *(ds::check_calib(raw_data)); - - // TODO - need to check mechanical drawing for extrinsic and orientation - // Bosch BMI055 - // L515 specific - BMI055 assembly transformation based on mechanical drawing (mm) - _def_extr = { { 1, 0, 0, 0, 1, 0, 0, 0, 1 },{ -0.01245f, 0.01642f, 0.02093f } }; - _imu_2_depth_rot = { { 1,0,0 },{ 0,1,0 },{ 0,0,1 } }; - } - - virtual ~l500_imu_calib_parser() {} - - float3x3 imu_to_depth_alignment() { return _imu_2_depth_rot; } - - ds::imu_intrinsic get_intrinsic(rs2_stream stream) - { - ds::dm_v2_imu_intrinsic in_intr; - switch (stream) - { - case RS2_STREAM_ACCEL: - in_intr = imu_calib_table.accel_intrinsic; break; - case RS2_STREAM_GYRO: - in_intr = imu_calib_table.gyro_intrinsic; - in_intr.bias = in_intr.bias * static_cast(d2r); // The gyro bias is calculated in Deg/sec - break; - default: - throw std::runtime_error(to_string() << "L515 does not provide intrinsic for stream type : " << rs2_stream_to_string(stream) << " !"); - } - - return{ in_intr.sensitivity, in_intr.bias,{ 0,0,0 },{ 0,0,0 } }; - } - - rs2_extrinsics get_extrinsic_to(rs2_stream stream) - { - if (!(RS2_STREAM_ACCEL == stream) && !(RS2_STREAM_GYRO == stream)) - throw std::runtime_error(to_string() << "L515 does not support extrinsic for : " << rs2_stream_to_string(stream) << " !"); - - rs2_extrinsics extr; - LOG_INFO("IMU extrinsic using CAD values"); - extr = _def_extr; - return extr; - } - - private: - ds::dm_v2_calibration_table imu_calib_table; - rs2_extrinsics _def_extr; - float3x3 _imu_2_depth_rot; - }; - class mm_calib_handler { public: - mm_calib_handler(std::vector imu_raw, ds::d400_caps dev_cap = ds::d400_caps::CAP_UNDEFINED); + mm_calib_handler(std::shared_ptr hw_monitor, ds::d400_caps dev_cap); ~mm_calib_handler() {} ds::imu_intrinsic get_intrinsic(rs2_stream); @@ -258,9 +205,11 @@ namespace librealsense float3x3 imu_to_depth_alignment() { return (*_calib_parser)->imu_to_depth_alignment(); } private: + std::shared_ptr _hw_monitor; ds::d400_caps _dev_cap; lazy< std::shared_ptr> _calib_parser; - std::vector _imu_eeprom_raw; + lazy> _imu_eeprom_raw; + std::vector get_imu_eeprom_raw() const; lazy> _fisheye_calibration_table_raw; }; @@ -289,9 +238,6 @@ namespace librealsense optional_value _fisheye_device_idx; optional_value _motion_module_device_idx; - std::vector get_imu_eeprom_raw() const; - lazy> _imu_eeprom_raw; - std::shared_ptr _mm_calib; std::shared_ptr> _accel_intrinsic; std::shared_ptr> _gyro_intrinsic; diff --git a/src/ds5/ds5-options.h b/src/ds5/ds5-options.h index 6325e7f9a2..6cd0e815d6 100644 --- a/src/ds5/ds5-options.h +++ b/src/ds5/ds5-options.h @@ -54,6 +54,26 @@ namespace librealsense hid_sensor& _ep; }; + class enable_motion_correction : public option_base + { + public: + void set(float value) override; + + float query() const override; + + bool is_enabled() const override { return true; } + + const char* get_description() const override + { + return "Enable/Disable Automatic Motion Data Correction"; + } + + enable_motion_correction(sensor_base* mm_ep, const option_range& opt_range); + + private: + std::atomic _is_active; + }; + class enable_auto_exposure_option : public option_base { public: diff --git a/src/ds5/ds5-private.h b/src/ds5/ds5-private.h index 38f0e09881..05a89e5879 100644 --- a/src/ds5/ds5-private.h +++ b/src/ds5/ds5-private.h @@ -561,8 +561,7 @@ namespace librealsense enum imu_eeprom_id : uint16_t { dm_v2_eeprom_id = 0x0101, // The pack alignment is Big-endian - tm1_eeprom_id = 0x0002, - l500_eeprom_id = 0x0105 + tm1_eeprom_id = 0x0002 }; struct depth_table_control diff --git a/src/l500/l500-motion.cpp b/src/l500/l500-motion.cpp index aa9476948c..2504257860 100644 --- a/src/l500/l500-motion.cpp +++ b/src/l500/l500-motion.cpp @@ -93,26 +93,6 @@ namespace librealsense const l500_motion* _owner; }; - std::vector l500_motion::get_imu_eeprom_raw() const - { - // read imu calibration table on L515 - // READ_TABLE 0x243 0 - command cmd(ivcam2::READ_TABLE, 0x243, 0); - - std::vector res; - - try - { - res = _hw_monitor->send(cmd); - } - catch (std::exception &e) { - LOG_WARNING(e.what()); - } - catch (...) {} - - return res; - } - std::shared_ptr l500_motion::create_hid_device(std::shared_ptr ctx, const std::vector& all_hid_infos) { if (all_hid_infos.empty()) @@ -137,31 +117,16 @@ namespace librealsense hid_ep->get_option(RS2_OPTION_GLOBAL_TIME_ENABLED).set(0); hid_ep->register_option(RS2_OPTION_GLOBAL_TIME_ENABLED, enable_global_time_option); - // register pre-processing - bool enable_imu_correction = false; - std::shared_ptr mm_correct_opt = nullptr; - - // Motion intrinsic calibration presents is a prerequisite for motion correction. - try - { - if (_mm_calib) - { - mm_correct_opt = std::make_shared(hid_ep.get(), option_range{ 0, 1, 1, 1 }); - hid_ep->register_option(RS2_OPTION_ENABLE_MOTION_CORRECTION, mm_correct_opt); - } - } - catch (...) {} - hid_ep->register_processing_block( { {RS2_FORMAT_MOTION_XYZ32F, RS2_STREAM_ACCEL} }, { {RS2_FORMAT_MOTION_XYZ32F, RS2_STREAM_ACCEL} }, - [&, mm_correct_opt]() { return std::make_shared(_mm_calib, mm_correct_opt); } + []() { return std::make_shared(); } ); hid_ep->register_processing_block( { {RS2_FORMAT_MOTION_XYZ32F, RS2_STREAM_GYRO} }, { {RS2_FORMAT_MOTION_XYZ32F, RS2_STREAM_GYRO} }, - [&, mm_correct_opt]() { return std::make_shared(_mm_calib, mm_correct_opt); } + []() { return std::make_shared(); } ); return hid_ep; @@ -172,24 +137,6 @@ namespace librealsense _accel_stream(new stream(RS2_STREAM_ACCEL)), _gyro_stream(new stream(RS2_STREAM_GYRO)) { - _imu_eeprom_raw = [this]() { return get_imu_eeprom_raw(); }; - - if (!_imu_eeprom_raw->empty()) - { - _mm_calib = std::make_shared(*_imu_eeprom_raw); - - _accel_intrinsic = std::make_shared>([this]() { return _mm_calib->get_intrinsic(RS2_STREAM_ACCEL); }); - _gyro_intrinsic = std::make_shared>([this]() { return _mm_calib->get_intrinsic(RS2_STREAM_GYRO); }); - // use predefined values extrinsics - _depth_to_imu = std::make_shared>([this]() { return _mm_calib->get_extrinsic(RS2_STREAM_ACCEL); }); - } - - // Make sure all MM streams are positioned with the same extrinsics - environment::get_instance().get_extrinsics_graph().register_extrinsics(*_depth_stream, *_accel_stream, _depth_to_imu); - environment::get_instance().get_extrinsics_graph().register_same_extrinsics(*_accel_stream, *_gyro_stream); - register_stream_to_extrinsic_group(*_gyro_stream, 0); - register_stream_to_extrinsic_group(*_accel_stream, 0); - auto hid_ep = create_hid_device(ctx, group.hid_devices); if (hid_ep) { diff --git a/src/l500/l500-motion.h b/src/l500/l500-motion.h index 500f93404a..aaa276e20e 100644 --- a/src/l500/l500-motion.h +++ b/src/l500/l500-motion.h @@ -8,7 +8,6 @@ #include "device.h" #include "stream.h" #include "l500/l500-device.h" -#include "../ds5/ds5-motion.h" namespace librealsense { @@ -31,14 +30,6 @@ namespace librealsense optional_value _motion_module_device_idx; - std::vector get_imu_eeprom_raw() const; - lazy> _imu_eeprom_raw; - - std::shared_ptr _mm_calib; - std::shared_ptr> _accel_intrinsic; - std::shared_ptr> _gyro_intrinsic; - std::shared_ptr> _depth_to_imu; // Mechanical installation pose - protected: std::shared_ptr _accel_stream; std::shared_ptr _gyro_stream; diff --git a/src/l500/l500-private.h b/src/l500/l500-private.h index 59f7243841..714190c8c7 100644 --- a/src/l500/l500-private.h +++ b/src/l500/l500-private.h @@ -54,7 +54,6 @@ namespace librealsense AMCSET = 0x2B, // Set options (L515) AMCGET = 0x2C, // Get options (L515) PFD = 0x3B, // Disable power features - READ_TABLE = 0x43, // read table from flash, for example, read imu calibration table, read_table 0x243 0 DPT_INTRINSICS_GET = 0x5A, TEMPERATURES_GET = 0x6A, DPT_INTRINSICS_FULL_GET = 0x7F, diff --git a/src/option.h b/src/option.h index 3e86c8d048..51ea773ea8 100644 --- a/src/option.h +++ b/src/option.h @@ -551,24 +551,4 @@ namespace librealsense float _manual_value; std::function _recording_function = [](const option&) {}; }; - - class enable_motion_correction : public option_base - { - public: - void set(float value) override; - - float query() const override; - - bool is_enabled() const override { return true; } - - const char* get_description() const override - { - return "Enable/Disable Automatic Motion Data Correction"; - } - - enable_motion_correction(sensor_base* mm_ep, const option_range& opt_range); - - private: - std::atomic _is_active; - }; } diff --git a/src/proc/motion-transform.cpp b/src/proc/motion-transform.cpp index a51690a2e7..9e87c32e40 100644 --- a/src/proc/motion-transform.cpp +++ b/src/proc/motion-transform.cpp @@ -62,6 +62,7 @@ namespace librealsense } else { + // TODO Define L500 base transformation alignment _imu2depth_cs_alignment_matrix = { {1,0,0},{0,1,0}, {0,0,1} }; } }