Compare commits
4 commits
master
...
10-ros-pac
Author | SHA1 | Date | |
---|---|---|---|
27738cd215 | |||
0e599a886e | |||
ad54d2e26d | |||
518c912058 |
4 changed files with 107 additions and 30 deletions
41
flake.lock
generated
41
flake.lock
generated
|
@ -5,11 +5,11 @@
|
|||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1689068808,
|
||||
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
|
||||
"lastModified": 1705309234,
|
||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
|
||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -20,27 +20,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1695298503,
|
||||
"narHash": "sha256-eDuN/+479v5gfVqwmJRYVX/Skh+TYSifAXdJ9xMqiP4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b1370f72c01cee73c8648baf158453d60f3127e2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "master",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1691006197,
|
||||
"narHash": "sha256-DbtxVWPt+ZP5W0Usg7jAyTomIM//c3Jtfa59Ht7AV8s=",
|
||||
"lastModified": 1707268954,
|
||||
"narHash": "sha256-2en1kvde3cJVc3ZnTy8QeD2oKcseLFjYPLKhIGDanQ0=",
|
||||
"owner": "lopsided98",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "66aedfd010204949cb225cf749be08cb13ce1813",
|
||||
"rev": "f8e2ebd66d097614d51a56a755450d4ae1632df1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -56,21 +40,24 @@
|
|||
"ros-flake",
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs": [
|
||||
"ros-flake",
|
||||
"nixpkgs"
|
||||
],
|
||||
"ros-flake": "ros-flake"
|
||||
}
|
||||
},
|
||||
"ros-flake": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694916346,
|
||||
"narHash": "sha256-3Fb5sRqFhpIVCK8hH0dtRNyJHV7zvVavZEbTGZWNy4g=",
|
||||
"lastModified": 1709607719,
|
||||
"narHash": "sha256-+oTI07ElC5VcaERw/DjPqhuazsUph01dnnBijHor9KU=",
|
||||
"owner": "lopsided98",
|
||||
"repo": "nix-ros-overlay",
|
||||
"rev": "148dc07305802c41369839fb2d4d5291571ddb69",
|
||||
"rev": "4dc55d14c34472a47897b0b4b79cce7b2ebad7a4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
27
flake.nix
27
flake.nix
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
description = "Robossembler Development Environments on Nix";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs?ref=master";
|
||||
nixpkgs.follows = "ros-flake/nixpkgs";
|
||||
flake-utils.follows = "ros-flake/flake-utils";
|
||||
ros-flake.url = "github:lopsided98/nix-ros-overlay?ref=develop";
|
||||
};
|
||||
|
@ -99,6 +99,8 @@
|
|||
ansitable = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/ansitable { };
|
||||
megapose6d = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/megapose6d { inherit webdataset; };
|
||||
spatialmath = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/spatialmath { inherit ansitable; };
|
||||
|
||||
test-system = pkgs.callPackage ./pkgs/systems/test { };
|
||||
in
|
||||
{
|
||||
inherit pkgs;
|
||||
|
@ -112,10 +114,29 @@
|
|||
|
||||
packages = {
|
||||
inherit mayo pysdf fstl unified-planning test-script blender;
|
||||
zoz = pkgs.btop;
|
||||
};
|
||||
|
||||
devShells.ci = pkgs.mkShell { buildInputs = [ pkgs.jq ]; };
|
||||
devices = {
|
||||
inherit test-system;
|
||||
};
|
||||
|
||||
devShells.camera =
|
||||
pkgs.mkShell {
|
||||
buildInputs = (with humble-overrided; [
|
||||
ros-core
|
||||
realsense2-camera
|
||||
realsense2-description
|
||||
]);
|
||||
};
|
||||
|
||||
devShells.ci = pkgs.mkShell {
|
||||
buildInputs =
|
||||
(with pkgs; [ jq ]) ++
|
||||
(with humble-overrided; [
|
||||
superflore
|
||||
(python3.withPackages (p: with p; [ python3Packages.rosdep python3Packages.rosdistro ]))
|
||||
]);
|
||||
};
|
||||
|
||||
devShells.ros =
|
||||
pkgs.mkShell {
|
||||
|
|
33
parse_step_file.py
Normal file
33
parse_step_file.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
import sys
|
||||
import SimpleITK
|
||||
from OCC.Exchange import STEPControl_Reader
|
||||
from OCC.IFSelect import IFSelect_RetDone
|
||||
from OCC.TopoDS import TopoDS_Shape
|
||||
|
||||
def save_shape(shape, filename):
|
||||
from OCC.STEPControl import STEPControl_Writer
|
||||
writer = STEPControl_Writer()
|
||||
writer.Transfer(shape, STEPControl_Reader().StepModel(), False)
|
||||
writer.Write(filename)
|
||||
|
||||
def parse_step_file(filepath):
|
||||
reader = STEPControl_Reader()
|
||||
status = reader.ReadFile(filepath.encode('utf-8'))
|
||||
|
||||
if status == IFSelect_RetDone:
|
||||
nbr = reader.NbRootsForTransfer()
|
||||
reader.TransferRoots()
|
||||
shapes = [reader.Shape(i) for i in range(1, nbr + 1)]
|
||||
|
||||
solids = []
|
||||
for i, shape in enumerate(shapes, start=1):
|
||||
filename = f"solid_{i}.step"
|
||||
save_shape(shape, filename)
|
||||
solids.append({"name": f"solid_{i}", "file": filename})
|
||||
|
||||
return solids
|
||||
|
||||
if __name__ == "__main__":
|
||||
step_file_path = sys.argv[1]
|
||||
solids = parse_step_file(step_file_path)
|
||||
print(solids) # This print is simplistic; in practice, you might write this to a file or handle differently.
|
36
pkgs/systems/test/default.nix
Normal file
36
pkgs/systems/test/default.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchgit
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "grip-tool";
|
||||
version = "unstable";
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://gitlab.com/robossembler/assets-library";
|
||||
rev = "876ad8c479c6043089e1cf08b2b8a456560a512c";
|
||||
hash = "sha256-3pAbfO0stHTt3drOgVJ44Al/rZc+XQ9/KGUJqxQIhl8=";
|
||||
fetchLFS = true;
|
||||
};
|
||||
|
||||
device = true;
|
||||
|
||||
outputs = [ "out" "blend" "doc" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir $doc
|
||||
cp '${src}/README.md' $doc
|
||||
mkdir $blend
|
||||
ln -s ${src}/blender/assets/robossembler-asset.blend $blend
|
||||
mkdir $out
|
||||
cp -r ${src} $out
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Robossembler Assets Library";
|
||||
homepage = "https://gitlab.com/robossembler/forks/robossembler-stuff";
|
||||
license = with licenses; [ ];
|
||||
maintainers = with maintainers; [ ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue