Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Current status:
Allows to build mc-rtc and configure its runtime dependencies (`robots`, `controllers`, `observers`, `plugins`)
- [x] Run `MCFrankaControl` with real Panda robots
- [x] `mc-rtc-magnum` support (with older `glfw/imgui/implot` as submodules, as done in `mc-rtc-superbuild`)
- [ ] Robots - all most commonly used robots are supported:
- [x] Robots - all most commonly used robots are supported:
- [x] JVRC1
- [x] HRP-2Kai
- [x] HRP-4
Expand All @@ -24,9 +24,9 @@ Current status:
- [ ] UR10
- [ ] Controllers
- [x] Rolkneematics `panda-prosthesis` (through downstream flake in `panda-prosthesis` repository)
- [ ] WIP: Hugo's polytopeController
- [x] Hugo's polytopeController
- [ ] `mc-mujoco`: building and running but some HiDPI scaling issues on Wayland with glfw 3.4
- [ ] magnum packaging (external): in progress
- [x] magnum packaging
- [x] magnum
- [x] SDL2Application: works
- [x] GlfwApplication:
Expand Down
4 changes: 3 additions & 1 deletion module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let
rawOverlays = [
{
name = "mc-rtc-pkgs";
value = import ./overlay.nix { inherit with-ros; };
value = import ./overlay.nix { inherit lib with-ros; };
}
]
++ (lib.optional enablePrivateOverlay {
Expand Down Expand Up @@ -69,9 +69,11 @@ in
// {
# Main dependencies
inherit (pkgs)
eigen3-to-python
spacevecalg
rbdyn
sch-core
sch-core-python
tasks
tasks-qld
tvm
Expand Down
18 changes: 17 additions & 1 deletion overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Use this to access and override existing packages, or to call functions from the underlying package set.
*/
{
lib,
with-ros ? false,
...
}:
Expand Down Expand Up @@ -45,11 +46,13 @@
'';
});

eigen3-to-python = prev.callPackage ./pkgs/eigen3-to-python { };
spacevecalg = prev.callPackage ./pkgs/spacevecalg { };
rbdyn = prev.callPackage ./pkgs/rbdyn { };
eigen-qld = prev.callPackage ./pkgs/eigen-qld { };
eigen-quadprog = prev.callPackage ./pkgs/eigen-quadprog { };
sch-core = prev.callPackage ./pkgs/sch-core { };
sch-core-python = prev.callPackage ./pkgs/sch-core-python { };
#sch-visualization = prev.callPackage ./pkgs/sch-visualization {};
sch-visualization = prev.callPackage ./pkgs/sch-visualization { };
tasks-qld = prev.callPackage ./pkgs/tasks { };
Expand Down Expand Up @@ -221,7 +224,7 @@
# This is not per-say recomended, but it can drastically reduce build time for these components, and also allow for seamless LSP integration in your editor.
#
# TODO: investigate use of ccacheStdenv
# mc-rtc-superbuild = prev.callPackage ./pkgs/mc-rtc/mc-rtc-superbuild-symlinkjoin.nix.nix {
# mc-rtc-superbuild = prev.callPackage ./pkgs/mc-rtc/mc-rtc-superbuild-symlinkjoin.nix.nix

# minimal superbuild environment (jvrc1, mc_rtc_ticker)
mc-rtc-superbuild-minimal = prev.callPackage ./pkgs/mc-rtc/mc-rtc-superbuild-standalone.nix {
Expand Down Expand Up @@ -265,5 +268,18 @@
};

sphinx-cmake = prev.callPackage ./pkgs/sphinx-cmake.nix { };

pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(
python-final: _python-prev:
{
# custom overrides would go here see gepetto/nix for examples
}
// lib.filesystem.packagesFromDirectoryRecursive {
inherit (python-final) callPackage;
directory = ./py-pkgs;
}
)
];
}
)
80 changes: 80 additions & 0 deletions pkgs/eigen3-to-python/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
stdenv,
lib,
cmake,
pkg-config,
eigen,
fetchFromGitHub,
python3Packages,
}:

