Skip to content

Commit

Permalink
Add plot-juggler and protobuf with the correct version
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilienNaveau committed Jan 9, 2025
1 parent 870fdb5 commit 956be69
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
if test -f .envrc.local; then
# If you don't need nixgl, eg. if you are n NixOS, you can:
# echo 'use flake .#pure' > .envrc.local
source_env .envrc.local
else
# unfree is only required if you use nvidia
export NIXPKGS_ALLOW_UNFREE=1
use flake . --impure
use flake . --impure
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.envrc.local
result*
.direnv
34 changes: 31 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
## NixGL, for people not yet on NixOS
nixgl.url = "github:nix-community/nixGL";
};
outputs =
{ nixpkgs, self, ... }@inputs:

outputs = { nixpkgs, self, ... }@inputs:
inputs.nix-ros-overlay.inputs.flake-utils.lib.eachDefaultSystem (
system:
let
Expand All @@ -24,6 +24,10 @@
overlays = [
inputs.nix-ros-overlay.overlays.default
inputs.nixgl.overlay
(final: prev: {
# Override protobuf version to ensure compatibility
protobuf = prev.protobuf3_21;
})
];
patches = [
inputs.patch-hpp
Expand All @@ -34,6 +38,19 @@
self.packages.${system}.python
self.packages.${system}.ros
];
# Precompute the BASE_DIR path
baseDir = pkgs.python3Packages.example-robot-data.outPath;
# Define the shared shell hook, referencing the precomputed path
sharedShellHook = ''
if [ -z "$BASE_DIR" ]; then
echo "Error: Could not locate the example-robot-data package." >&2
else
SHARE_DIR=$BASE_DIR
export AMENT_PREFIX_PATH=$SHARE_DIR:$AMENT_PREFIX_PATH
export ROS_PACKAGE_PATH=$SHARE_DIR/share:$ROS_PACKAGE_PATH
echo "Added $SHARE_DIR to AMENT_PREFIX_PATH and ROS_PACKAGE_PATH"
fi
'';
in
{
devShells = {
Expand All @@ -44,10 +61,18 @@
packages = pure-packages ++ [
self.packages.${system}.nixgl-gepetto-gui
];
shellHook = ''
export BASE_DIR='${baseDir}'
${sharedShellHook}
'';
};
pure = pkgs.mkShell {
name = "Gepetto Main Dev Shell";
packages = pure-packages;
shellHook = ''
export BASE_DIR='${baseDir}'
${sharedShellHook}
'';
};
};
packages = {
Expand All @@ -67,7 +92,10 @@
buildEnv {
paths = [
ros-core
turtlesim
rmw-fastrtps-cpp
rmw-cyclonedds-cpp
plotjuggler
plotjuggler-ros
];
};
};
Expand Down

0 comments on commit 956be69

Please sign in to comment.