Skip to content

Commit

Permalink
Merge branch 'development' into D4XX_MIPI
Browse files Browse the repository at this point in the history
  • Loading branch information
remibettan committed Oct 27, 2022
2 parents e45b1fa + 824237e commit 7567556
Show file tree
Hide file tree
Showing 21 changed files with 21,934 additions and 9,414 deletions.
39 changes: 29 additions & 10 deletions common/res/icon.h

Large diffs are not rendered by default.

Binary file added common/res/icon_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added common/res/icon_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added common/res/icon_24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added common/res/icon_256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added common/res/icon_310.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added common/res/icon_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added common/res/icon_512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added common/res/icon_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions common/res/int-rs-splash.hpp

Large diffs are not rendered by default.

Binary file modified common/res/int-rs-splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions common/sw-update/versions-db-manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <vector>
#include "http-downloader.h"
#include <regex>
#include <sstream>

namespace rs2
{
Expand Down
5 changes: 0 additions & 5 deletions src/ds5/ds5-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,11 +879,6 @@ namespace librealsense
);
}

depth_sensor.register_processing_block(
{ RS2_FORMAT_Y16I },
{ {RS2_FORMAT_Y16, RS2_STREAM_INFRARED, 1}, {RS2_FORMAT_Y16, RS2_STREAM_INFRARED, 2} },
[]() {return std::make_shared<y16i_to_y10msby10msb>(); }
);

pid_hex_str = hexify(_pid);

Expand Down
31,185 changes: 21,797 additions & 9,388 deletions third-party/json.hpp

Large diffs are not rendered by default.

Binary file modified tools/depth-quality/res/icon.ico
Binary file not shown.
16 changes: 13 additions & 3 deletions tools/embed/rs-embed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <stb_image.h>


#define RS_EMBED_VERSION "0.0.0.1"
#define RS_EMBED_VERSION "0.0.0.2"

struct float3
{
Expand Down Expand Up @@ -57,6 +57,16 @@ std::string get_current_time()
return std::string(buffer);
}

std::string get_current_year()
{
auto t = time(nullptr);
char buffer[20] = {};
const tm* time = localtime(&t);
if (nullptr != time)
strftime(buffer, sizeof(buffer), "%Y", time);
return std::string(buffer);
}

