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. In that case, graph_core will automatically detect and use the manually installed versions of the dependencies.

Installation

Follow these steps to compile and install graph_core using CMake.

Note: If you want to automatically install dependencies using CPM and have ROS1 installed on your system, it is recommended not to source ROS1 before building graph_core. This avoids potential conflicts between graph_core dependencies installed via CPM and catkin.

  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

These settings are necessary to make the installed libraries visible.

Installing within a Catkin workspace

graph_core can also be built within a Catkin workspace. Ensure you have set catkin config --install. In this case, 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 one workspace, source it, and then build other packages in a secondary (cascade) workspace.
  • Option 2: Build everything in the same workspace. Be aware that you may need to build twice. Some packages might fail in the first build but succeed in the second, once dependencies are resolved.

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"