diff --git a/src/context.cpp b/src/context.cpp index b938781c9c..134b989b6a 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -333,7 +333,7 @@ namespace librealsense std::copy(begin(ds5_devices), end(ds5_devices), std::back_inserter(list)); } - auto l500_devices = l500_info::pick_l500_devices(ctx, devices.uvc_devices, devices.usb_devices); + auto l500_devices = l500_info::pick_l500_devices(ctx, devices); std::copy(begin(l500_devices), end(l500_devices), std::back_inserter(list)); if (mask & RS2_PRODUCT_LINE_SR300) diff --git a/src/ds5/ds5-motion.cpp b/src/ds5/ds5-motion.cpp index dd4efbe920..1b8cfd2681 100644 --- a/src/ds5/ds5-motion.cpp +++ b/src/ds5/ds5-motion.cpp @@ -165,7 +165,7 @@ namespace librealsense static const char* custom_sensor_fw_ver = "5.6.0.0"; auto hid_ep = std::make_shared(this, ctx->get_backend().create_hid_device(all_hid_infos.front()), - std::unique_ptr(new ds5_iio_hid_timestamp_reader()), + std::unique_ptr(new iio_hid_timestamp_reader()), std::unique_ptr(new ds5_custom_hid_timestamp_reader()), fps_and_sampling_frequency_per_rs2_stream, sensor_name_and_hid_profiles); diff --git a/src/ds5/ds5-timestamp.cpp b/src/ds5/ds5-timestamp.cpp index 2127bf8de1..f99efa0810 100644 --- a/src/ds5/ds5-timestamp.cpp +++ b/src/ds5/ds5-timestamp.cpp @@ -15,8 +15,6 @@ namespace librealsense { - static const double TIMESTAMP_USEC_TO_MSEC = 0.001; - ds5_timestamp_reader_from_metadata::ds5_timestamp_reader_from_metadata(std::unique_ptr backup_timestamp_reader) :_backup_timestamp_reader(std::move(backup_timestamp_reader)), _has_metadata(pins), one_time_note(false) { @@ -144,78 +142,6 @@ namespace librealsense return RS2_TIMESTAMP_DOMAIN_SYSTEM_TIME; } - ds5_iio_hid_timestamp_reader::ds5_iio_hid_timestamp_reader() - { - counter.resize(sensors); - reset(); - } - - void ds5_iio_hid_timestamp_reader::reset() - { - std::lock_guard lock(_mtx); - started = false; - for (auto i = 0; i < sensors; ++i) - { - counter[i] = 0; - } - } - - rs2_time_t ds5_iio_hid_timestamp_reader::get_frame_timestamp(const request_mapping& mode, const platform::frame_object& fo) - { - std::lock_guard lock(_mtx); - - if(has_metadata(mode, fo.metadata, fo.metadata_size)) - { - // The timestamps conversions path comprise of: - // FW TS (32bit) -> USB Phy Layer (no changes) -> Host Driver TS (Extend to 64bit) -> LRS read as 64 bit - // The flow introduces discrepancy with UVC stream which timestamps aer not extended to 64 bit by host driver both for Win and v4l backends. - // In order to allow for hw timestamp-based synchronization of Depth and IMU streams the latter will be trimmed to 32 bit. - // To revert to the extended 64 bit TS uncomment the next line instead - //auto timestamp = *((uint64_t*)((const uint8_t*)fo.metadata)); - auto timestamp = *((uint32_t*)((const uint8_t*)fo.metadata)); - - // HID timestamps are aligned to FW Default - usec units - return static_cast(timestamp * TIMESTAMP_USEC_TO_MSEC); - } - - if (!started) - { - LOG_WARNING("HID timestamp not found! please apply HID patch."); - started = true; - } - - return std::chrono::duration(std::chrono::system_clock::now().time_since_epoch()).count(); - } - - bool ds5_iio_hid_timestamp_reader::has_metadata(const request_mapping& mode, const void * metadata, size_t metadata_size) const - { - if(metadata != nullptr && metadata_size > 0) - { - return true; - } - return false; - } - - unsigned long long ds5_iio_hid_timestamp_reader::get_frame_counter(const request_mapping & mode, const platform::frame_object& fo) const - { - std::lock_guard lock(_mtx); - if (nullptr == mode.pf) return 0; // Windows support is limited - int index = 0; - if (mode.pf->fourcc == rs_fourcc('G','Y','R','O')) - index = 1; - - return ++counter[index]; - } - - rs2_timestamp_domain ds5_iio_hid_timestamp_reader::get_frame_timestamp_domain(const request_mapping & mode, const platform::frame_object& fo) const - { - if(has_metadata(mode ,fo.metadata, fo.metadata_size)) - { - return RS2_TIMESTAMP_DOMAIN_HARDWARE_CLOCK; - } - return RS2_TIMESTAMP_DOMAIN_SYSTEM_TIME; - } - ds5_custom_hid_timestamp_reader::ds5_custom_hid_timestamp_reader() { counter.resize(sensors); diff --git a/src/ds5/ds5-timestamp.h b/src/ds5/ds5-timestamp.h index 27dcd853df..d742903ebd 100644 --- a/src/ds5/ds5-timestamp.h +++ b/src/ds5/ds5-timestamp.h @@ -50,26 +50,6 @@ namespace librealsense rs2_timestamp_domain get_frame_timestamp_domain(const request_mapping & mode, const platform::frame_object& fo) const override; }; - class ds5_iio_hid_timestamp_reader : public frame_timestamp_reader - { - static const int sensors = 2; - bool started; - mutable std::vector counter; - mutable std::recursive_mutex _mtx; - public: - ds5_iio_hid_timestamp_reader(); - - void reset() override; - - rs2_time_t get_frame_timestamp(const request_mapping& mode, const platform::frame_object& fo) override; - - bool has_metadata(const request_mapping& mode, const void * metadata, size_t metadata_size) const; - - unsigned long long get_frame_counter(const request_mapping & mode, const platform::frame_object& fo) const override; - - rs2_timestamp_domain get_frame_timestamp_domain(const request_mapping & mode, const platform::frame_object& fo) const override; - }; - class ds5_custom_hid_timestamp_reader : public frame_timestamp_reader { static const int sensors = 4; // TODO: implement frame-counter for each GPIO or diff --git a/src/l500/CMakeLists.txt b/src/l500/CMakeLists.txt index 4ccefa320f..83d9cfd0d2 100644 --- a/src/l500/CMakeLists.txt +++ b/src/l500/CMakeLists.txt @@ -5,9 +5,11 @@ target_sources(${LRS_TARGET} "${CMAKE_CURRENT_LIST_DIR}/l500-depth.cpp" "${CMAKE_CURRENT_LIST_DIR}/l500-private.cpp" "${CMAKE_CURRENT_LIST_DIR}/l500-color.cpp" + "${CMAKE_CURRENT_LIST_DIR}/l500-motion.cpp" "${CMAKE_CURRENT_LIST_DIR}/l500-factory.cpp" "${CMAKE_CURRENT_LIST_DIR}/l500-depth.h" "${CMAKE_CURRENT_LIST_DIR}/l500-private.h" "${CMAKE_CURRENT_LIST_DIR}/l500-color.h" + "${CMAKE_CURRENT_LIST_DIR}/l500-motion.h" "${CMAKE_CURRENT_LIST_DIR}/l500-factory.h" ) diff --git a/src/l500/l500-factory.cpp b/src/l500/l500-factory.cpp index c9b7cf47c5..343ec37b80 100644 --- a/src/l500/l500-factory.cpp +++ b/src/l500/l500-factory.cpp @@ -13,8 +13,8 @@ #include "metadata-parser.h" #include "l500-factory.h" -#include "l500-private.h" #include "l500-depth.h" +#include "l500-motion.h" #include "l500-color.h" namespace librealsense @@ -22,7 +22,9 @@ namespace librealsense using namespace ivcam2; // l515 - class rs515_device : public l500_depth, public l500_color + class rs515_device : public l500_depth, + public l500_color, + public l500_motion { public: rs515_device(std::shared_ptr ctx, @@ -30,7 +32,8 @@ namespace librealsense bool register_device_notifications) : device(ctx, group, register_device_notifications), l500_depth(ctx, group), - l500_color(ctx, group) + l500_color(ctx, group), + l500_motion(ctx, group) {} std::shared_ptr create_matcher(const frame_holder& frame) const override; @@ -43,7 +46,8 @@ namespace librealsense tags.push_back({ RS2_STREAM_DEPTH, -1, 640, 360, RS2_FORMAT_Z16, 30, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT }); tags.push_back({ RS2_STREAM_INFRARED, -1, 640, 360, RS2_FORMAT_Y8, 30, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT }); tags.push_back({ RS2_STREAM_CONFIDENCE, -1, 640, 360, RS2_FORMAT_RAW8, 30, profile_tag::PROFILE_TAG_SUPERSET }); - + tags.push_back({ RS2_STREAM_GYRO, -1, 0, 0, RS2_FORMAT_MOTION_XYZ32F, 200, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT }); + tags.push_back({ RS2_STREAM_ACCEL, -1, 0, 0, RS2_FORMAT_MOTION_XYZ32F, 200, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT }); return tags; }; }; @@ -85,7 +89,7 @@ namespace librealsense return std::make_shared(ctx, group, register_device_notifications); case L515_PID: return std::make_shared(ctx, group, register_device_notifications); - default: + default: throw std::runtime_error(to_string() << "Unsupported L500 model! 0x" << std::hex << std::setw(4) << std::setfill('0') << (int)pid); } @@ -93,24 +97,33 @@ namespace librealsense std::vector> l500_info::pick_l500_devices( std::shared_ptr ctx, - std::vector& uvc, - std::vector& usb) + platform::backend_device_group& group) { std::vector chosen; std::vector> results; - auto correct_pid = filter_by_product(uvc, { L500_PID, L515_PID }); - auto group_devices = group_devices_by_unique_id(correct_pid); - for (auto& group : group_devices) + auto correct_pid = filter_by_product(group.uvc_devices, { L500_PID, L515_PID }); + auto group_devices = group_devices_and_hids_by_unique_id(group_devices_by_unique_id(correct_pid), group.hid_devices); + for (auto& g : group_devices) { - if (!group.empty() && mi_present(group, 0)) + if (!g.first.empty() && mi_present(g.first, 0)) { - auto depth = get_mi(group, 0); + auto depth = get_mi(g.first, 0); platform::usb_device_info hwm; - if (!ivcam2::try_fetch_usb_device(usb, depth, hwm)) + + if (!ivcam2::try_fetch_usb_device(group.usb_devices, depth, hwm)) LOG_WARNING("try_fetch_usb_device(...) failed."); - auto info = std::make_shared(ctx, group, hwm); + +#if defined( RS2_USE_WMF_BACKEND) || defined(RS2_USE_V4L2_BACKEND) //currently hid backend implemented only for windows and linux. + if (g.second.size() < 2) + { + LOG_WARNING("Skipping L500. " << g.second.size() << " HID devices were recognized, at least 2 required"); + continue; + } + +#endif + auto info = std::make_shared(ctx, g.first, hwm, g.second); chosen.push_back(depth); results.push_back(info); } @@ -120,7 +133,7 @@ namespace librealsense } } - trim_device_list(uvc, chosen); + trim_device_list(group.uvc_devices, chosen); return results; } diff --git a/src/l500/l500-factory.h b/src/l500/l500-factory.h index bff597dc3f..7f6b296072 100644 --- a/src/l500/l500-factory.h +++ b/src/l500/l500-factory.h @@ -3,7 +3,6 @@ #pragma once #include "l500-private.h" -#include "l500-depth.h" namespace librealsense { @@ -15,28 +14,29 @@ namespace librealsense l500_info(std::shared_ptr ctx, std::vector depth, - platform::usb_device_info hwm) + platform::usb_device_info hwm, + std::vector hid) : device_info(ctx), _depth(std::move(depth)), - _hwm(std::move(hwm)) + _hwm(std::move(hwm)), + _hid(std::move(hid)) {} static std::vector> pick_l500_devices( std::shared_ptr ctx, - std::vector& platform, - std::vector& usb); + platform::backend_device_group& group); platform::backend_device_group get_device_data() const override { std::vector usb_devices; if (_hwm.id != "") usb_devices = { _hwm }; - return platform::backend_device_group({ _depth }, usb_devices); + return platform::backend_device_group({ _depth }, usb_devices, { _hid }); } private: std::vector _depth; - platform::usb_device_info _hwm; + std::vector _hid; }; } diff --git a/src/l500/l500-motion.cpp b/src/l500/l500-motion.cpp new file mode 100644 index 0000000000..9f71aba335 --- /dev/null +++ b/src/l500/l500-motion.cpp @@ -0,0 +1,137 @@ +// License: Apache 2.0. See LICENSE file in root directory. +// Copyright(c) 2019 Intel Corporation. All Rights Reserved. + +#include "l500-color.h" +#include "l500-private.h" +#include "l500-motion.h" +#include "../backend.h" + +namespace librealsense +{ + +#ifdef _WIN32 + std::vector> l500_sensor_name_and_hid_profiles = + {{ "HID Sensor Class Device: Gyroscope", {RS2_STREAM_GYRO, 0, 1, 1, 100, RS2_FORMAT_MOTION_XYZ32F}}, + { "HID Sensor Class Device: Gyroscope", {RS2_STREAM_GYRO, 0, 1, 1, 200, RS2_FORMAT_MOTION_XYZ32F}}, + { "HID Sensor Class Device: Gyroscope", {RS2_STREAM_GYRO, 0, 1, 1, 400, RS2_FORMAT_MOTION_XYZ32F}}, + { "HID Sensor Class Device: Accelerometer", {RS2_STREAM_ACCEL, 0, 1, 1, 50, RS2_FORMAT_MOTION_XYZ32F}}, + { "HID Sensor Class Device: Accelerometer", {RS2_STREAM_ACCEL, 0, 1, 1, 100, RS2_FORMAT_MOTION_XYZ32F}}, + { "HID Sensor Class Device: Accelerometer", {RS2_STREAM_ACCEL, 0, 1, 1, 200, RS2_FORMAT_MOTION_XYZ32F}}, + { "HID Sensor Class Device: Accelerometer", {RS2_STREAM_ACCEL, 0, 1, 1, 400, RS2_FORMAT_MOTION_XYZ32F}} }; + + // Translate frequency to SENSOR_PROPERTY_CURRENT_REPORT_INTERVAL + std::map> l500_fps_and_sampling_frequency_per_rs2_stream = + { {RS2_STREAM_ACCEL,{{50, 2000}, + {100, 1000}, + {200, 500}, + {400, 250}}}, + {RS2_STREAM_GYRO, {{100, 1000}, + {200, 500}, + {400, 250}}}}; + +#else + std::vector> l500_sensor_name_and_hid_profiles = + {{ "gyro_3d", {RS2_STREAM_GYRO, 0, 1, 1, 100, RS2_FORMAT_MOTION_XYZ32F}}, + { "gyro_3d", {RS2_STREAM_GYRO, 0, 1, 1, 200, RS2_FORMAT_MOTION_XYZ32F}}, + { "gyro_3d", {RS2_STREAM_GYRO, 0, 1, 1, 400, RS2_FORMAT_MOTION_XYZ32F}}, + { "accel_3d", {RS2_STREAM_ACCEL, 0, 1, 1, 50, RS2_FORMAT_MOTION_XYZ32F}}, + { "accel_3d", {RS2_STREAM_ACCEL, 0, 1, 1, 100, RS2_FORMAT_MOTION_XYZ32F}}, + { "accel_3d", {RS2_STREAM_ACCEL, 0, 1, 1, 200, RS2_FORMAT_MOTION_XYZ32F}}, + { "accel_3d", {RS2_STREAM_ACCEL, 0, 1, 1, 400, RS2_FORMAT_MOTION_XYZ32F}}}; + + // The frequency selector is vendor and model-specific + std::map> l500_fps_and_sampling_frequency_per_rs2_stream = + { {RS2_STREAM_ACCEL,{{50, 1}, + {100, 1}, + {200, 2}, + {400, 4}}}, + {RS2_STREAM_GYRO, {{100, 1}, + {200, 2}, + {400, 4}}} }; +#endif + + class l500_hid_sensor : public hid_sensor + { + public: + explicit l500_hid_sensor(l500_motion* owner, std::shared_ptr hid_device, + std::unique_ptr hid_iio_timestamp_reader, + std::unique_ptr custom_hid_timestamp_reader, + std::map> fps_and_sampling_frequency_per_rs2_stream, + std::vector> sensor_name_and_hid_profiles) + : hid_sensor(hid_device, move(hid_iio_timestamp_reader), move(custom_hid_timestamp_reader), + fps_and_sampling_frequency_per_rs2_stream, sensor_name_and_hid_profiles, owner), _owner(owner) + { + } + + rs2_motion_device_intrinsic get_motion_intrinsics(rs2_stream stream) const + { + return _owner->get_motion_intrinsics(stream); + } + + stream_profiles init_stream_profiles() override + { + auto lock = environment::get_instance().get_extrinsics_graph().lock(); + auto results = hid_sensor::init_stream_profiles(); + + for (auto p : results) + { + // Register stream types + if (p->get_stream_type() == RS2_STREAM_ACCEL) + assign_stream(_owner->_accel_stream, p); + if (p->get_stream_type() == RS2_STREAM_GYRO) + assign_stream(_owner->_gyro_stream, p); + + //set motion intrinsics + if (p->get_stream_type() == RS2_STREAM_ACCEL || p->get_stream_type() == RS2_STREAM_GYRO) + { + auto motion = dynamic_cast(p.get()); + assert(motion); //Expecting to succeed for motion stream (since we are under the "if") + auto st = p->get_stream_type(); + motion->set_intrinsics([this, st]() { return get_motion_intrinsics(st); }); + } + } + + return results; + } + + private: + const l500_motion* _owner; + }; + + std::shared_ptr l500_motion::create_hid_device(std::shared_ptr ctx, const std::vector& all_hid_infos) + { + if (all_hid_infos.empty()) + { + LOG_WARNING("HID device is missing!"); + return nullptr; + } + + auto hid_ep = std::make_shared(this, ctx->get_backend().create_hid_device(all_hid_infos.front()), + std::unique_ptr(new iio_hid_timestamp_reader()), + std::unique_ptr(new iio_hid_timestamp_reader()), + l500_fps_and_sampling_frequency_per_rs2_stream, + l500_sensor_name_and_hid_profiles); + + hid_ep->register_pixel_format(pf_accel_axes); + hid_ep->register_pixel_format(pf_gyro_axes); + + return hid_ep; + } + + l500_motion::l500_motion(std::shared_ptr ctx, const platform::backend_device_group & group) + :device(ctx, group), + _accel_stream(new stream(RS2_STREAM_ACCEL)), + _gyro_stream(new stream(RS2_STREAM_GYRO)) + { + auto hid_ep = create_hid_device(ctx, group.hid_devices); + if (hid_ep) + { + _motion_module_device_idx = add_sensor(hid_ep); + } + } + + rs2_motion_device_intrinsic l500_motion::get_motion_intrinsics(rs2_stream) const + { + return rs2_motion_device_intrinsic(); + } +} diff --git a/src/l500/l500-motion.h b/src/l500/l500-motion.h new file mode 100644 index 0000000000..2873ca7e58 --- /dev/null +++ b/src/l500/l500-motion.h @@ -0,0 +1,35 @@ +// License: Apache 2.0. See LICENSE file in root directory. +// Copyright(c) 2019 Intel Corporation. All Rights Reserved. + +#pragma once + +#include +#include +#include "device.h" +#include "stream.h" + +namespace librealsense +{ + class l500_motion : public virtual device + { + public: + std::shared_ptr create_hid_device(std::shared_ptr ctx, + const std::vector& all_hid_infos); + + l500_motion(std::shared_ptr ctx, + const platform::backend_device_group& group); + + rs2_motion_device_intrinsic get_motion_intrinsics(rs2_stream) const; + + private: + + friend class l500_hid_sensor; + + optional_value _motion_module_device_idx; + + protected: + std::shared_ptr _accel_stream; + std::shared_ptr _gyro_stream; + }; + +} diff --git a/src/l500/l500-private.cpp b/src/l500/l500-private.cpp index 3ac758978a..29956f0a19 100644 --- a/src/l500/l500-private.cpp +++ b/src/l500/l500-private.cpp @@ -18,7 +18,7 @@ namespace librealsense { result = *it; - if (result.mi == 4 || result.mi == 6) + if (result.mi == 4 || result.mi == 6 || result.mi == 7) { devices.erase(it); return true; diff --git a/src/media/ros/ros_reader.cpp b/src/media/ros/ros_reader.cpp index c33c7d78e3..b054ae7462 100644 --- a/src/media/ros/ros_reader.cpp +++ b/src/media/ros/ros_reader.cpp @@ -4,7 +4,7 @@ #include "ros_reader.h" #include "ds5/ds5-device.h" #include "ivcam/sr300.h" -#include "l500/l500-factory.h" +#include "l500/l500-depth.h" #include "proc/disparity-transform.h" #include "proc/decimation-filter.h" #include "proc/threshold.h" diff --git a/src/sensor.cpp b/src/sensor.cpp index d340251842..26a60a8760 100644 --- a/src/sensor.cpp +++ b/src/sensor.cpp @@ -1082,4 +1082,76 @@ namespace librealsense { register_metadata(RS2_FRAME_METADATA_BACKEND_TIMESTAMP, make_additional_data_parser(&frame_additional_data::backend_timestamp)); } + + iio_hid_timestamp_reader::iio_hid_timestamp_reader() + { + counter.resize(sensors); + reset(); + } + + void iio_hid_timestamp_reader::reset() + { + std::lock_guard lock(_mtx); + started = false; + for (auto i = 0; i < sensors; ++i) + { + counter[i] = 0; + } + } + + rs2_time_t iio_hid_timestamp_reader::get_frame_timestamp(const request_mapping& mode, const platform::frame_object& fo) + { + std::lock_guard lock(_mtx); + + if (has_metadata(mode, fo.metadata, fo.metadata_size)) + { + // The timestamps conversions path comprise of: + // FW TS (32bit) -> USB Phy Layer (no changes) -> Host Driver TS (Extend to 64bit) -> LRS read as 64 bit + // The flow introduces discrepancy with UVC stream which timestamps aer not extended to 64 bit by host driver both for Win and v4l backends. + // In order to allow for hw timestamp-based synchronization of Depth and IMU streams the latter will be trimmed to 32 bit. + // To revert to the extended 64 bit TS uncomment the next line instead + //auto timestamp = *((uint64_t*)((const uint8_t*)fo.metadata)); + auto timestamp = *((uint32_t*)((const uint8_t*)fo.metadata)); + + // HID timestamps are aligned to FW Default - usec units + return static_cast(timestamp * TIMESTAMP_USEC_TO_MSEC); + } + + if (!started) + { + LOG_WARNING("HID timestamp not found! please apply HID patch."); + started = true; + } + + return std::chrono::duration(std::chrono::system_clock::now().time_since_epoch()).count(); + } + + bool iio_hid_timestamp_reader::has_metadata(const request_mapping& mode, const void * metadata, size_t metadata_size) const + { + if (metadata != nullptr && metadata_size > 0) + { + return true; + } + return false; + } + + unsigned long long iio_hid_timestamp_reader::get_frame_counter(const request_mapping & mode, const platform::frame_object& fo) const + { + std::lock_guard lock(_mtx); + if (nullptr == mode.pf) return 0; // Windows support is limited + int index = 0; + if (mode.pf->fourcc == 'GYRO') + index = 1; + + return ++counter[index]; + } + + rs2_timestamp_domain iio_hid_timestamp_reader::get_frame_timestamp_domain(const request_mapping & mode, const platform::frame_object& fo) const + { + if (has_metadata(mode, fo.metadata, fo.metadata_size)) + { + return RS2_TIMESTAMP_DOMAIN_HARDWARE_CLOCK; + } + return RS2_TIMESTAMP_DOMAIN_SYSTEM_TIME; + } } diff --git a/src/sensor.h b/src/sensor.h index 6805266807..c983df5f21 100644 --- a/src/sensor.h +++ b/src/sensor.h @@ -124,6 +124,26 @@ namespace librealsense virtual void reset() = 0; }; + class iio_hid_timestamp_reader : public frame_timestamp_reader + { + static const int sensors = 2; + bool started; + mutable std::vector counter; + mutable std::recursive_mutex _mtx; + public: + iio_hid_timestamp_reader(); + + void reset() override; + + rs2_time_t get_frame_timestamp(const request_mapping& mode, const platform::frame_object& fo) override; + + bool has_metadata(const request_mapping& mode, const void * metadata, size_t metadata_size) const; + + unsigned long long get_frame_counter(const request_mapping & mode, const platform::frame_object& fo) const override; + + rs2_timestamp_domain get_frame_timestamp_domain(const request_mapping & mode, const platform::frame_object& fo) const; + }; + class hid_sensor : public sensor_base { public: diff --git a/src/types.h b/src/types.h index 2489e841e4..c8c30bb002 100644 --- a/src/types.h +++ b/src/types.h @@ -65,9 +65,11 @@ template T rad2deg(T val) { return T(val * r2d); } #include "../common/android_helpers.h" #endif +#define UNKNOWN_VALUE "UNKNOWN" + namespace librealsense { - #define UNKNOWN_VALUE "UNKNOWN" + static const double TIMESTAMP_USEC_TO_MSEC = 0.001f; /////////////////////////////////// // Utility types for general use //