-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add example on how to include KissICP C++ lib in other projects
- Loading branch information
Marc Uecker
committed
Nov 18, 2024
1 parent
a31be32
commit 2c8b5d7
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
} |