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.
Developed and tested for Ubuntu 20.04, 22.04 and Ubuntu-latest.
See this page for tutorials.
graph_core depends on Eigen3, which can be installed with
sudo apt update
sudo apt -y install libeigen3-devFurthermore, it relies on the following packages:
- cnr_logger: Logging package.
- cnr_param: Package to read and set parameters. It depends on cnr_yaml.
- cnr_class_loader: Provides a way to load classes as plugins.
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-devTo 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.
Follow these steps to compile and install graph_core using CMake.
-
Set the workspace directory path:
export PATH_TO_WS=path_to_your_ws -
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
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"
fiTo 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_coreand its dependencies in a catkin workspace (e.g., using vcstool and the .repos file), build usingcatkin build, and source it.
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"