int main(int argc, char** argv) try
{
// Parse command line arguments
Expand Down Expand Up @@ -151,7 +161,7 @@ int main(int argc, char** argv) try
ofstream myfile;
myfile.open(output);
myfile << "// License: Apache 2.0. See LICENSE file in root directory.\n";
myfile << "// Copyright(c) 2021 Intel Corporation. All Rights Reserved.\n\n";
myfile << "// Copyright(c) " << get_current_year() << " Intel Corporation. All Rights Reserved.\n\n";
myfile << "// This file is auto-generated from " << name << ".obj using rs-embed tool version: " << RS_EMBED_VERSION <<"\n";
myfile << "// Generation time: " << get_current_time() << ".\n\n";
myfile << "#pragma once\n";
Expand Down Expand Up @@ -203,7 +213,7 @@ int main(int argc, char** argv) try
ofstream myfile;
myfile.open(output);
myfile << "// License: Apache 2.0. See LICENSE file in root directory.\n";
myfile << "// Copyright(c) 2021 Intel Corporation. All Rights Reserved.\n\n";
myfile << "// Copyright(c) " << get_current_year() << " Intel Corporation. All Rights Reserved.\n\n";
myfile << "// This file is auto-generated from " << name << ".png using rs-embed tool version: " << RS_EMBED_VERSION << "\n";
myfile << "// Generation time: " << get_current_time() << ".\n\n";

Expand Down
Binary file modified tools/realsense-viewer/res/icon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion tools/rs-server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set(DEPENDENCIES ${DEPENDENCIES} realsense2 Threads::Threads)

set(CMAKE_CXX_FLAGS "-DNEWLOCALE_NOT_USED=1 -DBSD=1 -DSOCKLEN_T=socklen_t -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -DALLOW_RTSP_SERVER_PORT_REUSE=1 -DNO_OPENSSL=1 -latomic")

SET(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-pthread")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")

set(LIVE ${CMAKE_BINARY_DIR}/third-party/live)

Expand Down
83 changes: 83 additions & 0 deletions unit-tests/live/options/test-timestamp-domain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2022 Intel Corporation. All Rights Reserved.

# test:device D400*

import time
import pyrealsense2 as rs

from rspy import test


def close_resources(sensor):
"""
Stop and Close sensor.
:sensor: sensor of device
"""
if len(sensor.get_active_streams()) > 0:
sensor.stop()
sensor.close()


def set_and_verify_timestamp_domain(sensor, global_time_enabled: bool):
"""
Perform sensor (depth or color) test according given global time
:sensor: depth or color sensor in device
:global_time_enabled bool: True - timestamp is enabled otherwise false
"""
global frame_queue

sensor.set_option(rs.option.global_time_enabled, global_time_enabled)
time.sleep(0.3) # Waiting for new frame from device. Need in case low FPS.
frame = frame_queue.wait_for_frame()

if not frame:
test.fail()

expected_ts_domain = rs.timestamp_domain.global_time if global_time_enabled else \
rs.timestamp_domain.hardware_clock

test.check_equal(sensor.get_option(rs.option.global_time_enabled), global_time_enabled)
test.check_equal(frame.get_frame_timestamp_domain(), expected_ts_domain)


frame_queue = rs.frame_queue(capacity=1, keep_frames=False)
device = test.find_first_device_or_exit()

# Depth sensor test
depth_sensor = device.first_depth_sensor()
depth_profile = next(p for p in depth_sensor.profiles if p.stream_type() == rs.stream.depth)
depth_sensor.open(depth_profile)
depth_sensor.start(frame_queue)

# Test #1
test.start('Check setting global time domain: depth sensor - timestamp domain is OFF')
set_and_verify_timestamp_domain(depth_sensor, False)
test.finish()

# Test #2
test.start('Check setting global time domain: depth sensor - timestamp domain is ON')
set_and_verify_timestamp_domain(depth_sensor, True)
test.finish()

close_resources(depth_sensor)

# Color sensor test
color_sensor = device.first_color_sensor()
color_profile = next(p for p in color_sensor.profiles if p.stream_type() == rs.stream.color)
color_sensor.open(color_profile)
color_sensor.start(frame_queue)

# Test #3
test.start('Check setting global time domain: color sensor - timestamp domain is OFF')
set_and_verify_timestamp_domain(color_sensor, False)
test.finish()

# Test #4
test.start('Check setting global time domain: color sensor - timestamp domain is ON')
set_and_verify_timestamp_domain(color_sensor, True)
test.finish()

close_resources(color_sensor)

test.print_results_and_exit()
2 changes: 2 additions & 0 deletions unit-tests/utilities/time/test-waiting-on.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,7 @@ TEST_CASE( "Not invoked flush timeout expected" )
invoked.wait_until( timeout, [&]() { return invoked; } );
auto wait_time = sw.get_elapsed();

INFO( wait_time.count() );
INFO( timeout.count() );
REQUIRE( wait_time >= timeout );
}
6 changes: 3 additions & 3 deletions wrappers/python/pyrsutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ void init_util(py::module &m) {
const rs2_extrinsics& color_to_depth, const rs2_extrinsics& depth_to_color,
std::array<float, 2> from_pixel)->std::array<float, 2>
{
std::array<float, 2> to_pixel;
std::array<float, 2> to_pixel{-1.0f, -1.0f};
rs2_project_color_pixel_to_depth_pixel(to_pixel.data(), static_cast<const uint16_t*>(data._ptr),
depth_scale, depth_min, depth_max, &depth_intrin, &color_intrin, &depth_to_color,
&color_to_depth, from_pixel.data());
return to_pixel;
};

m.def("rs2_project_color_pixel_to_depth_pixel", cp_to_dp, "data"_a, "depth_scale"_a,
"depth_min"_a, "depth_max"_a, "depth_intrin"_a, "color_intrin"_a, "depth_to_color"_a,
m.def("rs2_project_color_pixel_to_depth_pixel", cp_to_dp, "Given pixel coordinates of the color image and a minimum and maximum depth, compute the corresponding pixel coordinates in the depth image. Returns [-1 -1] on failure.",
"data"_a, "depth_scale"_a, "depth_min"_a, "depth_max"_a, "depth_intrin"_a, "color_intrin"_a, "depth_to_color"_a,
"color_to_depth"_a, "from_pixel"_a);
/** end rsutil.h **/
}

0 comments on commit 7567556

Please sign in to comment.