stdenv.mkDerivation {
pname = "eigen3-to-python";
version = "1.0.7";

# pr 35
src = fetchFromGitHub {
owner = "Kooolkimooov";
repo = "Eigen3ToPython";
rev = "a1dfb35c204b2732d0b60d4d2bb6edb4c6941f59";
hash = "sha256-zNaMmaexyDBD2frMkO4z+Qj/AKtIxt6sRdwYcwoNJh8=";
};

nativeBuildInputs = [
cmake
pkg-config
python3Packages.cython
python3Packages.python
python3Packages.distutils
python3Packages.pytest
python3Packages.pip
];

propagatedBuildInputs = [
eigen
python3Packages.numpy
];

cmakeFlags = [
"-DPIP_INSTALL_PREFIX=$out/lib/python3"
"-DCMAKE_BUILD_TYPE=Release"
"-DCYTHON_USE_CACHE=OFF"
];

# Force pip to ignore the EXTERNALLY-MANAGED restriction in the sandbox
PIP_BREAK_SYSTEM_PACKAGES = 1;
# Force pip to use the Nix-provided python packages instead of checking PyPI
PIP_NO_BUILD_ISOLATION = 1;

# Force Cython/Python to use the build directory for caching instead of /homeless-shelter
preBuild = ''
export HOME=$TMPDIR
'';

doCheck = true;

# Override the default CMake install step
installPhase = ''
runHook preInstall

# 1. Define the destination directory inside the Nix store output
# Using python.sitePackages handles the "lib/python3.13/site-packages" string automatically
local targetDir="$out/${python3Packages.python.sitePackages}/eigen"
mkdir -p "$targetDir"

ls -lR

# 2. Copy your built files from the build tree to the target store path
# (Adjust 'build/python/Release/eigen/' path if your build folder structure differs slightly)
cp -r python/Release/eigen/* "$targetDir"

runHook postInstall
'';

meta = with lib; {
description = "Provide Eigen3 to numpy conversion";
homepage = "https://github.com/jrl-umi3218/Eigen3ToPython";
license = licenses.bsd2;
platforms = platforms.all;
};
}
7 changes: 4 additions & 3 deletions pkgs/mc-rtc/mc-rtc-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

let
version = "2.14.1";
# TODO: PR 538
src = fetchFromGitHub {
owner = "jrl-umi3218";
owner = "Kooolkimooov";
repo = "mc_rtc";
rev = "d1bb28f9bfab85a04ce1ff103289676cfa5bf4fc";
hash = "sha256-a8Wh5Xhvs+vM7k0uEJzSDCSUOK58AJSRSJx3XyboHO0=";
rev = "2846f365824531f162635323d0c32796842e02a8";
hash = "sha256-zTxxZOZCwlMGrRGG8B9kRLJcCvXLvYSigej8yDpihwg=";
};
in
{
Expand Down
24 changes: 15 additions & 9 deletions pkgs/mc-rtc/mc-rtc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
libtool,
geos,
spdlog,
fmt,
ndcurves,
mc-rtc-data,
state-observation,
Expand All @@ -23,9 +24,8 @@
rapidjson,
boost,
mesh-sampling,
python313Packages,
python3Packages,
qt5,
eigen-fmt,
doxygen,
bundler, # Ruby for bundle dependencies
with-ros ? false,
Expand Down Expand Up @@ -61,6 +61,10 @@ in
pkg-config
jrl-cmakemodules
qt5.wrapQtAppsHook
python3Packages.distutils
python3Packages.pytest
python3Packages.cython
python3Packages.python
]
++ [
# for documentation
Expand All @@ -83,13 +87,16 @@ in
rapidjson
boost
mesh-sampling
eigen-fmt
]
++ [
python313Packages.gitpython
python313Packages.pyqt5
python313Packages.matplotlib
fmt
python3Packages.tasks
]
++
# for python utils (mc_rtc_new_fsm_controller, mc_log_ui, etc)
[
python3Packages.gitpython
python3Packages.pyqt5
python3Packages.matplotlib
]
++ lib.optional (with-ros && rclcpp != null) rclcpp
++ lib.optional (with-ros && nav-msgs != null) nav-msgs
++ lib.optional (with-ros && sensor-msgs != null) sensor-msgs
Expand All @@ -106,7 +113,6 @@ in
cmakeFlags = [
"-DBUILD_MC_RTC_PYTHON_UTILS=ON"
"-DBUILD_TESTING=OFF"
"-DPYTHON_BINDING=OFF"
"-DINSTALL_DOCUMENTATION=ON"
];

Expand Down
21 changes: 14 additions & 7 deletions pkgs/rbdyn/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
tinyxml-2,
boost,
fetchurl,
python3Packages,
}:

stdenv.mkDerivation rec {
Expand All @@ -18,20 +19,26 @@ stdenv.mkDerivation rec {
sha256 = "sha256-IFqX4z8r2JTwgNnPB35/vZKwgWoPO78ebnUvPdNOnjY=";
};

nativeBuildInputs = [ cmake ];
nativeBuildInputs = [
cmake
python3Packages.cython
python3Packages.python
python3Packages.distutils
python3Packages.pytest
];

propagatedBuildInputs = [
spacevecalg
yaml-cpp
tinyxml-2
boost
python3Packages.spacevecalg
]; # Add other dependencies here

postPatch = ''
# Remove the include from the main CMakeLists.txt
sed -i '/include(cmake\/cython\/cython.cmake)/d' CMakeLists.txt

# Add the include to the top of the python binding CMakeLists.txt
sed -i '1i include(cmake/cython/cython.cmake)' binding/python/CMakeLists.txt
# XXX: Without this fixupPhase fails due to RPATHS references to /build/
preFixup = ''
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" $out/${python3Packages.python.sitePackages}/rbdyn/rbdyn.so
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" $out/${python3Packages.python.sitePackages}/rbdyn/parsers/parsers.so
'';

doCheck = true;
Expand Down
65 changes: 65 additions & 0 deletions pkgs/sch-core-python/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
lib,
stdenv,
cmake,
sch-core,
spacevecalg,
python3Packages,
fetchFromGitHub,
}:

stdenv.mkDerivation rec {
pname = "sch-core-python";
version = "1.0.5";

src = fetchFromGitHub {
owner = "jrl-umi3218";
repo = "sch-core-python";
rev = "9b4a7d8189de30dc49edc7ccb0e1283e85686e62";
hash = "sha256-Ml0fATe61R7tJ5m20Y7hjDwCa/WwIIG3f+qwV1zSz8k=";
};

nativeBuildInputs = [
cmake
python3Packages.cython
python3Packages.python
python3Packages.distutils
python3Packages.pytest
];
propagatedBuildInputs = [
sch-core
spacevecalg
python3Packages.spacevecalg
];

cmakeFlags = [
"-DINSTALL_DOCUMENTATION=OFF"
];

# Override the default CMake install step
installPhase = ''
runHook preInstall

# 1. Define the destination directory inside the Nix store output
# Using python.sitePackages handles the "lib/python3.13/site-packages" string automatically
local targetDir="$out/${python3Packages.python.sitePackages}/sch"
mkdir -p "$targetDir"

ls -lR

# 2. Copy your built files from the build tree to the target store path
# (Adjust 'build/python/Release/eigen/' path if your build folder structure differs slightly)
cp -r python/Release/sch/* "$targetDir"

runHook postInstall
'';

doCheck = false;

meta = with lib; {
description = "sch-core: python bindings for sch-core - effective proximity queries";
homepage = "https://github.com/jrl-umi3218/sch-core-python";
license = licenses.bsd2;
platforms = platforms.all;
};
}
Loading
Loading