From 6f78b9574e29d3e3f766370903fcea01491f79b0 Mon Sep 17 00:00:00 2001 From: marius david Date: Sat, 7 Dec 2024 16:56:45 +0100 Subject: [PATCH 1/2] zed-open-capture: init at unstable-2023-24-19 --- pkgs/by-name/ze/zed-open-capture/package.nix | 47 ++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 pkgs/by-name/ze/zed-open-capture/package.nix diff --git a/pkgs/by-name/ze/zed-open-capture/package.nix b/pkgs/by-name/ze/zed-open-capture/package.nix new file mode 100644 index 000000000000..648424d47443 --- /dev/null +++ b/pkgs/by-name/ze/zed-open-capture/package.nix @@ -0,0 +1,47 @@ +{ + lib, + stdenv, + libusb1, + hidapi, + opencv, + cmake, + pkg-config, + fetchFromGitHub, + withExamples ? false, +}: + +stdenv.mkDerivation { + pname = "zed-open-capture"; + version = "0.5.0-unstable-2023-24-19"; + + src = fetchFromGitHub { + owner = "stereolabs"; + repo = "zed-open-capture"; + rev = "5cf66ff777175776451b9b59ecc6231d730fa202"; + sha256 = "sha256-ZjgJkCRbvLT7jjOcA8REiEpTg0Jh57du2aMwRk/OKLI="; + }; + + buildInputs = [ + libusb1 + hidapi + opencv + ]; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + + # all but one example require opencv with UI support, so disable it. + # The input OpenCV can be overriden with (opencv.override { enableGtk3 = true; }) + cmakeFlags = lib.optionals (!withExamples) [ + "-DBUILD_EXAMPLES=OFF" + ]; + + meta = with lib; { + description = "Platform-agnostic camera and sensor capture API for the ZED 2, ZED 2i, and ZED Mini stereo cameras"; + homepage = "https://github.com/stereolabs/zed-open-capture"; + license = licenses.mit; + maintainers = with maintainers; [ marius851000 ]; + }; +} From e7f4622dae8bbdda34cd0f6952b39693db47d1d7 Mon Sep 17 00:00:00 2001 From: marius david Date: Sat, 7 Dec 2024 16:57:33 +0100 Subject: [PATCH 2/2] rtabmap: make use of zed-open-capture --- pkgs/applications/video/rtabmap/default.nix | 58 ++++++++++++--------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/pkgs/applications/video/rtabmap/default.nix b/pkgs/applications/video/rtabmap/default.nix index 6565a4097587..45818f48166e 100644 --- a/pkgs/applications/video/rtabmap/default.nix +++ b/pkgs/applications/video/rtabmap/default.nix @@ -1,25 +1,28 @@ -{ lib -, stdenv -, fetchFromGitHub -, pkg-config -, cmake -, opencv -, pcl -, libusb1 -, eigen -, wrapQtAppsHook -, qtbase -, g2o -, ceres-solver -, octomap -, freenect -, libdc1394 -, libGL -, libGLU -, vtkWithQt5 -, wrapGAppsHook3 -, liblapack -, xorg +{ + lib, + stdenv, + fetchFromGitHub, + pkg-config, + cmake, + opencv, + pcl, + libusb1, + eigen, + wrapQtAppsHook, + qtbase, + g2o, + ceres-solver, + zed-open-capture, + hidapi, + octomap, + freenect, + libdc1394, + libGL, + libGLU, + vtkWithQt5, + wrapGAppsHook3, + liblapack, + xorg, }: stdenv.mkDerivation rec { @@ -33,7 +36,12 @@ stdenv.mkDerivation rec { hash = "sha256-y/p1uFSxVQNXO383DLGCg4eWW7iu1esqpWlyPMF3huk="; }; - nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook wrapGAppsHook3 ]; + nativeBuildInputs = [ + cmake + pkg-config + wrapQtAppsHook + wrapGAppsHook3 + ]; buildInputs = [ ## Required opencv @@ -57,6 +65,8 @@ stdenv.mkDerivation rec { libGL libGLU vtkWithQt5 + zed-open-capture + hidapi ]; # Disable warnings that are irrelevant to us as packagers @@ -66,7 +76,7 @@ stdenv.mkDerivation rec { description = "Real-Time Appearance-Based 3D Mapping"; homepage = "https://introlab.github.io/rtabmap/"; license = licenses.bsd3; - maintainers = [ ]; + maintainers = with maintainers; [ marius851000 ]; platforms = with platforms; linux; }; }