Skip to content

Commit

Permalink
add example on how to include KissICP C++ lib in other projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Uecker committed Nov 18, 2024
1 parent a31be32 commit 2c8b5d7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cpp/include_example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.18.0)
project(kiss_icp_include_example)

find_package(kiss_icp REQUIRED CONFIG)

add_executable(example src/example.cpp)
target_link_libraries(example PRIVATE kiss_icp::kiss_icp_pipeline)
#for other components (not used in example.cpp):
#target_link_libraries(example PRIVATE kiss_icp::kiss_icp_core)
#target_link_libraries(example PRIVATE kiss_icp::kiss_icp_metrics)

10 changes: 10 additions & 0 deletions cpp/include_example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Example on how to include the KissICP library in other C++ projects with CMake

See `CMakeLists.txt` for details on how to find the library and link the targets, and `src/example.cpp` on how to include the corresponding files.

## Building your project
```bash
cmake -Bbuild
cmake --build build -j$(nproc --all)
```

15 changes: 15 additions & 0 deletions cpp/include_example/src/example.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <kiss_icp/pipeline/KissICP.hpp>

int main(){
struct kiss_icp::pipeline::KISSConfig config;
config.deskew = true;
config.initial_threshold = 2.0;
config.min_range = 8.0;
config.max_range = 100.0;
config.max_points_per_voxel = 20;
config.min_motion_th = 0.1;
config.voxel_size = 1.0;
kiss_icp::pipeline::KissICP icp_pipeline{config};
// TODO: use pipeline here

}

0 comments on commit 2c8b5d7

Please sign in to comment.