Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moveit_ompl_interface include dirs broken when using ament #312

Open
werner291 opened this issue Oct 4, 2023 · 0 comments
Open

moveit_ompl_interface include dirs broken when using ament #312

werner291 opened this issue Oct 4, 2023 · 0 comments

Comments

@werner291
Copy link

werner291 commented Oct 4, 2023

When compiling a project that uses these lines in CMakeLists:

set(AMENT_DEPS "moveit_core" "moveit_msgs" "shape_msgs" "rclcpp" "ompl" "moveit_planners_ompl")

ament_target_dependencies(${PROJECT_NAME}_shared ${AMENT_DEPS})

I get the following error:

CMake Error in CMakeLists.txt:
  Imported target "moveit_planners_ompl::moveit_ompl_interface" includes
  non-existent path

    "/nix/store/mg432iy0715cc7fylwg10bsdhsg4qy30-ros-rolling-moveit-planners-ompl-2.8.0-r2/include/moveit_planners_ompl"

I'm using the dev shell and suggested patch from #311

I can confirm that that directory doesn't exist, but the required headers are there:

ls /nix/store/mg432iy0715cc7fylwg10bsdhsg4qy30-ros-rolling-moveit-planners-ompl-2.8.0-r2/include/moveit_planners/moveit/ompl_interface/
detail  model_based_planning_context.h  ompl_interface.h  parameterization  planning_context_manager.h

I remember having issues with this even outside of NixOS (macOS at the time), but since they're showing up here we might as well.

Flake.nix:

{
  description = "My ROS Project Build Environment";
  nixConfig.bash-prompt = "[ros] ";
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
    nix-ros-overlay.url = "github:lopsided98/nix-ros-overlay";
  };

  outputs = { self, nixpkgs, nix-ros-overlay }:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs { inherit system; overlays = [ nix-ros-overlay.overlays.default (import ./replace-ompl.nix) ]; };
    in
    {
      devShells.x86_64-linux.default = pkgs.mkShell {
        name = "My ROS Project Build Environment";
        buildInputs = with pkgs; with pkgs.rosPackages.rolling; [
          moveit-core
          moveit-planners-ompl
          pythonPackages.matplotlib
                pythonPackages.notebook
                pythonPackages.numpy
                pythonPackages.pandas
                cmake
                jsoncpp
                range-v3
                cgal
        ];
      };
    };
}

replace-ompl.nix:

# See: https://github.com/lopsided98/nix-ros-overlay/issues/311

self: super:

let
  myOmpl = super.rosPackages.rolling.ompl.overrideAttrs ({ patches ? [ ], ... }: {
    version="Fix patch";
    patches = patches ++ [
      # Use full install paths for pkg-config
      (self.fetchpatch {
        url = "https://github.com/hacker1024/ompl/commit/1ddecbad87b454ac0d8e1821030e4cf7eeff2db2.patch";
        hash = "sha256-sAQLrWHoR/DhHk8TtUEy8E8VXqrvtXl2BGS5UvElJl8=";
      })
    ];
  });
in
{
  rosPackages = super.rosPackages // {
    rolling = super.rosPackages.rolling // {
      ompl = myOmpl;
      moveit-planners-ompl = super.rosPackages.rolling.moveit-planners-ompl.override {
        ompl = myOmpl;
      };
    };
  };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant