depthai-python icon indicating copy to clipboard operation
depthai-python copied to clipboard

Color/MonoCamera frameEvent output, per-frame IR control

Open alex-luxonis opened this issue 2 years ago • 4 comments

See description on related PR: https://github.com/luxonis/depthai-core/pull/451

Added MonoCamera/mono_preview_alternate_pro.py example: using a Script node on-device for controlling the IR projector and routing the frames to separate output pairs: dotL+dotR and floodL+floodR.

alex-luxonis avatar Apr 13 '22 02:04 alex-luxonis

When Testing this I had to invert the logic for choosing the dot and flood frames.

PeterQFR avatar Jun 16 '22 00:06 PeterQFR

@alex-luxonis Any idea when this will be reviewed and merged?

PeterQFR avatar Jun 16 '22 00:06 PeterQFR

When this is merged, will that update the interfaces available in the depthai-core library?

PeterQFR avatar Aug 01 '22 04:08 PeterQFR

As per discord, I found that the turning off of the dot projector takes a bit of time, and if the autoexposure can pick up the tail end of this, so that you have dots in some of your images. Apart from disabling autoexposure, I found that if the projectors were switched off earlier then this was less of an issue. eg

script_->setScript(R"(
        dotBright = 700
        floodBright = 0
        node.warn(f'IR drivers detected: {str(Device.getIrDrivers())}')
        flagDot = False
        while True:
            # Wait first for a frame event, received at MIPI start-of-frame
            event = node.io['event'].get()
            # Immediately reconfigure the IR driver.
            # Note the logic is inverted, as it applies for next frame
            Device.setIrLaserDotProjectorBrightness(0 if  flagDot else dotBright)
            Device.setIrFloodLightBrightness(floodBright if  flagDot else 0)
            
            # Wait for the actual frames (after MIPI capture and ISP proc is done)
            frameL = node.io['frameL'].get()
            frameR = node.io['frameR'].get()
            
            # Turn off the projectors earlier as this seems to take more time.
            Device.setIrLaserDotProjectorBrightness(0 if not flagDot else dotBright)
            Device.setIrFloodLightBrightness(floodBright if not flagDot else 0)
            
            # Route the frames to their respective outputs
            node.io['dotL' if not flagDot else 'floodL'].send(frameL)
            node.io['dotR' if not flagDot else 'floodR'].send(frameR)
            flagDot = not flagDot

            )"
            );

PeterQFR avatar Aug 16 '22 00:08 PeterQFR

Hi @alex-luxonis @szabi-luxonis when will this be merged into main?

Its just I received a new OAK-D Pro Partno A00565 and It doesn't work with this branch anymore. Doesn't recognise calibration params and the mono cameras don't come up.

Alternatively if you can update this branch that would help me.

PeterQFR avatar Sep 08 '22 11:09 PeterQFR

Alternatively which branch should I merge into the depth-ai core, which is the actual repo I am using. Is it main or development?

PeterQFR avatar Sep 09 '22 06:09 PeterQFR

@alex-luxonis I think I will need help in identifying a correct device side commit for merging devlop into this branch. I am assuming that is from a non-open repository?

PeterQFR avatar Sep 11 '22 01:09 PeterQFR

@PeterQFR The branch was updated with the latest development, and a sync issue fixed in the example - commit above, by increasing the number of frames in the pool. (Another option could be to sync and get latest frames inside the Script node.)

Could you check if any issue is still seen. Thanks!

alex-luxonis avatar Sep 19 '22 11:09 alex-luxonis

Hi @alex-luxonis I've pulled this code in however, I had an issue.

[1944301051BBED1200] [3.1] [6.901] [system] [critical] Fatal error. Please report to developers. Log: 'Fatal error on MSS CPU: trap: 00, address: 00000000' '0'
terminate called after throwing an instance of 'std::runtime_error'
  what():  Communication exception - possible device error/misconfiguration. Original message 'Couldn't read data from stream: 'rgb' (X_LINK_ERROR)'

Because Its taken me too long to test this, I wasn't able to test against the ir_frame_develop branch as it had been deleted. so this is from a merge from develop commit a78ea3bac1695254c02b5ee066ba3c3312b8367e in depthai-core

