luxonis / depthai-core

DepthAI C++ Library
MIT License
235 stars 127 forks source link

[Feature-Request] Update “sdcard_no_eth” branch to current version #969

Open KarolPiotrRoesner opened 8 months ago

KarolPiotrRoesner commented 8 months ago

We are attempting to use an FFC 4P board in standalone mode, attaching it to a drone with four cameras. Our goal is to directly save images to a micro SD card without relying on additional hardware like a Raspberry Pi Zero.

We’re aware of the existence of the “sdcard_no_eth” branch, which has been functional for us. We’ve successfully used a script to write a “Hello World” file to the SD card. However, we’re currently facing an issue with the OV9281 global shutter camera. These cameras only support 800P resolution, but unfortunately, the “sdcard_no_eth” branch does not accommodate this resolution.

Is it possible to update the “sdcard_no_eth” branch to the current DepthAI core version (2.24)?”

moratom commented 8 months ago

@zrezke would you mind taking a look if this is doable?

zrezke commented 8 months ago

Yes, will take a look @moratom

zrezke commented 8 months ago

Before we move forward with possibly merging/adding sd card support on a more recent depthai version, @KarolPiotrRoesner are you trying to create a ColorCamera node for the OV9281? The resolution THE_800_P is available for the MonoCamera node on the sdcard_no_eth, tho it is missing for the ColorCamera.

KarolPiotrRoesner commented 8 months ago

Hey @zrezke, its correct, we initially used the ColorCamera node until our issue here. Today, we tested the MonoCamera node on the "sdcard_no_eth" branch. While it did display a camera image, we encountered several issues that are not present in the latest core version.

When attempting to retrieve four camera images, our code terminates with the following error:

terminate called after throwing an instance of 'std::runtime_error'
  what():  MonoCamera(2) - CameraBoardSocket AUTO: Neither LEFT nor RIGHT camera sockets are available

Additionally, it appears that the sdcard_no_eth branch does not support Hardware Sync. This presents an issue for us since Hardware Sync is essential for our intended image stitching process in later stages. The function we mean is: CameraControl& dai::CameraControl::setFrameSyncMode(FrameSyncMode mode)

Furthermore, it would greatly benefit our project if we could retrieve the images as ColorImages. This is crucial for us because the data will be visualized to assist firefighters during their missions. The grayscale images also show some kind of artifacts when we zoom in, a picture is included. cam_b_screenshot_14 03 2024

We would appreciate any further help.

zrezke commented 8 months ago

Hi @KarolPiotrRoesner
Alright, thanks for expanding on your initial post! I'll look into getting the SD support running on the latest depthai (2.25.0.0)

zrezke commented 8 months ago

Hey @KarolPiotrRoesner There is now an updated branch: sdcard_no_eth_updated. It is based on latest develop, pretty much v2.25.0.0. Let me know if it works for you, thanks.

KarolRoesner commented 8 months ago

Hey @zrezke, thank you so much, everything works great until now! If we encounter any problems, we’ll be sure to inform you. The only action required on our part was to explicitly disable PCL during the library’s build process.

cmake -Bbuild . -DBUILD_SHARED_LIBS=ON -DDEPTHAI_BUILD_DOCS=ON -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DHUNTER_ROOT="$(pwd)/build/hunter" -DDEPTHAI_PCL_SUPPORT=OFF

moratom commented 8 months ago

Thansk @zrezke!

@KarolPiotrRoesner do you mind sharing what goes wrong if you don't explicitly disable the PCL during the libraries build process?

KarolPiotrRoesner commented 7 months ago

I should stop switching between my account :D

@moratom @zrezke On our Ubuntu 22.04 Laptop the output was:

-- Configuring done
CMake Error in CMakeLists.txt:
  Target "depthai-pcl" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/tmp/depthai-core/build/hunter/_Base/cb0ea1f/21498a3/69d66b5/Install/include"

  which is prefixed in the build directory.

CMake Error in CMakeLists.txt:
  Target "depthai-pcl" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/tmp/depthai-core/build/hunter/_Base/cb0ea1f/21498a3/69d66b5/Install/include"

  which is prefixed in the build directory.Target "depthai-pcl"
  INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/tmp/depthai-core/build/hunter/_Base/cb0ea1f/21498a3/69d66b5/Install/include"

  which is prefixed in the source directory.

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

But we retried it on a Jetson Board and it worked, so its probably a problem with a broken PCL library on our system.