Skip to content

Commit

Permalink
Ros release 2.26 (#1030)
Browse files Browse the repository at this point in the history
* Throw error when indexing non-existing message, changed example to use disparity

* Improved example

* Clangformat

* Bump fw

* Bump fw

* Bump shared

* Changed syncThreshold setter to use chrono duration

* Bump shared

* Bump fw

* Handle shutdown returning false, bump fw

* Bump fw

* Changed the way crash reports are retrieved

* Bump fw

* Clangformat

* Bump fw

* Bump fw

* IR Intensity API (#924)

* Ir brightness control based on normalized intensity, instead of current.

* Added IR intensity API

* Update docstring. Point to correct device side commit.

* Deprecated ir brightness api, fixed spatial_calculator_multi_roi example.

* Update depthai-shared, update FW.

* Sync shared with device side

* Update shared on device and host

* Bump FW to latest develop

* Bump FW - bumped shared to latest.

* Rename connectivity enum

* Update README

* Minor encframe test fixes

* Bump fw

* Added DEPTHAI_CRASHDUMP_TIMEOUT to determine crashdump timeout

* TODO fix windows test

* Changed crashdump timing

* Bump shared

* Clangformat

* Fix readme

* Bump fw

* Bump shared

* Bump fw and XLink

* Bump fw

* Add an example with IMU

* Add new line at the end of the example

* [RVC2 FW] Update FW with updated shared

* added docstring for fisheye

* Check for crash dump before getting

* Update FW with a stability fix for timesync

* Revert the XLink profiling to uint64_t change

* Update FW and shared to develop

* Fix the xlink profiling

* Bump version to 2.24.0

* Fix build with gcc 13.2 toolchain

To fix a couple compile errors along these lines,

/usr/include/fmt/core.h: In instantiation of 'constexpr fmt::v10::detail::value<Context> fmt::v10::detail::make_arg(T&)
-- snip some typical C++ compiler noise --
src/device/DataQueue.cpp:296:45:   required from here
/usr/include/fmt/core.h:1580:7: error: static assertion failed: Cannot format an argument.

avoid trying to format atomic_t directly, and instead pass in the simple type being
protected by that atomic_t (which in this case, is size_t).

Signed-off-by: S. Lockwood-Childs <[email protected]>

* Bump fw

* Implemented PointCloudData message

* Added PCL support

* PCL Bugfixes

* Added combined target

* Fixed large buffer processing in MessageGroups

* Improved pcl example

* Fix test

* clangformat

* Fix a bug where watchdog is created and destroyed more than once

* Added rgb pointcloud capability

* Revert "Added rgb pointcloud capability"

This reverts commit 56e3c0b.

* Bump shared

* Revert shared

* Bump fw

* Implemented sparse pointclouds

* Clangformat

* Bump fw

* [RVC2] getStereoPairs (#941)

* getStereoPairs. Skip getAvailableStereoPairs for now, since it may give weird results on RAE, or similar setups...

* Formatting

* Added isVertical to serialize

* Updated device side shared

* Impl << operator for StereoPair and vector<StereoPair>

* getAvailableStereoPairs

* Address #941 (comment)

* Bump device side to develop.

* Point shared to develop

* [FW] point to same depthai-shared (ci fix)

* Fix windows build.

* Make the getSystemInformationLoggingRate() function work

* Fix std::initializer_list reassignment

* Added some pointcloud tests

* Add intensity output

* Remove deprecated methods, change toPclData to getPclData

* Added ability to set the lens position via a float, to enable a more precies movement. (#954)

* Added lensPositionRaw to ImgFrame and EncodedFrame

* Updated videoEnc comments so docs will be updated.

* Add missing includes. Fixes #964

* Add fw commit

* Update depthai-shared

* FW: fix CAM_C failing to stream in certain cases,
with same sensor type on CAM_B

* Support for OAK-T (#950)

* thermal node for testing

* Host thermal, for testing

* added nnet experiment, non working... thermal2 experimenting

* Cleanup Thermal node remains, clean up the example.

* [FW] Add support for thermal.

* Sync shared with device side, remove thermal nnet example for now, will add later when it works. Update device side commit.

* Fix  fw build.

* Update examples/Camera/thermal_cam.cpp

Co-authored-by: TheMarpe <[email protected]>

* [FW] detect oak-ts with the new board name

* shared

* [FW] Drive IR leds in torch mode on oak_t. To get max brightness out of the leds both need to be enabled, using: setIrLaserDotProjector... setIrFloodLight... apis

* Fix signal integrity issues at high ambient temperatures.

* Bump shared

* Added some comments to thermal_cam example.

* Merged device side.

* Remove thermal_cam example from tests

---------

Co-authored-by: TheMarpe <[email protected]>

* Add writeCcmEepromRaw RPC

* DataQueue: catch packet parsing errors and return a null packet instead, with an `error` log

* StreamMessageParser: add more details (size etc) to the 'bad packet' exceptions thrown

* Example fixes & improvements, bump fw

* Clangformat

* Bugfix

* ToF: add phase map output

* Changed outdated code

* Reduce amount of pointcloud copying

* Pointcloud test fix

* Tests fix 2

* Fix sparse pointcloud min z, fix tests

* Add missing test argument

* Alway join threads

* Update README.md

* Added transformation matrix support to pointcloud

* Rename functions, update shared

* Update depth align node, fix crash

* Enhance camera features (#973)

* Improve reporting of camera features. Added calibrationResolution and added fov rect to CameraSensorConfig

* FW: -fix `setAutoExposureLimit` flicker during AF lens move,
- IMX214 4K resolution timings were slightly off, also bump max FPS for it (up to 34),
- VideoEncoder fix artifacts for multiple monochrome streams with different resolutions (OV9282 and AR0234),
- fix potential crash with Script GPIO.setInterrupt with too high priority (<= 15, low value = high prio)

* Bump version to 2.25.0

* Fix compiler warning

* Move optimization for config

* Update pointcloud data comments

* Update comments for the PointCloud node

* Expose the pool size for the pointcloud

* Change to RH system

* Update FW to develop

* TMP FW with more logging for bad-packet debugging. Fix ImageManip potential OsDrvCpr crash

* FIx macos build

* Clean up comments

* Remove irrelevant change

* Add decoding pipeline

* Try to fix a FW memory alignment issue

* fix finding jsoncpp

* FW: fix fsync for OAK-D-SR

* Change IMU fw update status to int

* Add cast node

* Fix typo in docstring

* Update Cast node with fixes

* Handle multi input NN

* Update ToF decoding algorithm

* Update FW; fixed optical correction

* Optimize wiggle correction

* Handle edge cases; unsupported distortion coefficients

* Add tilt projection support

* Add phase unwrapping

* Update phase unwrapping, add configurable levels

* Device: add RPC setXLinkRateLimit for device transmit bandwidth throttling

* Introduced `DeviceBootloader::getFlashedVersion` to retrieve the bootloader version flashed on the device. Fixed `isUserBootloaderSupported` - thereby fixed user bootloader flashing. (#997)

* Introduced DeviceBootloader::getFlashedVersion to retrieve the bootloader version flashed on the device. Fixed isUserBootloaderSupported - thereby fixed user bootloader flashing.

* Applied the suggestions

* Fix sensor configs for ov9282/ov9782 (differentiate between color/mono when possible)

* FW: fixes for IMX378 and IMX582:
fix concurrent run,
fix scaling with IMX378 THE_1352X1012 resolution,
change Camera node best sensor config select to prioritize matching aspect ratio

* Optimized decoding pipeline: 60->27 ms

* Add jsoncpp with hunter

* Make PCL include optional

* Fixed booting issue on OAK D SR POE and OAK T. (#1002)

* Fail loudly if PCL enabled, README changes

* Conditionally add jsoncpp package

* Add multi shave support for ToF decoding

* Update ToF decoding: handle arbitrary sensor rotation

* FW: fix default fsync GPIO state for OAK-FFC-4P R7,
FSIN_4LANE GPIO42 = input, pull-down

* Add phaseUnwrappingErrorThreshold config

* Release 2.25.1 (#1005)

* fix finding jsoncpp

* FW: fix fsync for OAK-D-SR

* Change IMU fw update status to int

* Add tilt projection support

* Introduced `DeviceBootloader::getFlashedVersion` to retrieve the bootloader version flashed on the device. Fixed `isUserBootloaderSupported` - thereby fixed user bootloader flashing. (#997)

* Introduced DeviceBootloader::getFlashedVersion to retrieve the bootloader version flashed on the device. Fixed isUserBootloaderSupported - thereby fixed user bootloader flashing.

* Applied the suggestions

* Fix sensor configs for ov9282/ov9782 (differentiate between color/mono when possible)

* FW: fixes for IMX378 and IMX582:
fix concurrent run,
fix scaling with IMX378 THE_1352X1012 resolution,
change Camera node best sensor config select to prioritize matching aspect ratio

* Add jsoncpp with hunter

* Make PCL include optional

* Fixed booting issue on OAK D SR POE and OAK T. (#1002)

* Fail loudly if PCL enabled, README changes

* Conditionally add jsoncpp package

* FW: fix default fsync GPIO state for OAK-FFC-4P R7,
FSIN_4LANE GPIO42 = input, pull-down

* Bumped version to 2.25.1

* Fix FFC3P - not found after booting if ov9282 is connected.

* Make getAllConnectedDevices consistent when no devices are found

---------

Co-authored-by: Serafadam <[email protected]>
Co-authored-by: alex-luxonis <[email protected]>
Co-authored-by: asahtik <[email protected]>
Co-authored-by: SzabolcsGergely <[email protected]>
Co-authored-by: asahtik <[email protected]>
Co-authored-by: Matevz Morato <[email protected]>
Co-authored-by: moratom <[email protected]>

* FW: fix S5K33D ToF streaming when enabled on both sockets B and C,
shared I2C bus

* Fix feature tracker ID type deduction

* FW: fsync shift on custom board

* Add new eeprom content

* Update FW: DepthAlign node implementeD

* Update TOF decoding/eeprom content

* Added enableBurstMode=false and enablePhaseShuffleTemporalFilter=true options.

* Fall back to sensor EEPROM if onboard intrinsics or distortion coefficients are not found

* Update temperature coefficients

* FW, BL: fix a potential bootup/reboot failure,
that required power cycle to recover from

* Update FW; 10 bit amplitude, uint16; temperature calibration version check

* Update interface

* Fix stride size

* (fix mistake in previous commit, FW ver was put in the wrong place)

* Revert "DataQueue: catch packet parsing errors and return a null packet instead, with an `error` log". Note:
reason for revert was underlying cause likely fixed, we'll probably revisit in future and keep exception throwing but not closing the queues on these potential bad packets

This reverts commit 1a48df9.

* Refactor DepthAlign -> ImageAlign

* Remove readCcmEepromRaw, writeCcmEepromRaw

* BL: update to 0.0.28 release version (bootup/restart fixes)

* StreamMessageParser: check end-of-packet bytes, warn on mismatch,
the warning usually can be ignored, but may indicate some issues

* FW: update after merge. Fix style - `make clangformat`

* Fix CI

Remove CMake 3.10 test on macos-latest

* DeviceBootloader: warning for potentially unstable flashed bootloader < 0.0.28

* FW: fix for MessageGroup parsing after the added end-of-packet marker

* StreamMessageParser: apply end-of-packet marker in both directions

* FW: stream parser marker merged, other changes: warp FP16

* Update FW

* FW: ToF double raw stream FPS internally to get depth at configured FPS,
for the default case (non-burst mode). Other ToF changes:
- fix timestamps and sequence numbers
- reduce device CPU load when ToF streams, depending on FPS
- set the proper ToF exposure time in ImgFrame metadata, 796us max
- warnings for FPS capping, 80 max recommended, 88 max possible (with reduced depth quality far away)

* Update FW; handle edge cases

* bump changelog

* remove pcl dependency

* ImageAlign: add multi shave support

* [FW] Update FW with better increased MIPI priority for cameras

* clangformat

* Remove tau character from comments

* Add the align examples

* Remove unused example

* Add the cast examples

* Add the tof depth example

* Add spatial examples for yolo

* [FW] Update FW to develop

* Cleanup

* Clangformat

* Bump version to v2.26.0

* FW: fix timings for OV9282 fsync at 400p on CAM_A

* bump changelog and version

---------

Signed-off-by: S. Lockwood-Childs <[email protected]>
Co-authored-by: asahtik <[email protected]>
Co-authored-by: asahtik <[email protected]>
Co-authored-by: Filip Jeretina <[email protected]>
Co-authored-by: alex-luxonis <[email protected]>
Co-authored-by: alex-luxonis <[email protected]>
Co-authored-by: moratom <[email protected]>
Co-authored-by: Matevz Morato <[email protected]>
Co-authored-by: saching13 <[email protected]>
Co-authored-by: Martin Peterlin <[email protected]>
Co-authored-by: S. Lockwood-Childs <[email protected]>
Co-authored-by: TheMarpe <[email protected]>
Co-authored-by: Jakob Socan <[email protected]>
Co-authored-by: Tommy <[email protected]>
Co-authored-by: Erol444 <[email protected]>
Co-authored-by: Tommy Walker <[email protected]>
Co-authored-by: SzabolcsGergely <[email protected]>
Co-authored-by: jakaskerl <[email protected]>
Co-authored-by: Szabolcs Gergely <[email protected]>
  • Loading branch information
19 people authored May 28, 2024
1 parent 0f57b9d commit 07975e7
Show file tree
Hide file tree
Showing 67 changed files with 2,942 additions and 206 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/main.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ jobs:
exclude:
- os: windows-latest
cmake: '3.10.x'
- os: macos-latest # Skip the old cmake on latest macos - doesn't handle ARM64 aarch correctly
cmake: '3.10.x'

steps:
- name: Cache .hunter folder
Expand Down Expand Up @@ -181,6 +183,9 @@ jobs:
echo "CMAKE_GENERATOR=Visual Studio 17 2022" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CMAKE_GENERATOR_PLATFORM=${{ matrix.platform }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup cmake
uses: jwlawson/[email protected]

- name: Configure ${{ matrix.build-type }}, shared ${{ matrix.shared }}, ${{ matrix.platform }}
run: cmake -S . -B build -D BUILD_SHARED_LIBS=${{ matrix.shared}} -D CMAKE_BUILD_TYPE=${{ matrix.build-type }} -D CMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/depthai_install ${{ env.CMAKE_ARGS }}

Expand Down Expand Up @@ -330,4 +335,4 @@ jobs:
upload_url: ${{ steps.createRelease.outputs.upload_url }}
asset_path: ${{ github.workspace }}/depthai-core-${{ steps.tag.outputs.version }}-win32-no-opencv.zip
asset_name: depthai-core-${{ steps.tag.outputs.version }}-win32-no-opencv.zip
asset_content_type: application/octet-stream
asset_content_type: application/octet-stream
41 changes: 41 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,47 @@
Changelog for package depthai
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.26.0 (2024-05-27)
-----------
* PointCloud node along with the PointCloudData message
* On device pointcloud generation
* Native conversion to PCL message type - similar to getCvFrame()
* Support for the OAK Thermal
* New setManualFocusRaw() API with more granularity for setting manual focus position
* New getStereoPairs() and getAvailableStereoPairs() API to allow more device agnostic programming
* Add the intensity output to the ToF node
* Add the crop sensor configs in getConnectedCameraFeatures() now contain how each of the resolutions is cropped from the native sensor resolution
* Added DeviceBootloader::getFlashedVersion to retrieve the bootloader version that is flashed on device.
* ImageAlign node
* it can align depth to any other sensor on the device - works for ToF too.
* it can align two sensors with each other using intrinsics only, useful for thermal-rgb alignment
* Cast node
* Cast NNData message to ImgFrame
* Useful in case apps need to use outputs from NeuralNetwork node to be fed into nodes that only accept ImgFrame
* Full ToF support
* Running live at 30 FPS
* Measuring range of 20cm - 6m
* < 1% error across the range
* Support for ToF in spatial nodes
* Add an option to limit bandwidth over XLink setXLinkRateLimit(int maxRateBytesPerSecond, int burstSize, int delayUs)
* Bug fix for v2.24.0 regression with flashing the bootloader link
* Bug fix in message groups for large resolution frames when going through XLinkOut node
* Bug fix to apply AE limit during AF lens movement (before the fix, the AE limit wasn't applied during active AF movements)
* Bug fix for grayscale VideoEncoder node with 2 inputs of different sizes
* Fix timings for IMX214 4K resolution, which were slightly off
* Fixed fsync on OAK-D-SR.
* Fixed boot issue on OAK-D-SR-POE and OAK-T.
* Fixed compilation in same cases, because of problems with jsoncpp. (#980)
* Improved PoE stability on reboots - eliminate the case where powercycle of the device was sometimes needed
* Improved runtime stability of heavy pipelines by increasing priority of the cameras in the NoC
* Improved ImageManip stability
* Improved XLink communication to be able to detect memory corruption and avoid it
* Fix a bug where stereo rectification was inaccurate when the calibration data didn't contain direct link between the two inputs
* Relevant for custom setups on FFC devices
* Improve numerical stability of the rectification algorithm
* Improves stereo quality on wide FOV sensors
* Contributors: Alex Bougdan, Szabolcs Gergely, Martin Peterlin

2.24.0 (2024-02-02)
-----------
* New nodes and messages:
Expand Down
93 changes: 87 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ if(NOT WIN32)
set(HUNTER_CONFIGURATION_TYPES "Release" CACHE STRING "Hunter dependencies list of build configurations")
endif()

set(HUNTER_SKIP_PACKAGE_nlohmann_json OFF)
set(BUILD_SHARED_LIBS ON)
# Early options
option(DEPTHAI_ENABLE_LIBUSB "Enable usage of libusb and interaction with USB devices" ON)

Expand Down Expand Up @@ -48,7 +46,7 @@ if(WIN32)
endif()

# Create depthai project
project(depthai VERSION "2.24.0" LANGUAGES CXX C)
project(depthai VERSION "2.26.0" LANGUAGES CXX C)
get_directory_property(has_parent PARENT_DIRECTORY)
if(has_parent)
set(DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE)
Expand Down Expand Up @@ -222,6 +220,7 @@ add_library(${TARGET_CORE_NAME}
src/pipeline/node/DetectionNetwork.cpp
src/pipeline/node/Script.cpp
src/pipeline/node/SpatialDetectionNetwork.cpp
src/pipeline/node/ImageAlign.cpp
src/pipeline/node/SystemLogger.cpp
src/pipeline/node/SpatialLocationCalculator.cpp
src/pipeline/node/AprilTag.cpp
Expand All @@ -232,6 +231,8 @@ add_library(${TARGET_CORE_NAME}
src/pipeline/node/FeatureTracker.cpp
src/pipeline/node/DetectionParser.cpp
src/pipeline/node/UVC.cpp
src/pipeline/node/PointCloud.cpp
src/pipeline/node/Cast.cpp
src/pipeline/datatype/Buffer.cpp
src/pipeline/datatype/ImgFrame.cpp
src/pipeline/datatype/EncodedFrame.cpp
Expand All @@ -252,7 +253,10 @@ add_library(${TARGET_CORE_NAME}
src/pipeline/datatype/EdgeDetectorConfig.cpp
src/pipeline/datatype/TrackedFeatures.cpp
src/pipeline/datatype/FeatureTrackerConfig.cpp
src/pipeline/datatype/ImageAlignConfig.cpp
src/pipeline/datatype/ToFConfig.cpp
src/pipeline/datatype/PointCloudConfig.cpp
src/pipeline/datatype/PointCloudData.cpp
src/pipeline/datatype/MessageGroup.cpp
src/utility/H26xParsers.cpp
src/utility/Initialization.cpp
Expand Down Expand Up @@ -302,6 +306,7 @@ option(DEPTHAI_BUILD_TESTS "Build tests" OFF)
option(DEPTHAI_BUILD_EXAMPLES "Build examples - Requires OpenCV library to be installed" OFF)
option(DEPTHAI_BUILD_DOCS "Build documentation - requires doxygen to be installed" OFF)
option(DEPTHAI_OPENCV_SUPPORT "Enable optional OpenCV support" ON)
option(DEPTHAI_PCL_SUPPORT "Enable optional PCL support" OFF)


option(DEPTHAI_BINARIES_RESOURCE_COMPILE "Compile Depthai device side binaries into library" ON)
Expand Down Expand Up @@ -561,6 +566,74 @@ if(DEPTHAI_OPENCV_SUPPORT)
endif()
endif()


########################
# PCL Support
########################
set(TARGET_PCL_NAME ${PROJECT_NAME}-pcl)
set(TARGET_PCL_ALIAS pcl)
if(DEPTHAI_PCL_SUPPORT)
if(PCL_FOUND)
# Add depthai-core-pcl library and depthai::core::pcl alias
add_library(${TARGET_PCL_NAME} src/pcl/PointCloudData.cpp)
add_library("${PROJECT_NAME}::${TARGET_PCL_ALIAS}" ALIAS ${TARGET_PCL_NAME})
# Specifies name of generated IMPORTED target (set to alias)
set_target_properties(${TARGET_PCL_NAME} PROPERTIES EXPORT_NAME ${TARGET_PCL_ALIAS})

# Add default flags
add_default_flags(${TARGET_PCL_NAME})
add_flag(${TARGET_PCL_NAME} -Wno-switch-enum)

# Link to PCL (publically)
target_link_libraries(${TARGET_PCL_NAME} PUBLIC ${PCL_LIBRARIES})

# Add public compile definition indicating that PCL support is available
set(DEPTHAI_HAVE_PCL_SUPPORT ON)

# Specify that we are building target pcl
target_compile_definitions(${TARGET_PCL_NAME} PUBLIC DEPTHAI_TARGET_PCL)

target_include_directories(${TARGET_PCL_NAME} PUBLIC ${PCL_INCLUDE_DIRS})
target_link_directories(${TARGET_PCL_NAME} PUBLIC ${PCL_LIBRARY_DIRS})
target_compile_definitions(${TARGET_PCL_NAME} PUBLIC ${PCL_DEFINITIONS})

# Add public dependency to depthai::core library
target_include_directories(${TARGET_CORE_NAME} PUBLIC $<TARGET_PROPERTY:${TARGET_PCL_NAME},INTERFACE_INCLUDE_DIRECTORIES>)
target_link_libraries(${TARGET_PCL_NAME} PUBLIC ${TARGET_CORE_NAME})

# Add to clangformat target
if(COMMAND target_clangformat_setup)
target_clangformat_setup(${TARGET_PCL_NAME} "")
endif()

# Add to list of targets to export and install
list(APPEND targets_to_export ${TARGET_PCL_NAME})

message(STATUS "PCL found. PCL Support enabled")

else()
message(STATUS "PCL not found. PCL Support disabled")
endif()
endif()

########################
# Combined target
########################
set(TARGET_ALL_ALIAS all)
set(TARGET_ALL_NAME ${PROJECT_NAME}-all)
if(DEPTHAI_HAVE_OPENCV_SUPPORT AND DEPTHAI_HAVE_PCL_SUPPORT)
add_library(${TARGET_ALL_NAME} INTERFACE)
add_library("${PROJECT_NAME}::${TARGET_ALL_ALIAS}" ALIAS ${TARGET_ALL_NAME})
# Specifies name of generated IMPORTED target (set to alias)
set_target_properties(${TARGET_ALL_NAME} PROPERTIES EXPORT_NAME ${TARGET_ALL_ALIAS})
target_link_libraries(${TARGET_ALL_NAME} INTERFACE ${TARGET_CORE_NAME} ${TARGET_OPENCV_NAME} ${TARGET_PCL_NAME})

# Add to list of targets to export and install
list(APPEND targets_to_export ${TARGET_ALL_NAME})

message(STATUS "OpenCV and PCL found. Combined target enabled")
endif()

########################
# Sanitizers
########################
Expand All @@ -572,6 +645,9 @@ if(DEPTHAI_SANITIZE)
if(DEPTHAI_HAVE_OPENCV_SUPPORT)
add_sanitizers(${TARGET_OPENCV_NAME})
endif()
if(DEPTHAI_HAVE_PCL_SUPPORT)
add_sanitizers(${TARGET_PCL_NAME})
endif()
if(DEPTHAI_XLINK_LOCAL)
add_sanitizers(XLink)
if(XLINK_LIBUSB_LOCAL)
Expand Down Expand Up @@ -614,7 +690,7 @@ endif()
string(TIMESTAMP BUILD_DATETIME "%Y-%m-%d %H:%M:%S +0000" UTC)
message(STATUS "BUILD_DATETIME: ${BUILD_DATETIME}, BUILD_COMMIT: ${BUILD_COMMIT}, BUILD_COMMIT_DATETIME: ${BUILD_COMMIT_DATETIME}")

# Configure build information (version, opencv support)
# Configure build information (version, opencv, pcl support)
configure_file("${CMAKE_CURRENT_LIST_DIR}/cmake/version.hpp.in" "${CMAKE_CURRENT_LIST_DIR}/include/depthai/build/version.hpp")
configure_file("${CMAKE_CURRENT_LIST_DIR}/cmake/config.hpp.in" "${CMAKE_CURRENT_LIST_DIR}/include/depthai/build/config.hpp")

Expand Down Expand Up @@ -723,6 +799,11 @@ if(DEPTHAI_HAVE_OPENCV_SUPPORT)
$<$<BOOL:${tmp_includes}>:\n-I\'$<JOIN:${tmp_includes},\'\n-I\'>\'>\n"
)
endif()
if ( ament_cmake_FOUND )
ament_package()
if(DEPTHAI_HAVE_PCL_SUPPORT)
set(tmp_definitions "$<TARGET_PROPERTY:${TARGET_PCL_NAME},INTERFACE_COMPILE_DEFINITIONS>")
set(tmp_includes "$<TARGET_PROPERTY:${TARGET_PCL_NAME},INTERFACE_INCLUDE_DIRECTORIES>")
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/depthai-pcl-integration.txt" CONTENT
"$<$<BOOL:${tmp_definitions}>:\n-D\'$<JOIN:${tmp_definitions},\'\n-D\'>\'>\n
$<$<BOOL:${tmp_includes}>:\n-I\'$<JOIN:${tmp_includes},\'\n-I\'>\'>\n"
)
endif()
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ DepthAI library doesn't yet provide API stability guarantees. While we take care
- CMake >= 3.10
- C/C++14 compiler
- [optional] OpenCV 4 (required if building examples)
- [optional] PCL (required for point cloud example)

MacOS: Optional `brew install opencv`
To install OpenCV:
MacOS: `brew install opencv`
Linux: `sudo apt install libopencv-dev`

Linux: Optional `sudo apt install libopencv-dev`
To install PCL:
MacOS: `brew install pcl`
Linux: `sudo apt install libpcl-dev`

## Building

Expand Down Expand Up @@ -189,6 +194,7 @@ The following environment variables can be set to alter default behavior of the
| DEPTHAI_LIBUSB_ANDROID_JAVAVM | JavaVM pointer that is passed to libusb for rootless Android interaction with devices. Interpreted as decimal value of uintptr_t |
| DEPTHAI_CRASHDUMP | Directory in which to save the crash dump. |
| DEPTHAI_CRASHDUMP_TIMEOUT | Specifies the duration in seconds to wait for device reboot when obtaining a crash dump. Crash dump retrieval disabled if 0. |
| DEPTHAI_PCL_SUPPORT | Enables PCL support. |

## Running tests

Expand Down
4 changes: 2 additions & 2 deletions cmake/Depthai/DepthaiBootloaderConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ set(DEPTHAI_BOOTLOADER_MATURITY "release")
# set(DEPTHAI_BOOTLOADER_MATURITY "snapshot")

# "version if applicable"
set(DEPTHAI_BOOTLOADER_VERSION "0.0.26")
# set(DEPTHAI_BOOTLOADER_VERSION "0.0.24+57c26493754e2f00e57f6594b0b1a317f762d5f2")
set(DEPTHAI_BOOTLOADER_VERSION "0.0.28")
# set(DEPTHAI_BOOTLOADER_VERSION "0.0.27+5fb331f993adceeeda72202c233a9e3939ab3dab")
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 "a95f582a61ec9bdbd0f72dec84822455872ffaf7")
set(DEPTHAI_DEVICE_SIDE_COMMIT "24a3b465b979de3f69410cd225914d8bd029f3ba")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
12 changes: 12 additions & 0 deletions cmake/config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// This build supports OpenCV integration?
#cmakedefine DEPTHAI_HAVE_OPENCV_SUPPORT

// This build supports PCL integration?
#cmakedefine DEPTHAI_HAVE_PCL_SUPPORT

// This build supports libusb?
#cmakedefine DEPTHAI_HAVE_LIBUSB_SUPPORT

Expand All @@ -14,6 +17,9 @@
#ifndef DEPTHAI_TARGET_OPENCV
#undef DEPTHAI_HAVE_OPENCV_SUPPORT
#endif
#ifndef DEPTHAI_TARGET_PCL
#undef DEPTHAI_HAVE_PCL_SUPPORT
#endif
#endif

namespace dai
Expand All @@ -27,6 +33,12 @@ namespace build
constexpr static bool HAVE_OPENCV_SUPPORT = false;
#endif

#ifdef DEPTHAI_HAVE_PCL_SUPPORT
constexpr static bool HAVE_PCL_SUPPORT = true;
#else
constexpr static bool HAVE_PCL_SUPPORT = false;
#endif

#ifdef DEPTHAI_HAVE_LIBUSB_SUPPORT
constexpr static bool HAVE_LIBUSB_SUPPORT = true;
#else
Expand Down
16 changes: 16 additions & 0 deletions cmake/depthaiDependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
if(CONFIG_MODE)
set(_DEPTHAI_PREFIX_PATH_ORIGINAL ${CMAKE_PREFIX_PATH})
set(_DEPTHAI_MODULE_PATH_ORIGINAL ${CMAKE_MODULE_PATH})
set(_DEPTHAI_FIND_ROOT_PATH_MODE_PACKAGE_ORIGINAL ${CMAKE_FIND_ROOT_PATH_MODE_PACKAGE})
# Fixes Android NDK build, where prefix path is ignored as its not inside sysroot
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE "BOTH")
Expand All @@ -25,6 +26,9 @@ else()
hunter_add_package(Backward)
endif()
hunter_add_package(libnop)
if(DEPTHAI_PCL_SUPPORT)
hunter_add_package(jsoncpp)
endif()
endif()

# If library was build as static, find all dependencies
Expand Down Expand Up @@ -79,6 +83,18 @@ endif()

# OpenCV 4 - (optional, quiet always)
find_package(OpenCV 4 QUIET CONFIG)
if(DEPTHAI_PCL_SUPPORT AND NOT TARGET JsonCpp::JsonCpp)
find_package(jsoncpp)
endif()
set(MODULE_TEMP ${CMAKE_MODULE_PATH})
set(PREFIX_TEMP ${CMAKE_PREFIX_PATH})
set(CMAKE_MODULE_PATH ${_DEPTHAI_MODULE_PATH_ORIGINAL})
set(CMAKE_PREFIX_PATH ${_DEPTHAI_PREFIX_PATH_ORIGINAL})
if(DEPTHAI_PCL_SUPPORT)
find_package(PCL CONFIG COMPONENTS common visualization)
endif()
set(CMAKE_MODULE_PATH ${MODULE_TEMP})
set(CMAKE_PREFIX_PATH ${PREFIX_TEMP})

# include optional dependency cmake
if(DEPTHAI_DEPENDENCY_INCLUDE)
Expand Down
Loading

0 comments on commit 07975e7

Please sign in to comment.