Skip to content

Commit

Permalink
Merge branch 'release_v2.19.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
themarpe committed Nov 1, 2022
2 parents e170b4d + 0ba40d0 commit d29af8b
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 25 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/main.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: 'recursive'

Expand All @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: 'recursive'

Expand Down Expand Up @@ -71,23 +71,23 @@ jobs:
steps:
- name: Cache .hunter folder
if: matrix.os != 'windows-latest'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.hunter/
key: hunter-${{ matrix.os }}-${{ matrix.cmake }}
- name: Cache .hunter folder
if: matrix.os == 'windows-latest'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: C:/.hunter/
key: hunter-${{ matrix.os }}-${{ matrix.cmake }}

- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.9
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: ${{ matrix.cmake }}

Expand Down Expand Up @@ -147,18 +147,18 @@ jobs:
steps:
- name: Cache .hunter folder
if: matrix.os != 'windows-latest'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.hunter/
key: hunter-${{ matrix.os }}-shared_${{ matrix.shared }}
- name: Cache .hunter folder
if: matrix.os == 'windows-latest'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: C:/.hunter/
key: hunter-${{ matrix.os }}-shared_${{ matrix.shared }}

- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: 'recursive'

Expand Down Expand Up @@ -193,14 +193,14 @@ jobs:

- name: Upload Win64 shared library
if: matrix.os == 'windows-latest' && matrix.shared && matrix.platform == 'x64'
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v3
with:
name: windows-prebuilt-win64
path: ${{ env.GITHUB_WORKSPACE }}/depthai_install/

- name: Upload Win32 shared library
if: matrix.os == 'windows-latest' && matrix.shared && matrix.platform == 'Win32'
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v3
with:
name: windows-prebuilt-win32-no-opencv
path: ${{ env.GITHUB_WORKSPACE }}/depthai_install/
Expand Down Expand Up @@ -234,11 +234,12 @@ jobs:

# Clone repository
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: 'recursive'

# Get tag version
# TODO(themarpe) - Node12, has to be updated
- name: Get latest release version number
id: tag
uses: battila7/get-version-action@v2
Expand All @@ -247,20 +248,20 @@ jobs:
#- name: Check if version matches
# run: |

- uses: actions/setup-python@v2
- uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
run: python3.8 -m pip install git-archive-all

- name: Download Win64 artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: 'windows-prebuilt-win64'
path: depthai-core-${{ steps.tag.outputs.version }}-win64

- name: Download Win32 artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: 'windows-prebuilt-win32-no-opencv'
path: depthai-core-${{ steps.tag.outputs.version }}-win32-no-opencv
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stability.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
timeout-minutes: 1450 # 24h & 10minutes
steps:
- name: Cache .hunter folder
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: $HOME/.hun_vanilla
key: hunter-linux-stability-vanilla
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: 'recursive'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:

