Skip to content

JRL-CARI-CNR-UNIBS/graph_core

Repository files navigation

Graph Core Logo

Introduction

graph_core is an open-source C++ library for sampling-based robot path planning. It provides essential tools for solving path planning problems, includes state-of-the-art algorithms, and streamlines the development of new algorithms.

Status

build check clang-format check Codacy Badge Status

Developed and tested for Ubuntu 20.04, 22.04 and Ubuntu-latest.

Tutorials

See this page for tutorials.

Dependencies

graph_core depends on Eigen3, which can be installed with

sudo apt update
sudo apt -y install libeigen3-dev

Furthermore, it relies on the following packages:

These packages require the following system dependencies. Install them by running

sudo apt update
sudo apt -y install libboost-all-dev libyaml-cpp-dev libpoco-dev liblog4cxx-dev libgtest-dev

To simplify installation and dependency resolution, graph_core uses CPM to automatically download and integrate the required GitHub packages (cnr_logger, cnr_yaml, cnr_param, cnr_class_loader) into your build process. If you'd prefer to install the dependencies manually instead of relying on CPM, you can refer to the cnr_common page, or use vcstool with the deps.repos file. In these cases, graph_core will automatically detect and link against the manually installed dependencies. Manual installation is recommended if other packages in your environment also depend on any of graph_core's dependencies, ensuring consistency and avoiding redundant installations.

Installation

Follow these steps to compile and install graph_core using CMake.

  1. Set the workspace directory path:

    export PATH_TO_WS=path_to_your_ws
  2. Compile and install graph_core:

    cd $PATH_TO_WS
    mkdir -p build/graph_core
    cmake -S src/graph_core/graph_core -B build/graph_core -DCMAKE_INSTALL_PREFIX=$PATH_TO_WS/install
    make -C build/graph_core install

Environment Configuration

Add the following lines to your ~.bashrc file:

export PATH_TO_GRAPH_CORE_WS=path_to_your_ws #replace with the path to your workspace
if [[ ":$PATH:" != *":${PATH_TO_GRAPH_CORE_WS}/install/bin:"* ]]; then
    export PATH="${PATH_TO_GRAPH_CORE_WS}/install/bin:$PATH"
fi
if [[ ":$CMAKE_PREFIX_PATH:" != *":${PATH_TO_GRAPH_CORE_WS}/install:"* ]]; then
    export CMAKE_PREFIX_PATH="${PATH_TO_GRAPH_CORE_WS}/install:$CMAKE_PREFIX_PATH"
fi

Installing within a Catkin workspace

To build graph_core within a Catkin workspace, ensure you have set catkin config --install. You do not need to export the paths as shown above, but you need to source the install/setup.bash file.

In your ~/.bashrc, add source path_to_your_catkin_ws/install/setup.bash.

Note: If you installed graph_core dependencies automatically via CPM and another package in your workspace requires one of those dependencies (e.g., cnr_param) but not graph_core, you have two options:

  • Option 1 [Recommended]: Build and install graph_core (and its dependencies) in a non-catkin workspace, then build other packages in a secondary (cascade) catkin workspace.
  • Option 2: Download graph_core and its dependencies in a catkin workspace (e.g., using vcstool and the .repos file), build using catkin build, and source it.

Final configuration

The cnr_param library requires a directory to store its parameters. You can set this directory by adding the following line to your ~/.bashrc file:

export CNR_PARAM_ROOT_DIRECTORY="/tmp/cnr_param"