PeterQFR avatar Nov 14 '22 02:11 PeterQFR

Hi @PeterQFR , could you try on the latest release v2.19.1.0 (current main branch), we have fixed some issues since then. Also have you tested with examples/MonoCamera/mono_preview_alternate_pro.py, or a different app/script?

alex-luxonis avatar Nov 14 '22 03:11 alex-luxonis

Will do thanks

PeterQFR avatar Nov 14 '22 03:11 PeterQFR

@alex-luxonis did go though the local install of a wheel of the depthai-python but it failed with

/libXLink.a(PlatformDeviceFd.cpp.o): relocation R_X86_64_PC32 against symbol `_ZNSt13unordered_mapImPvSt4hashImESt8equal_toImESaISt4pairIKmS0_EEED1Ev' can not be used when making a shared object; recompile with -fPIC

The full compile fail output:

/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
/usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
Defaulting to user installation because normal site-packages is not writeable
Processing /home/peter-laptop/depthai-python
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: depthai
  Building wheel for depthai (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for depthai (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [434 lines of output]
      running bdist_wheel
      running build
      running build_ext
      -- The C compiler identification is GNU 9.4.0
      -- The CXX compiler identification is GNU 9.4.0
      -- Check for working C compiler: /usr/lib/ccache/cc
      -- Check for working C compiler: /usr/lib/ccache/cc -- works
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Check for working CXX compiler: /usr/lib/ccache/c++
      -- Check for working CXX compiler: /usr/lib/ccache/c++ -- works
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Generating new toolchain...
      -- Using toolchain file: /home/peter-laptop/depthai-python/build/temp.linux-x86_64-cpython-38/depthai-core/generated/toolchain.cmake
      -- Found Git: /usr/bin/git (found version "2.25.1")
      -- [hunter] Calculating Toolchain-SHA1
      -- [hunter] Calculating Config-SHA1
      -- [hunter] HUNTER_ROOT: /home/peter-laptop/.hunter
      -- [hunter] [ Hunter-ID: cb0ea1f | Toolchain-ID: a3a48bb | Config-ID: ee90518 ]
      -- [hunter] NLOHMANN_JSON_ROOT: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install (ver.: 3.9.1)
      -- [hunter] XLINK_ROOT: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install (ver.: luxonis-2021.4.2-develop)
      -- [hunter] BZIP2_ROOT: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install (ver.: 1.0.8-p0)
      -- [hunter] FP16_ROOT: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install (ver.: luxonis-0.0.0)
      -- [hunter] LIBARCHIVE-LUXONIS_ROOT: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install (ver.: hunter-3.5.2)
      -- [hunter] SPDLOG_ROOT: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install (ver.: 1.8.2)
      -- [hunter] ZLIB_ROOT: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install (ver.: 1.2.11-p2)
      -- [hunter] BACKWARD_ROOT: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install (ver.: 1.6)
      -- [hunter] LIBNOP_ROOT: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install (ver.: 1.0-ec8f75a)
      -- Looking for pthread.h
      -- Looking for pthread.h - found
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
      -- Looking for pthread_create in pthreads
      -- Looking for pthread_create in pthreads - not found
      -- Looking for pthread_create in pthread
      -- Looking for pthread_create in pthread - found
      -- Found Threads: TRUE
      -- Found Backward: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install/lib/backward
      -- Found nlohmann_json: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found suitable version "3.9.1", minimum required is "3.6.0")
      -- Checking file: /home/peter-laptop/depthai-python/depthai-core/shared/depthai-shared/src/datatype/DatatypeEnum.cpp
      -- Checking file: /home/peter-laptop/depthai-python/depthai-core/shared/depthai-shared/src/utility/Checksum.cpp
      -- Performing Test COMPILER_SUPPORTS_CXX14
      -- Performing Test COMPILER_SUPPORTS_CXX14 - Success
      -- Performing Test COMPILER_SUPPORTS_CXX17
      -- Performing Test COMPILER_SUPPORTS_CXX17 - Success
      -- Performing Test COMPILER_SUPPORTS_CXX20
      -- Performing Test COMPILER_SUPPORTS_CXX20 - Failed
      -- Performing Test COMPILER_SUPPORTS_CXX23
      -- Performing Test COMPILER_SUPPORTS_CXX23 - Failed
      -- Performing Test FLAG_-Wall
      -- Performing Test FLAG_-Wall - Success
      -- Performing Test FLAG_-Wextra
      -- Performing Test FLAG_-Wextra - Success
      -- Performing Test FLAG_-Woverloaded-virtual
      -- Performing Test FLAG_-Woverloaded-virtual - Success
      -- Performing Test FLAG_-Wformat=2
      -- Performing Test FLAG_-Wformat=2 - Success
      -- Performing Test FLAG_-Wmisleading-indentation
      -- Performing Test FLAG_-Wmisleading-indentation - Success
      -- Performing Test FLAG_-Wduplicated-cond
      -- Performing Test FLAG_-Wduplicated-cond - Success
      -- Performing Test FLAG_-Wduplicated-branches
      -- Performing Test FLAG_-Wduplicated-branches - Success
      -- Performing Test FLAG_-Wnull-dereference
      -- Performing Test FLAG_-Wnull-dereference - Success
      -- Performing Test FLAG_-Wdouble-promotion
      -- Performing Test FLAG_-Wdouble-promotion - Success
      -- Performing Test FLAG_-Wsign-compare
      -- Performing Test FLAG_-Wsign-compare - Success
      -- Performing Test FLAG_-Wtype-limits
      -- Performing Test FLAG_-Wtype-limits - Success
      -- Performing Test FLAG_-Werror=self-assign-field
      -- Performing Test FLAG_-Werror=self-assign-field - Failed
      -- Performing Test FLAG_-Werror=unused-lambda-capture
      -- Performing Test FLAG_-Werror=unused-lambda-capture - Failed
      -- Performing Test FLAG_-Werror=return-type
      -- Performing Test FLAG_-Werror=return-type - Success
      -- Performing Test FLAG_-Werror=non-virtual-dtor
      -- Performing Test FLAG_-Werror=non-virtual-dtor - Success
      -- Performing Test FLAG_-Werror=sign-compare
      -- Performing Test FLAG_-Werror=sign-compare - Success
      -- Performing Test FLAG_-Werror=reorder
      -- Performing Test FLAG_-Werror=reorder - Success
      -- Performing Test FLAG_-Werror=switch-enum
      -- Performing Test FLAG_-Werror=switch-enum - Success
      -- Compiling depthai-core resources in PATCH_ONLY mode
      -- Downloading Depthai device side binaries from server...
      -- Downloading depthai and patch
      -- commit: 52fb1b4c0ada7d57c9999822a6b8f4c81bf6932b
      -- depthai-shared between device and host MATCH!. (device: 52fb1b4c0ada7d57c9999822a6b8f4c81bf6932b, host: 52fb1b4c0ada7d57c9999822a6b8f4c81bf6932b
      -- Downloading and checking depthai-device-fwp.tar.xz
      -- [download 0% complete]
      -- [download 1% complete]
      -- [download 2% complete]
      -- [download 3% complete]
      -- [download 4% complete]
      -- [download 5% complete]
      -- [download 6% complete]
      -- [download 7% complete]
      -- [download 8% complete]
      -- [download 9% complete]
      -- [download 10% complete]
      -- [download 11% complete]
      -- [download 12% complete]
      -- [download 13% complete]
      -- [download 14% complete]
      -- [download 15% complete]
      -- [download 16% complete]
      -- [download 17% complete]
      -- [download 18% complete]
      -- [download 19% complete]
      -- [download 20% complete]
      -- [download 21% complete]
      -- [download 22% complete]
      -- [download 23% complete]
      -- [download 24% complete]
      -- [download 25% complete]
      -- [download 26% complete]
      -- [download 27% complete]
      -- [download 28% complete]
      -- [download 29% complete]
      -- [download 30% complete]
      -- [download 31% complete]
      -- [download 32% complete]
      -- [download 33% complete]
      -- [download 34% complete]
      -- [download 35% complete]
      -- [download 47% complete]
      -- [download 48% complete]
      -- [download 49% complete]
      -- [download 65% complete]
      -- [download 68% complete]
      -- [download 69% complete]
      -- [download 80% complete]
      -- [download 81% complete]
      -- [download 82% complete]
      -- [download 83% complete]
      -- [download 85% complete]
      -- [download 88% complete]
      -- [download 99% complete]
      -- [download 100% complete]
      -- Downloading depthai bootloader
      -- folder: /home/peter-laptop/depthai-python/build/temp.linux-x86_64-cpython-38/depthai-core/resources
      -- maturity: release
      -- commit_version_arg: 0.0.21
      -- bootloader shared commit: b287ecbacd3b0c963b5dfcf95767123b0c143b57
      -- depthai-bootloader-shared between device and host MATCH!. (device: b287ecbacd3b0c963b5dfcf95767123b0c143b57, host: b287ecbacd3b0c963b5dfcf95767123b0c143b57
      -- Downloading and checking depthai-bootloader-fwp.tar.xz
      -- [download 1% complete]
      -- [download 3% complete]
      -- [download 4% complete]
      -- [download 5% complete]
      -- [download 6% complete]
      -- [download 8% complete]
      -- [download 10% complete]
      -- [download 13% complete]
      -- [download 14% complete]
      -- [download 15% complete]
      -- [download 16% complete]
      -- [download 17% complete]
      -- [download 18% complete]
      -- [download 19% complete]
      -- [download 20% complete]
      -- [download 22% complete]
      -- [download 23% complete]
      -- [download 24% complete]
      -- [download 26% complete]
      -- [download 27% complete]
      -- [download 29% complete]
      -- [download 30% complete]
      -- [download 32% complete]
      -- [download 33% complete]
      -- [download 34% complete]
      -- [download 36% complete]
      -- [download 37% complete]
      -- [download 39% complete]
      -- [download 40% complete]
      -- [download 42% complete]
      -- [download 43% complete]
      -- [download 44% complete]
      -- [download 45% complete]
      -- [download 48% complete]
      -- [download 50% complete]
      -- [download 53% complete]
      -- [download 54% complete]
      -- [download 57% complete]
      -- [download 59% complete]
      -- [download 60% complete]
      -- [download 62% complete]
      -- [download 65% complete]
      -- [download 66% complete]
      -- [download 69% complete]
      -- [download 70% complete]
      -- [download 73% complete]
      -- [download 75% complete]
      -- [download 76% complete]
      -- [download 79% complete]
      -- [download 80% complete]
      -- [download 81% complete]
      -- [download 84% complete]
      -- [download 87% complete]
      -- [download 90% complete]
      -- [download 92% complete]
      -- [download 93% complete]
      -- [download 95% complete]
      -- [download 96% complete]
      -- [download 99% complete]
      -- [download 100% complete]
      -- LIST OF RESOURCE COMPILED FILES: /home/peter-laptop/depthai-python/build/temp.linux-x86_64-cpython-38/depthai-core/resources/depthai-device-fwp-adbcc016c8bd5a5580a26d8b6250f77160203666.tar.xz;/home/peter-laptop/depthai-python/build/temp.linux-x86_64-cpython-38/depthai-core/resources/depthai-bootloader-fwp-0.0.21.tar.xz
      -- Check for working incbin assembly directive
      -- Check for working incbin assembly directive - works
      -- Performing Test FLAG_-Wno-switch-enum
      -- Performing Test FLAG_-Wno-switch-enum - Success
      -- OpenCV and required libraries (opencv_core;opencv_imgproc) found. OpenCV Support enabled
      -- BUILD_DATETIME: 2022-11-14 06:01:13 +0000, BUILD_COMMIT: 690b6a637942cd56959c549c8e4be07aee676385, BUILD_COMMIT_DATETIME: 2022-11-13 19:26:20 +0100
      -- [hunter] HUNTER_ROOT: /home/peter-laptop/.hunter
      -- [hunter] [ Hunter-ID: cb0ea1f | Toolchain-ID: a3a48bb | Config-ID: ee90518 ]
      -- [hunter] PYBIND11_ROOT: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install (ver.: 2.9.2)
      -- Found PythonInterp: /usr/bin/python3 (found version "3.8.10")
      -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so
      -- Performing Test HAS_FLTO
      -- Performing Test HAS_FLTO - Success
      -- Found pybind11: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install/include (found version "2.9.2")
      -- Mypy available, creating and checking stubs. Running with generate_stubs.py depthai /home/peter-laptop/depthai-python/build/lib.linux-x86_64-cpython-38/
      -- Checking for pybind11_mkdoc
      -- Checking for pybind11_mkdoc - not found, docstrings not available
      -- Configuring done
      -- Generating done
      CMake Warning:
        Manually-specified variables were not used by the project:
      
          HUNTER_JOBS_NUMBER
      
      
      -- Build files have been written to: /home/peter-laptop/depthai-python/build/temp.linux-x86_64-cpython-38
      [  2%] Generating depthai-resources resource loader
      [  2%] Generating intermediate file for /home/peter-laptop/depthai-python/build/temp.linux-x86_64-cpython-38/depthai-core/resources/depthai-device-fwp-adbcc016c8bd5a5580a26d8b6250f77160203666.tar.xz
      [  2%] Generating intermediate file for /home/peter-laptop/depthai-python/build/temp.linux-x86_64-cpython-38/depthai-core/resources/depthai-bootloader-fwp-0.0.21.tar.xz
      Scanning dependencies of target depthai-resources
      [  5%] Building CXX object depthai-core/CMakeFiles/depthai-resources.dir/__cmrc_depthai-resources/intermediate/depthai-bootloader-fwp-0.0.21.tar.xz.cpp.o
      [  5%] Building CXX object depthai-core/CMakeFiles/depthai-resources.dir/__cmrc_depthai-resources/lib.cpp.o
      [  5%] Building CXX object depthai-core/CMakeFiles/depthai-resources.dir/__cmrc_depthai-resources/intermediate/depthai-device-fwp-adbcc016c8bd5a5580a26d8b6250f77160203666.tar.xz.cpp.o
      [  6%] Linking CXX static library libdepthai-resources.a
      [  6%] Built target depthai-resources
      Scanning dependencies of target depthai-core
      [  7%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/shared/depthai-shared/src/utility/Checksum.cpp.o
      [  7%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/shared/depthai-shared/src/datatype/DatatypeEnum.cpp.o
      [ 10%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/shared/depthai-bootloader-shared/src/Bootloader.cpp.o
      [ 10%] Building C object depthai-core/CMakeFiles/depthai-core.dir/shared/depthai-bootloader-shared/src/SBR.c.o
      [ 10%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/device/Device.cpp.o
      [ 11%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/device/DeviceBootloader.cpp.o
      [ 11%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/device/DeviceBase.cpp.o
      [ 12%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/device/DataQueue.cpp.o
      [ 13%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/device/CallbackHandler.cpp.o
      [ 14%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/device/CalibrationHandler.cpp.o
      [ 14%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/device/Version.cpp.o
      [ 15%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/Pipeline.cpp.o
      [ 16%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/AssetManager.cpp.o
      [ 17%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/Node.cpp.o
      [ 18%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/XLinkOut.cpp.o
      [ 18%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/XLinkIn.cpp.o
      [ 19%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/ColorCamera.cpp.o
      [ 20%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/MonoCamera.cpp.o
      [ 20%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/StereoDepth.cpp.o
      [ 21%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/ImageManip.cpp.o
      [ 22%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/NeuralNetwork.cpp.o
      [ 23%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/Warp.cpp.o
      [ 23%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/VideoEncoder.cpp.o
      [ 24%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/Script.cpp.o
      [ 25%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/SpatialDetectionNetwork.cpp.o
      [ 26%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/DetectionNetwork.cpp.o
      [ 26%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/SystemLogger.cpp.o
      [ 27%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/SpatialLocationCalculator.cpp.o
      [ 27%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/IMU.cpp.o
      [ 28%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/AprilTag.cpp.o
      [ 29%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/ObjectTracker.cpp.o
      [ 30%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/EdgeDetector.cpp.o
      [ 31%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/SPIIn.cpp.o
      [ 32%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/FeatureTracker.cpp.o
      [ 33%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/node/DetectionParser.cpp.o
      [ 33%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/Buffer.cpp.o
      [ 34%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/ImgFrame.cpp.o
      [ 35%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/ImageManipConfig.cpp.o
      [ 36%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/NNData.cpp.o
      [ 36%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/CameraControl.cpp.o
      [ 37%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/ImgDetections.cpp.o
      [ 38%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/SpatialImgDetections.cpp.o
      [ 39%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/SystemInformation.cpp.o
      [ 39%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/StreamMessageParser.cpp.o
      [ 40%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/SpatialLocationCalculatorData.cpp.o
      [ 41%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/SpatialLocationCalculatorConfig.cpp.o
      [ 41%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/AprilTagConfig.cpp.o
      [ 42%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/AprilTags.cpp.o
      [ 43%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/IMUData.cpp.o
      [ 44%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/Tracklets.cpp.o
      [ 45%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/StereoDepthConfig.cpp.o
      [ 45%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/EdgeDetectorConfig.cpp.o
      [ 46%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/TrackedFeatures.cpp.o
      [ 47%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/pipeline/datatype/FeatureTrackerConfig.cpp.o
      [ 48%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/utility/Path.cpp.o
      [ 50%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/utility/Initialization.cpp.o
      [ 50%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/utility/Resources.cpp.o
      [ 51%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/utility/Platform.cpp.o
      [ 52%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/utility/Environment.cpp.o
      [ 52%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/xlink/XLinkConnection.cpp.o
      [ 53%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/xlink/XLinkStream.cpp.o
      [ 54%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/openvino/BlobReader.cpp.o
      [ 55%] Building CXX object depthai-core/CMakeFiles/depthai-core.dir/src/openvino/OpenVINO.cpp.o
      [ 55%] Building C object depthai-core/CMakeFiles/depthai-core.dir/src/bspatch/bspatch.c.o
      [ 56%] Linking CXX static library libdepthai-core.a
      [ 56%] Built target depthai-core
      Scanning dependencies of target depthai-opencv
      [ 57%] Building CXX object depthai-core/CMakeFiles/depthai-opencv.dir/src/opencv/ImgFrame.cpp.o
      [ 57%] Linking CXX static library libdepthai-opencv.a
      [ 57%] Built target depthai-opencv
      Scanning dependencies of target depthai
      [ 59%] Building CXX object CMakeFiles/depthai.dir/src/DeviceBindings.cpp.o
      [ 59%] Building CXX object CMakeFiles/depthai.dir/src/CalibrationHandlerBindings.cpp.o
      [ 59%] Building CXX object CMakeFiles/depthai.dir/src/py_bindings.cpp.o
      [ 60%] Building CXX object CMakeFiles/depthai.dir/src/XLinkBindings.cpp.o
      [ 60%] Building CXX object CMakeFiles/depthai.dir/src/DeviceBootloaderBindings.cpp.o
      [ 61%] Building CXX object CMakeFiles/depthai.dir/src/DatatypeBindings.cpp.o
      [ 62%] Building CXX object CMakeFiles/depthai.dir/src/DataQueueBindings.cpp.o
      [ 63%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/PipelineBindings.cpp.o
      [ 63%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/CommonBindings.cpp.o
      [ 64%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/AssetManagerBindings.cpp.o
      [ 65%] Building CXX object CMakeFiles/depthai.dir/src/openvino/OpenVINOBindings.cpp.o
      [ 66%] Building CXX object CMakeFiles/depthai.dir/src/log/LogBindings.cpp.o
      [ 66%] Building CXX object CMakeFiles/depthai.dir/src/VersionBindings.cpp.o
      [ 67%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/NodeBindings.cpp.o
      [ 68%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/XLinkInBindings.cpp.o
      [ 69%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/XLinkOutBindings.cpp.o
      [ 69%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/ColorCameraBindings.cpp.o
      [ 70%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/MonoCameraBindings.cpp.o
      [ 71%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/StereoDepthBindings.cpp.o
      [ 72%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/NeuralNetworkBindings.cpp.o
      [ 72%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/VideoEncoderBindings.cpp.o
      [ 73%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/ImageManipBindings.cpp.o
      [ 74%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/SPIOutBindings.cpp.o
      [ 75%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/SPIInBindings.cpp.o
      [ 75%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/DetectionNetworkBindings.cpp.o
      [ 76%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/SystemLoggerBindings.cpp.o
      [ 77%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/ScriptBindings.cpp.o
      [ 78%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/SpatialLocationCalculatorBindings.cpp.o
      [ 78%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/SpatialDetectionNetworkBindings.cpp.o
      [ 79%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/ObjectTrackerBindings.cpp.o
      [ 80%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/IMUBindings.cpp.o
      [ 81%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/EdgeDetectorBindings.cpp.o
      [ 82%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/FeatureTrackerBindings.cpp.o
      [ 82%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/AprilTagBindings.cpp.o
      [ 83%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/DetectionParserBindings.cpp.o
      [ 84%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/node/WarpBindings.cpp.o
      [ 85%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/ADatatypeBindings.cpp.o
      [ 85%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/AprilTagConfigBindings.cpp.o
      [ 86%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/AprilTagsBindings.cpp.o
      [ 87%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/BufferBindings.cpp.o
      [ 88%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/CameraControlBindings.cpp.o
      [ 88%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/EdgeDetectorConfigBindings.cpp.o
      [ 89%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/FeatureTrackerConfigBindings.cpp.o
      [ 90%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/ImageManipConfigBindings.cpp.o
      [ 91%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/ImgDetectionsBindings.cpp.o
      [ 91%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/ImgFrameBindings.cpp.o
      [ 92%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/IMUDataBindings.cpp.o
      [ 93%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/NNDataBindings.cpp.o
      [ 94%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/SpatialImgDetectionsBindings.cpp.o
      [ 94%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/SpatialLocationCalculatorConfigBindings.cpp.o
      [ 95%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/SpatialLocationCalculatorDataBindings.cpp.o
      [ 96%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/StereoDepthConfigBindings.cpp.o
      [ 97%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/SystemInformationBindings.cpp.o
      [ 97%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/TrackedFeaturesBindings.cpp.o
      [ 98%] Building CXX object CMakeFiles/depthai.dir/src/pipeline/datatype/TrackletsBindings.cpp.o
      [100%] Linking CXX shared module ../lib.linux-x86_64-cpython-38/depthai.cpython-38-x86_64-linux-gnu.so
      /usr/bin/ld: /home/peter-laptop/.hunter/_Base/cb0ea1f/a3a48bb/ee90518/Install/lib/libXLink.a(PlatformDeviceFd.cpp.o): relocation R_X86_64_PC32 against symbol `_ZNSt13unordered_mapImPvSt4hashImESt8equal_toImESaISt4pairIKmS0_EEED1Ev' can not be used when making a shared object; recompile with -fPIC
      /usr/bin/ld: final link failed: bad value
      collect2: error: ld returned 1 exit status
      make[2]: *** [CMakeFiles/depthai.dir/build.make:903: ../lib.linux-x86_64-cpython-38/depthai.cpython-38-x86_64-linux-gnu.so] Error 1
      make[1]: *** [CMakeFiles/Makefile2:192: CMakeFiles/depthai.dir/all] Error 2
      make: *** [Makefile:130: all] Error 2
      /usr/local/lib/python3.8/dist-packages/setuptools/dist.py:530: UserWarning: Normalizing '2.19.1.0.dev+1e1a6c66d7627a043a005263cbd157b9b26c9d43' to '2.19.1.0.dev0+1e1a6c66d7627a043a005263cbd157b9b26c9d43'
        warnings.warn(tmpl.format(**locals()))
      Traceback (most recent call last):
        File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/usr/local/lib/python3.8/dist-packages/setuptools/build_meta.py", line 412, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/usr/local/lib/python3.8/dist-packages/setuptools/build_meta.py", line 397, in _build_with_temp_dir
          self.run_setup()
        File "/usr/local/lib/python3.8/dist-packages/setuptools/build_meta.py", line 482, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/usr/local/lib/python3.8/dist-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 193, in <module>
        File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/dist.py", line 973, in run_commands
          self.run_command(cmd)
        File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 1217, in run_command
          super().run_command(command)
        File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/dist.py", line 992, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-mo63psry/overlay/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 325, in run
          self.run_command("build")
        File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/cmd.py", line 319, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 1217, in run_command
          super().run_command(command)
        File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/dist.py", line 992, in run_command
          cmd_obj.run()
        File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/command/build.py", line 132, in run
          self.run_command(cmd_name)
        File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/cmd.py", line 319, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 1217, in run_command
          super().run_command(command)
        File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/dist.py", line 992, in run_command
          cmd_obj.run()
        File "<string>", line 92, in run
        File "<string>", line 191, in build_extension
        File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j5']' returned non-zero exit status 2.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for depthai
