Skip to content

Commit

Permalink
Merge branch 'IntelRealSense:master' into fix_d457_rgb_exp_range
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuys authored Jun 10, 2024
2 parents 40b6df2 + 015c61c commit 005e21b
Show file tree
Hide file tree
Showing 635 changed files with 24,798 additions and 28,853 deletions.
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!--
Pull requests should go to the development branch:
https://github.com/IntelRealSense/librealsense/tree/development/
If this is still a work-in-progress, please open it as DRAFT.
For further details, please see our contribution guidelines:
https://github.com/IntelRealSense/librealsense/blob/master/CONTRIBUTING.md
-->
53 changes: 0 additions & 53 deletions .github/workflows/CMake-minimal-version.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/build-ROS2-package-CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
pull_request:
branches: ['**']

permissions: read-all

jobs:

build_lrs_ros2_package:
Expand Down
53 changes: 31 additions & 22 deletions .github/workflows/buildsCI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: ['**']
pull_request:
branches: ['**']

permissions: read-all

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand Down Expand Up @@ -137,9 +139,9 @@ jobs:
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
shell: bash
run: |
LRS_SRC_DIR=$(pwd)
LRS_SRC_DIR=$(pwd)
cd ${{env.WIN_BUILD_DIR}}
cmake ${LRS_SRC_DIR} -G "Visual Studio 16 2019" -DBUILD_SHARED_LIBS=false -DBUILD_EXAMPLES=false -DBUILD_TOOLS=true -DBUILD_UNIT_TESTS=true -DCHECK_FOR_UPDATES=false -DBUILD_WITH_DDS=false -DPYTHON_EXECUTABLE=${{env.PYTHON_PATH}} -DBUILD_PYTHON_BINDINGS=true
cmake ${LRS_SRC_DIR} -G "Visual Studio 16 2019" -DBUILD_SHARED_LIBS=false -DBUILD_EXAMPLES=false -DBUILD_TOOLS=true -DBUILD_UNIT_TESTS=true -DUNIT_TESTS_ARGS="--not-live --context=windows" -DCHECK_FOR_UPDATES=false -DBUILD_WITH_DDS=false -DPYTHON_EXECUTABLE=${{env.PYTHON_PATH}} -DBUILD_PYTHON_BINDINGS=true
- name: Build
# Build your program with the given configuration
Expand All @@ -154,6 +156,15 @@ jobs:
run: |
python3 unit-tests/run-unit-tests.py --no-color --debug --stdout --not-live --context "windows" ${{env.WIN_BUILD_DIR}}/Release
- name: Client for realsense2-all
shell: bash
run: |
mkdir ${{env.WIN_BUILD_DIR}}/rs-all-client
cd ${{env.WIN_BUILD_DIR}}/rs-all-client
cmake $GITHUB_WORKSPACE/.github/workflows/rs-all-client -G "Visual Studio 16 2019"
cmake --build . --config Release -- -m
./Release/rs-all-client
#--------------------------------------------------------------------------------
Win_SH_Py_DDS_CI: # Windows, Shared, Python, Tools, DDS, libCI without executables
Expand Down Expand Up @@ -249,8 +260,8 @@ jobs:
#--------------------------------------------------------------------------------
U20_ST_Py_EX_CfU_LiveTest: # Ubuntu 2020, Static, Python, Examples & Tools, Check for Updates, Legacy Live-Tests
runs-on: ubuntu-20.04
U22_ST_Py_EX_CfU_LiveTest: # Ubuntu 2022, Static, Python, Examples & Tools, Check for Updates, Legacy Live-Tests
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
Expand All @@ -261,15 +272,11 @@ jobs:
cd scripts && ./api_check.sh && cd ..
mkdir build && cd build
export LRS_LOG_LEVEL="DEBUG";
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test;
sudo apt-get update;
sudo apt-get install -qq build-essential xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev libglm-dev;
sudo apt-get install -qq libusb-1.0-0-dev;
sudo apt-get install -qq libgtk-3-dev;
sudo apt-get install libglfw3-dev libglfw3;
# We force compiling with GCC 7 because the default installed GCC 9 compiled with LTO and gives an internal compiler error
sudo apt-get install gcc-7 g++-7;
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7;
- name: Build
shell: bash
Expand All @@ -292,7 +299,7 @@ jobs:
- name: Upload RS log artifact
uses: actions/upload-artifact@v3
with:
name: Log file - U20_ST_Py_EX_CfU_LiveTest
name: Log file - U22_ST_Py_EX_CfU_LiveTest
path: build/*.log

- name: Provide correct exit status for job
Expand All @@ -316,7 +323,6 @@ jobs:
- name: Prebuild
shell: bash
run: |
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test;
sudo apt-get update;
sudo apt-get install -qq build-essential xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev libglm-dev;
sudo apt-get install -qq libusb-1.0-0-dev;
Expand All @@ -340,7 +346,7 @@ jobs:
shell: bash
run: |
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_RUN_CONFIG}} -DBUILD_SHARED_LIBS=true -DBUILD_EXAMPLES=false -DBUILD_TOOLS=true -DBUILD_UNIT_TESTS=true -DCHECK_FOR_UPDATES=false -DBUILD_WITH_DDS=false -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3)
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_RUN_CONFIG}} -DBUILD_SHARED_LIBS=true -DBUILD_EXAMPLES=false -DBUILD_TOOLS=true -DBUILD_UNIT_TESTS=true -DUNIT_TESTS_ARGS="--not-live --context=linux" -DCHECK_FOR_UPDATES=false -DBUILD_WITH_DDS=false -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3)
cmake --build . -- -j4
- name: LibCI
Expand All @@ -360,7 +366,6 @@ jobs:
- name: Prebuild
shell: bash
run: |
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test;
sudo apt-get update;
sudo apt-get install -qq build-essential xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev libglm-dev;
sudo apt-get install -qq libusb-1.0-0-dev;
Expand Down Expand Up @@ -388,7 +393,16 @@ jobs:
run: |
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_RUN_CONFIG}} -DBUILD_SHARED_LIBS=false -DBUILD_EXAMPLES=false -DBUILD_TOOLS=false -DBUILD_UNIT_TESTS=false -DCHECK_FOR_UPDATES=false -DBUILD_WITH_DDS=true -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3) -DFORCE_RSUSB_BACKEND=true
cmake --build . -- -j4
cmake --build . -- -j4
- name: Client for realsense2-all
shell: bash
run: |
mkdir build/rs-all-client
cd build/rs-all-client
cmake ../../.github/workflows/rs-all-client -DBUILD_WITH_DDS=ON -DFORCE_RSUSB_BACKEND=ON
cmake --build . -- -j4
./rs-all-client
- name: LibCI
# Note: we specifically disable BUILD_UNIT_TESTS so the executable C++ unit-tests won't run
Expand All @@ -399,13 +413,13 @@ jobs:

#--------------------------------------------------------------------------------
U20_SH_RSUSB_LiveTest: # Ubuntu 2020, Shared, Legacy live-tests
runs-on: ubuntu-20.04
U22_SH_RSUSB_LiveTest: # Ubuntu 2022, Shared, Legacy live-tests
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
LRS_BUILD_NODEJS: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Check_API
shell: bash
Expand All @@ -420,15 +434,11 @@ jobs:
set -x
mkdir build
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test;
sudo apt-get update;
sudo apt-get install -qq build-essential xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev libglm-dev;
sudo apt-get install -qq libusb-1.0-0-dev;
sudo apt-get install -qq libgtk-3-dev;
sudo apt-get install libglfw3-dev libglfw3;
# We force compiling with GCC 7 because the default installed GCC 9 compiled with LTO and gives an internal compiler error
sudo apt-get install gcc-7 g++-7;
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7;
- name: Build
shell: bash
Expand All @@ -451,7 +461,7 @@ jobs:
- name: Upload RS log artifact
uses: actions/upload-artifact@v3
with:
name: Log file - U20_SH_RSUSB_LiveTest
name: Log file - U22_SH_RSUSB_LiveTest
path: build/*.log

- name: Provide correct exit status for job
Expand Down Expand Up @@ -519,7 +529,6 @@ jobs:
mkdir build
wget https://dl.google.com/android/repository/android-ndk-r20b-linux-x86_64.zip;
unzip -q android-ndk-r20b-linux-x86_64.zip -d ./;
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test;
sudo apt-get update;
sudo apt-get install -qq build-essential xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev libglm-dev;
sudo apt-get install -qq libusb-1.0-0-dev;
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/rs-all-client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2023 Intel Corporation. All Rights Reserved.
cmake_minimum_required( VERSION 3.15 )

#
# This tests whether we can link with realsense2-all and not have any missing external symbols.
# Without realsense2-all, we'd need to link with:
# realsense2 realsense-file rsutils
# Or, if DDS was enabled:
# realsense2 realsense-file rsutils fastcdr fastrtps foonathan_memory realdds
# And the list gets longer if we add libraries.
#
# On Windows, no additional special libraries are needed.
# On Linux, we have other dependencies:
# libusb udev
# These are not part of realsense2-all, even though we depend on them!
#

project( rs-all-client )

option( BUILD_SHARED_LIBS "Build using shared libraries" OFF )

if( WIN32 )
# Take away the other configurations because they'd require we picked another link
# directory and target... keep it simple...
set( CMAKE_CONFIGURATION_TYPES "Release" )
endif()

add_executable( ${PROJECT_NAME} main.cpp )
set_target_properties( ${PROJECT_NAME} PROPERTIES
CXX_STANDARD 14
MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug> # New in version 3.15; ignored in Linux
)

target_include_directories( ${PROJECT_NAME} PRIVATE
../../../include
../../../third-party/rsutils/include
)
target_link_directories( ${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/../Release )

target_link_libraries( ${PROJECT_NAME} PRIVATE realsense2-all )

if( NOT WIN32 )
find_library( LIBUSB NAMES usb-1.0 )
target_link_libraries( ${PROJECT_NAME} PRIVATE pthread ${LIBUSB} )
if( NOT FORCE_RSUSB_BACKEND )
target_link_libraries( ${PROJECT_NAME} PRIVATE udev )
endif()
if( BUILD_WITH_DDS )
target_link_libraries( ${PROJECT_NAME} PRIVATE ssl crypto rt )
endif()
endif()

56 changes: 56 additions & 0 deletions .github/workflows/rs-all-client/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2023 Intel Corporation. All Rights Reserved.

#include <librealsense2/rs.hpp> // Include RealSense Cross Platform API

#include <rsutils/time/timer.h>
#include <iostream> // for cout
#include <chrono>
#include <thread>

int main(int argc, char * argv[]) try
{
rs2::log_to_console( RS2_LOG_SEVERITY_DEBUG );

rs2::context context;
auto devices = context.query_devices();
if( devices.size() )
{
// This can run under GHA, too -- so we don't always have devices
// Run for just a little bit, count the frames
size_t n_frames = 0;
{
rs2::pipeline p( context );
auto profile = p.start();
auto device = profile.get_device();
std::cout << "Streaming on " << device.get_info( RS2_CAMERA_INFO_NAME ) << std::endl;

rsutils::time::timer timer( std::chrono::seconds( 3 ) );
while( ! timer.has_expired() )
{
// Block program until frames arrive
rs2::frameset frames = p.wait_for_frames();
++n_frames;
}
}

std::cout << "Got " << n_frames << " frames" << std::endl;
}
else
{
// Allow enough time for DDS enumeration
std::this_thread::sleep_for( std::chrono::seconds( 3 ) );
}

return EXIT_SUCCESS;
}
catch (const rs2::error & e)
{
std::cerr << "RealSense error calling " << e.get_failed_function() << "(" << e.get_failed_args() << "):\n " << e.what() << std::endl;
return EXIT_FAILURE;
}
catch (const std::exception& e)
{
std::cerr << e.what() << std::endl;
return EXIT_FAILURE;
}
Loading

0 comments on commit 005e21b

Please sign in to comment.