Skip to content

Commit

Permalink
Merge pull request #74 from PRBonn/nacho/tweaks_ros2_node
Browse files Browse the repository at this point in the history
Add ROS2 support
  • Loading branch information
tizianoGuadagnino authored Feb 23, 2023
2 parents 0879030 + 4c97b8e commit 71a6a0b
Show file tree
Hide file tree
Showing 110 changed files with 1,468 additions and 943 deletions.
18 changes: 12 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ black:
before_script:
- pip install black
script:
- black --check $CI_PROJECT_DIR
- black --line-length 100 --check $CI_PROJECT_DIR

clang-format:
image: ubuntu:22.04
Expand All @@ -52,7 +52,7 @@ cpp_api:gcc:
before_script:
- apt-get update && apt-get install --no-install-recommends -y g++ cmake make
script:
- cmake -Bbuild src/cpp/kiss_icp/
- cmake -Bbuild cpp/kiss_icp/
- cmake --build build -j$(nproc --all)

cpp_api:clang:
Expand All @@ -61,14 +61,14 @@ cpp_api:clang:
before_script:
- apt-get update && apt-get install --no-install-recommends -y clang cmake make
script:
- cmake cmake -DCMAKE_CXX_COMPILER=clang++ -Bbuild src/cpp/kiss_icp/
- cmake cmake -DCMAKE_CXX_COMPILER=clang++ -Bbuild cpp/kiss_icp/
- cmake --build build -j$(nproc --all)

pip_package:
image: python:3.8
stage: build
script:
- VERBOSE=1 pip install --verbose .
- VERBOSE=1 pip install --verbose ./python/
- kiss_icp_pipeline --version

ros1_wrapper:
Expand All @@ -82,6 +82,12 @@ ros1_wrapper:
- cd ~/catkin_ws/
- catkin_make

ros2_wrapper:
image: osrf/ros:humble-desktop
stage: build
script:
- colcon build --event-handlers console_direct+

#----- deployment stage ----------------------------------------------------------------------------
cibuildwheel:
stage: deploy
Expand All @@ -99,7 +105,7 @@ cibuildwheel:
script:
- curl -sSL https://get.docker.com/ | sh
- python -m pip install pipx
- pipx run cibuildwheel --output-dir wheelhouse
- pipx run cibuildwheel --output-dir wheelhouse ./python/
artifacts:
paths:
- wheelhouse/
Expand All @@ -116,5 +122,5 @@ pypi:
script:
- rm -rf dist && mkdir -p dist/ && mv wheelhouse/*.whl dist/
- python -m pip install pipx
- pipx run build --sdist
- pipx run build --sdist ./python/
- pipx run twine upload --verbose dist/*
7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
.PHONY: cpp

editable:
SETUPTOOLS_ENABLE_FEATURES="legacy-editable" pip install --verbose --prefix=$(shell python3 -m site --user-base) --editable .
SETUPTOOLS_ENABLE_FEATURES="legacy-editable" pip install --verbose --prefix=$(shell python3 -m site --user-base) --editable ./python/

install:
@pip install --verbose .
@pip install --verbose ./python/

uninstall:
@pip -v uninstall kiss_icp

docker:
@docker build -t gitlab.ipb.uni-bonn.de:4567/ipb-team/ipb-tools/kiss_icp .

docker-push:
@docker push gitlab.ipb.uni-bonn.de:4567/ipb-team/ipb-tools/kiss_icp

license:
@addlicense -f LICENSE -ignore **/*.yaml -v .
cpp:
@cmake -Bbuild cpp/kiss_icp/
@cmake --build build -j$(nproc --all)
59 changes: 11 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# KISS-ICP: In Defense of Point-to-Point ICP – Simple, Accurate, and Robust Registration If Done the Right Way