Failed to build depthai
ERROR: Could not build wheels for depthai, which is required to install pyproject.toml-based projects
--- Logging error ---
Traceback (most recent call last):
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_internal/utils/logging.py", line 177, in emit
    self.console.print(renderable, overflow="ignore", crop=False, style=style)
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_vendor/rich/console.py", line 1673, in print
    extend(render(renderable, render_options))
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_vendor/rich/console.py", line 1305, in render
    for render_output in iter_render:
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_internal/utils/logging.py", line 134, in __rich_console__
    for line in lines:
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_vendor/rich/segment.py", line 249, in split_lines
    for segment in segments:
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_vendor/rich/console.py", line 1283, in render
    renderable = rich_cast(renderable)
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_vendor/rich/protocol.py", line 36, in rich_cast
    renderable = cast_method()
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_internal/self_outdated_check.py", line 130, in __rich__
    pip_cmd = get_best_invocation_for_this_pip()
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_internal/utils/entrypoints.py", line 58, in get_best_invocation_for_this_pip
    if found_executable and os.path.samefile(
  File "/usr/lib/python3.8/genericpath.py", line 101, in samefile
    s2 = os.stat(f2)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/pip3.8'
Call stack:
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/__main__.py", line 31, in <module>
    sys.exit(_main())
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 70, in main
    return command.main(cmd_args)
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 101, in main
    return self._main(args)
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 223, in _main
    self.handle_pip_version_check(options)
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 190, in handle_pip_version_check
    pip_self_version_check(session, options)
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_internal/self_outdated_check.py", line 236, in pip_self_version_check
    logger.warning("[present-rich] %s", upgrade_prompt)
  File "/usr/lib/python3.8/logging/__init__.py", line 1458, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/usr/lib/python3.8/logging/__init__.py", line 1589, in _log
    self.handle(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 1599, in handle
    self.callHandlers(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 1661, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 954, in handle
    self.emit(record)
  File "/home/peter-laptop/.local/lib/python3.8/site-packages/pip/_internal/utils/logging.py", line 179, in emit
    self.handleError(record)
Message: '[present-rich] %s'
Arguments: (UpgradePrompt(old='22.2.2', new='22.3.1'),)

PeterQFR avatar Nov 14 '22 06:11 PeterQFR

That happens rarely, usually it's solved by clearing the Hunter package manager cache: rm -r ~/.hunter

Possible also to install the prebuilt with one of:

  • python3 examples/install_requirements.py
  • python3 -m pip install depthai -U
  • python3 -m pip install depthai==2.19.1.0

(the latest 2.19.1.0 prebuilt wasn't available at the time I wrote before, due to a CI job failure, it was fixed by retriggering the run)

alex-luxonis avatar Nov 14 '22 07:11 alex-luxonis

That works. So I will raise another issue to focus on issue with the rgb link.

It is something introduced, as when I revert back to my original older configuration for depthai-core, the system works.

As an aside why do you install hunter in the home directory as a hidden file instead of installing in the build directory. Makes it easier to clean and know where all the dependencies are.

PeterQFR avatar Nov 14 '22 07:11 PeterQFR

As an aside why do you install hunter in the home directory as a hidden file instead of installing in the build directory. Makes it easier to clean and know where all the dependencies are.

@PeterQFR as its cached across different projects, additional builds, etc... - although given some complications that'd likely make more sense usually. Note to do so you can set -D HUNTER_ROOT=[build/dir/.hunter]

themarpe avatar Nov 14 '22 17:11 themarpe