steps:
- name: Cache .hunter folder
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: $HOME/.hun2_${{ matrix.flavor }}
key: hunter-${{ matrix.os }}-${{ matrix.cmake }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: 'recursive'

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if(WIN32)
endif()

# Create depthai project
project(depthai VERSION "2.18.0" LANGUAGES CXX C)
project(depthai VERSION "2.19.0" LANGUAGES CXX C)
get_directory_property(has_parent PARENT_DIRECTORY)
if(has_parent)
set(DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "a555263a9dbff1166088bcb758ab4306dca9ae1a")
set(DEPTHAI_DEVICE_SIDE_COMMIT "b3aeaf23ff5857fc8f79d412ceefc08da23e7aad")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
4 changes: 2 additions & 2 deletions cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ hunter_config(
hunter_config(
XLink
VERSION "luxonis-2021.4.2-develop"
URL "https://github.com/luxonis/XLink/archive/4f8cd1f9b2ab1b44e36c448a4b7d5d80255f5872.tar.gz"
SHA1 "fe7aaa8a61ddd7e9030c6c2720978e35a1449fba"
URL "https://github.com/luxonis/XLink/archive/5c61615066af6539e50a4a17b5df3466e4350b21.tar.gz"
SHA1 "25fba41da891743bf0bdff5bc9a5cda07535be49"
)

hunter_config(
Expand Down
7 changes: 7 additions & 0 deletions include/depthai/device/DeviceBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,13 @@ class DeviceBase {
*/
void setTimesync(std::chrono::milliseconds period, int numSamples, bool random);

/**
* Enables or disables Timesync service on device. It keeps host and device clocks in sync.
*
* @param enable Enables or disables consistent timesyncing
*/
void setTimesync(bool enable);

/**
* Explicitly closes connection to device.
* @note This function does not need to be explicitly called
Expand Down
6 changes: 6 additions & 0 deletions include/depthai/device/DeviceBootloader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,12 @@ class DeviceBootloader {
*/
MemoryInfo getMemoryInfo(Memory memory);

/**
* Checks whether User Bootloader is supported with current bootloader
* @returns true of User Bootloader is supported, false otherwise
*/
bool isUserBootloaderSupported();

/**
* Retrieves whether current bootloader is User Bootloader (B out of A/B configuration)
*/
Expand Down
21 changes: 20 additions & 1 deletion src/device/DeviceBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,14 @@ void DeviceBase::tryGetDevice() {
std::tie(found, deviceInfo) = getAnyAvailableDevice();

// If no device found, throw
if(!found) throw std::runtime_error("No available devices");
if(!found) {
auto numConnected = getAllAvailableDevices().size();
if(numConnected > 0) {
throw std::runtime_error(fmt::format("No available devices ({} connected, but in use)", numConnected));
} else {
throw std::runtime_error("No available devices");
}
}
}

DeviceBase::DeviceBase(OpenVINO::Version version, const DeviceInfo& devInfo) : DeviceBase(version, devInfo, DeviceBase::DEFAULT_USB_SPEED) {}
Expand Down Expand Up @@ -948,10 +955,22 @@ bool DeviceBase::removeLogCallback(int callbackId) {
void DeviceBase::setTimesync(std::chrono::milliseconds period, int numSamples, bool random) {
checkClosed();

if(period < std::chrono::milliseconds(10)) {
throw std::invalid_argument("Period must be greater or equal than 10ms");
}

using namespace std::chrono;
pimpl->rpcClient->call("setTimesync", duration_cast<milliseconds>(period).count(), numSamples, random);
}

void DeviceBase::setTimesync(bool enable) {
if(enable) {
setTimesync(DEFAULT_TIMESYNC_PERIOD, DEFAULT_TIMESYNC_NUM_SAMPLES, DEFAULT_TIMESYNC_RANDOM);
} else {
setTimesync(std::chrono::milliseconds(1000), 0, false);
}
}

void DeviceBase::setSystemInformationLoggingRate(float rateHz) {
checkClosed();

Expand Down
16 changes: 15 additions & 1 deletion src/device/DeviceBootloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,20 @@ DeviceBootloader::MemoryInfo DeviceBootloader::getMemoryInfo(Memory memory) {
return mem;
}

bool DeviceBootloader::isUserBootloaderSupported() {
// Check that type is NETWORK
if(getType() != Type::NETWORK) {
return false;
}

// Check if bootloader version is adequate
if(getVersion().getSemver() < Version(Request::IsUserBootloader::VERSION)) {
return false;
}

return true;
}

bool DeviceBootloader::isUserBootloader() {
// Check if bootloader version is adequate
if(getVersion().getSemver() < Version(Request::IsUserBootloader::VERSION)) {
Expand Down Expand Up @@ -884,7 +898,7 @@ std::tuple<bool, std::string> DeviceBootloader::flashUserBootloader(std::functio
// }

// Check if bootloader version is adequate
if(getVersion().getSemver() < Version("0.0.21")) {
if(getVersion().getSemver() < Version(Request::IsUserBootloader::VERSION)) {
throw std::runtime_error("Current bootloader version doesn't support User Bootloader");
}

Expand Down

0 comments on commit d29af8b

Please sign in to comment.