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-dev
Furthermore, 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-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.
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.
-
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"
fi
These settings are necessary to make the installed libraries visible.
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.
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"