![ubuntu](https://img.shields.io/badge/ubuntu-333333?style=flat&logo=ubuntu)
![windows](https://img.shields.io/badge/windows-333333?style=flat&logo=windows&logocolor=blue)
![macos](https://img.shields.io/badge/-macos-333333?style=flat&logo=apple)

[![KISS-ICP demo](https://user-images.githubusercontent.com/21349875/211829074-474bec08-0129-4e34-85e7-62265e44a7de.png)](https://user-images.githubusercontent.com/21349875/219626075-d67e9165-31a2-4a1b-8c26-9f04e7d195ec.mp4
)

## 📰 NEWS!!! 📰 ROS API
## ROS2 support

It was never this easy, just git clone this repo into your catkin workspace and build it:

```sh
git clone https://github.com/PRBonn/kiss-icp && colcon build
```

## ROS1 support

It was never this easy, just git clone this repo into your catkin workspace and build it:

```sh
cd ~/catkin_ws/ && git clone https://github.com/PRBonn/kiss-icp && catkin build
```

For more detailed instructions on the ROS wrapper, please visit [here](src/cpp/kiss_icp_ros/ros1/README.md)
For more detailed instructions on the ROS wrappers, please visit this [README](ros/README.md)

## Install Python API

We released a python-package supported on
![macos](https://img.shields.io/badge/-macos-333333?style=flat&logo=apple),
![windows](https://img.shields.io/badge/windows-333333?style=flat&logo=windows&logocolor=blue), and
![ubuntu](https://img.shields.io/badge/ubuntu-333333?style=flat&logo=ubuntu).
Expand All @@ -31,12 +34,6 @@ To get started, just run
pip install kiss-icp
```

If you also want to install all the *(optional)* dependencies, like Open3D for running the visualizer:

```sh
pip install "kiss-icp[all]"
```

Next, follow the instructions on how to run the system by typing:

```sh
Expand All @@ -47,41 +44,7 @@ This should print the following help message:
![out](https://user-images.githubusercontent.com/21349875/193282970-25a400aa-ebcd-487a-b839-faa04eeca5b9.png)


### Install Python API (developer mode)

If you plan to modify the code then you need to setup the dev dependencies, luckilly, the only real
requirements are a modern C++ compiler and the `pip` package manager, nothing else!, in Ubuntu-based
sytems this can be done with:

```sh
sudo apt install g++ python3-pip
```

After that you can clone the code and install the python api:

```sh
git clone https://github.com/PRBonn/kiss-icp.git
cd kiss-icp
pip install --verbose .
```

### Install Python API (expert mode)

If you want to have more controll over the build, you should then install `cmake`, ,`ninja`, `tbb`,
`Eigen`, and `pybind11` as extra dependencies in your system, the ubuntu-way of doing this is:

```sh
sudo apt install build-essential libeigen3-dev libtbb-dev pybind11-dev ninja-build
```

## Authors

- Ignacio Vizzo
- Tiziano Guadagnino
- Benedikt Mersch
- Louis Wiesmann
- Jens Behley
- Cyrill Stachniss
For advanced instructions on the Python pacakge plase see [this README](python/README.md)

## Citation

Expand Down
1 change: 0 additions & 1 deletion config/advanced.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ out_dir: "results"

data:
deskew: True
frame_rate: 10.0 # only valid if deskew==True
preprocess: True
max_range: 100.0 # can be also changed in the CLI
min_range: 0.0
Expand Down
1 change: 0 additions & 1 deletion config/basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ out_dir: "results"

data:
deskew: False
frame_rate: 10.0 # <- optional only valid if deskew==True
preprocess: True
max_range: 100.0 # can be also changed in the CLI
min_range: 5.0
Expand Down
Empty file added cpp/COLCON_IGNORE
Empty file.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,24 @@ include(${CMAKE_CURRENT_LIST_DIR}/tsl_robin/tsl_robin.cmake)
if(USE_SYSTEM_EIGEN3)
find_package(Eigen3 QUIET NO_MODULE)
endif()
if(NOT USE_SYSTEM_EIGEN3 OR NOT EIGEN3_FOUND)
if(NOT USE_SYSTEM_EIGEN3 OR NOT TARGET Eigen3::Eigen)
set(USE_SYSTEM_EIGEN3 OFF)
include(${CMAKE_CURRENT_LIST_DIR}/eigen/eigen.cmake)
endif()

if(USE_SYSTEM_SOPHUS)
find_package(Sophus QUIET NO_MODULE)
endif()
if(NOT USE_SYSTEM_SOPHUS OR NOT TARGET Sophus::Sophus)
set(USE_SYSTEM_SOPHUS OFF)
include(${CMAKE_CURRENT_LIST_DIR}/sophus/sophus.cmake)
endif()

# tbb needs to be statically linked, so, also do it always :)
if(USE_SYSTEM_TBB)
find_package(TBB QUIET NO_MODULE)
endif()
if(NOT USE_SYSTEM_TBB OR NOT TBB_FOUND)
if(NOT USE_SYSTEM_TBB OR NOT TARGET TBB::tbb)
set(USE_SYSTEM_TBB OFF)
include(${CMAKE_CURRENT_LIST_DIR}/tbb/tbb.cmake)
endif()
19 changes: 19 additions & 0 deletions cpp/kiss_icp/3rdparty/sophus/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2008-2015 Jesse Beder.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWAR
44 changes: 44 additions & 0 deletions cpp/kiss_icp/3rdparty/sophus/sophus.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# MIT License
#
# # Copyright (c) 2023 Saurabh Gupta, Ignacio Vizzo, Cyrill Stachniss, University of Bonn
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
include(ExternalProject)

ExternalProject_Add(
external_sophus
PREFIX sophus
URL https://github.com/strasdat/Sophus/archive/refs/tags/1.22.10.tar.gz
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DSOPHUS_USE_BASIC_LOGGING=ON
-DBUILD_SOPHUS_EXAMPLES=OFF
-DBUILD_SOPHUS_TESTS=OFF
-DCMAKE_BUILD_TYPE=Release)

ExternalProject_Get_Property(external_sophus SOURCE_DIR)
add_library(SophusHelper INTERFACE)
add_dependencies(SophusHelper external_sophus)
target_compile_definitions(SophusHelper INTERFACE SOPHUS_USE_BASIC_LOGGING=1)
target_include_directories(SophusHelper SYSTEM INTERFACE $<BUILD_INTERFACE:${SOURCE_DIR}>)
set_property(TARGET SophusHelper PROPERTY EXPORT_NAME Sophus::Sophus)
add_library(Sophus::Sophus ALIAS SophusHelper)
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
cmake_minimum_required(VERSION 3.16...3.24)
project(kiss_icp VERSION 0.1.3 LANGUAGES CXX)
project(kiss_icp_cpp VERSION 0.2.0 LANGUAGES CXX)

# Setup build options
option(USE_SYSTEM_EIGEN3 "Use system pre-installed eigen3" ON)
option(USE_SYSTEM_EIGEN3 "Use system pre-installed Eigen" ON)
option(USE_SYSTEM_SOPHUS "Use system pre-installed Sophus" ON)
option(USE_SYSTEM_TBB "Use system pre-installed oneAPI/tbb" ON)

# Set build type (repeat here for C++ only consumers)
Expand All @@ -37,6 +38,4 @@ include(cmake/CompilerOptions.cmake)

add_subdirectory(core)
add_subdirectory(metrics)
if(NOT BUILD_PYTHON_BINDINGS)
add_subdirectory(pipeline)
endif()
add_subdirectory(pipeline)
22 changes: 22 additions & 0 deletions cpp/kiss_icp/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2022 Ignacio Vizzo, Tiziano Guadagnino, Benedikt Mersch, Cyrill
Stachniss.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 14 additions & 0 deletions cpp/kiss_icp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# KISS-ICP C++ Library

## How to build

```sh
cmake -Bbuild
cmake --build build -j$(nproc --all)
```

## Dependencies

The cmake build system should handle all dependencies for you. In case you have some particular
requirements for the library dependencies, by default the build system will attempt to use the
ones you have installed on your local system.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
add_library(core STATIC)
add_library(kiss_icp::core ALIAS core)
target_sources(core PRIVATE Registration.cpp Deskew.cpp VoxelHashMap.cpp Preprocessing.cpp Threshold.cpp)
target_link_libraries(core PUBLIC Eigen3::Eigen tsl::robin_map TBB::tbb)
target_link_libraries(core PUBLIC Eigen3::Eigen tsl::robin_map TBB::tbb Sophus::Sophus)
set_global_target_properties(core)
Loading

0 comments on commit 71a6a0b

Please sign in to comment.