Unverified Commit f40d9577 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

dartsim: init at 6.15.0 (#375590)

parents 20a4d388 9a432c9a
Loading
Loading
Loading
Loading
+78 −0
Original line number Diff line number Diff line
diff --git a/tests/integration/CMakeLists.txt b/tests/integration/CMakeLists.txt
index 623102952bfa..c193d6e405fa 100644
--- a/tests/integration/CMakeLists.txt
+++ b/tests/integration/CMakeLists.txt
@@ -74,11 +74,6 @@ if(TARGET dart-utils)
 endif()
 
 if(TARGET dart-utils-urdf)
-  if(NOT MSVC)
-    dart_add_test("integration" test_DartLoader)
-    target_link_libraries(test_DartLoader dart-utils-urdf)
-  endif()
-
   dart_add_library(SharedLibraryWamIkFast SharedLibraryWamIkFast.hpp SharedLibraryWamIkFast.cpp)
   target_link_libraries(SharedLibraryWamIkFast PUBLIC dart)
   target_compile_definitions(SharedLibraryWamIkFast PUBLIC IKFAST_NO_MAIN IKFAST_CLIBRARY)
@@ -88,12 +83,6 @@ if(TARGET dart-utils-urdf)
   target_link_libraries(GeneratedWamIkFast PUBLIC dart)
   target_compile_definitions(GeneratedWamIkFast PUBLIC IKFAST_NO_MAIN IKFAST_CLIBRARY)
   target_compile_options(GeneratedWamIkFast PRIVATE -w)
-
-  if(BUILD_SHARED_LIBS)
-    dart_add_test("integration" test_IkFast)
-    target_link_libraries(test_IkFast dart-utils-urdf)
-    add_dependencies(test_IkFast GeneratedWamIkFast SharedLibraryWamIkFast)
-  endif()
 endif()
 
 dart_format_add(
@@ -117,24 +106,8 @@ if(TARGET dart-collision-bullet)
   target_link_libraries(test_Raycast dart-collision-bullet)
 endif()
 
-if(TARGET dart-collision-ode)
-  # This test doesn't work with FCL because it converts simple shapes to meshes, which makes
-  # it difficult to come up with correct test expectations.
-  dart_add_test("integration" test_ForceDependentSlip)
-  target_link_libraries(test_ForceDependentSlip dart-collision-ode)
-endif()
-
 if(TARGET dart-utils)
 
-  dart_add_test("integration" test_Collision)
-  target_link_libraries(test_Collision dart-utils)
-  if(TARGET dart-collision-bullet)
-    target_link_libraries(test_Collision dart-collision-bullet)
-  endif()
-  if(TARGET dart-collision-ode)
-    target_link_libraries(test_Collision dart-collision-ode)
-  endif()
-
   dart_add_test("integration" test_Dynamics)
   target_link_libraries(test_Dynamics dart-utils)
 
@@ -159,9 +132,4 @@ if(TARGET dart-utils)
     target_link_libraries(test_World dart-collision-bullet)
   endif()
 
-  if(TARGET dart-utils-urdf)
-    dart_add_test("integration" test_ForwardKinematics)
-    target_link_libraries(test_ForwardKinematics dart-utils-urdf)
-  endif()
-
 endif()
diff --git a/tests/regression/CMakeLists.txt b/tests/regression/CMakeLists.txt
index e0dd73c6a461..fa3f7c61c7b0 100644
--- a/tests/regression/CMakeLists.txt
+++ b/tests/regression/CMakeLists.txt
@@ -12,9 +12,6 @@ endif()
 
 if(TARGET dart-utils-urdf)
 
-  dart_add_test("regression" test_Issue838)
-  target_link_libraries(test_Issue838 dart-utils-urdf)
-
   dart_add_test("regression" test_Issue892)
 
   dart_add_test("regression" test_Issue895)
+154 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,

  pythonSupport ? false,
  python3Packages,

  # nativeBuildInputs
  cmake,
  pkg-config,

  # propagatedBuildInputs
  assimp,
  blas,
  boost,
  bullet,
  eigen,
  fcl,
  fmt,
  libglut,
  nlopt,
  imgui,
  ipopt,
  lapack,
  libGL,
  libGLU,
  ode,
  openscenegraph,
  pagmo2,
  tinyxml-2,
  urdfdom,

  # checkInputs
  gbenchmark,
  gtest,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "dartsim";
  version = "6.15.0";

  src = fetchFromGitHub {
    owner = "dartsim";
    repo = "dart";
    tag = "v${finalAttrs.version}";
    hash = "sha256-ik6FwrN5Ta1LinrXpZZc7AmzdFPoLjG07/zo1IZdmgI=";
  };

  # disable failing tests. CMAKE_CTEST_ARGUMENTS does not work.
  patches = [ ./disable-failing-tests.patch ];

  postPatch = ''
    # https://github.com/dartsim/dart/pull/1904, merged upstream
    substituteInPlace tests/benchmark/CMakeLists.txt \
      --replace-fail \
        "FetchContent_MakeAvailable(benchmark)" \
        "find_package(benchmark REQUIRED)"

    # https://github.com/dartsim/dart/pull/1907, merged upstream
    substituteInPlace python/CMakeLists.txt \
      --replace-fail \
        "FetchContent_MakeAvailable(pybind11)" \
        "find_package(pybind11 CONFIG REQUIRED)"

    # fix use of absolute CMake paths in .pc
    substituteInPlace CMakeLists.txt \
      --replace-fail \
        "$""{CMAKE_INSTALL_PREFIX}/$""{CMAKE_INSTALL_LIBDIR}" \
        "$""{CMAKE_INSTALL_LIBDIR}"
    substituteInPlace cmake/dart.pc.in \
      --replace-fail \
        "libdir=$""{prefix}/" \
        "libdir=" \
      --replace-fail \
        "includedir=$""{prefix}/" \
        "includedir="

    # install python bindings
    substituteInPlace python/dartpy/CMakeLists.txt \
      --replace-fail \
        "EXCLUDE_FROM_ALL" \
        ""
    echo "install(TARGETS $""{pybind_module} DESTINATION ${python3Packages.python.sitePackages})" \
      >> python/dartpy/CMakeLists.txt
  '';

  nativeBuildInputs =
    [
      cmake
      pkg-config
    ]
    ++ lib.optionals pythonSupport [
      python3Packages.python
      python3Packages.pybind11
    ];

  propagatedBuildInputs =
    [
      blas
      boost
      assimp
      bullet
      eigen
      fcl
      fmt
      libglut
      gbenchmark
      nlopt
      # requires imgui_impl_opengl2.h
      (imgui.override { IMGUI_BUILD_OPENGL2_BINDING = true; })
      ipopt
      lapack
      libGL
      libGLU
      ode
      openscenegraph
      pagmo2
      tinyxml-2
      urdfdom
    ]
    ++ lib.optionals pythonSupport [
      python3Packages.numpy
    ];

  checkInputs = [
    gbenchmark
    gtest
  ];
  nativeCheckInputs = lib.optionals pythonSupport [
    python3Packages.pytest
    python3Packages.pythonImportsCheckHook
  ];
  doCheck = true;
  # build unit tests
  preCheck = "make tests";
  pythonImportsCheck = [ "dartpy" ];

  cmakeFlags = [
    (lib.cmakeBool "DART_BUILD_DARTPY" pythonSupport)
    (lib.cmakeBool "DART_USE_SYSTEM_IMGUI" true)
    (lib.cmakeBool "DART_USE_SYSTEM_GOOGLEBENCHMARK" true)
    (lib.cmakeBool "DART_USE_SYSTEM_GOOGLETEST" true)
  ];

  meta = {
    description = "DART: Dynamic Animation and Robotics Toolkit";
    homepage = "https://github.com/dartsim/dart";
    changelog = "https://github.com/dartsim/dart/blob/v${finalAttrs.version}/CHANGELOG.md";
    license = lib.licenses.bsd2;
    maintainers = with lib.maintainers; [ nim65s ];
    platforms = lib.platforms.unix ++ lib.platforms.windows;
  };
})
+7 −0
Original line number Diff line number Diff line
@@ -3094,6 +3094,13 @@ self: super: with self; {
  darkdetect = callPackage ../development/python-modules/darkdetect { };
  dartsim = toPythonModule (
    pkgs.dartsim.override {
      pythonSupport = true;
      python3Packages = self;
    }
  );
  dasbus = callPackage ../development/python-modules/dasbus { };
  dash = callPackage ../development/python-modules/dash { };