mirror of https://github.com/koide3/small_gicp.git
setup.py
This commit is contained in:
parent
cf5de1e6b6
commit
91f01900a8
|
|
@ -79,16 +79,18 @@ endif()
|
|||
find_package(Python COMPONENTS Interpreter Development)
|
||||
find_package(pybind11 CONFIG)
|
||||
|
||||
# Python binding
|
||||
pybind11_add_module(small_gicp src/python/python.cpp)
|
||||
target_include_directories(small_gicp PUBLIC
|
||||
include
|
||||
${EIGEN3_INCLUDE_DIR}
|
||||
)
|
||||
target_link_libraries(small_gicp PRIVATE
|
||||
small_gicp_helper
|
||||
OpenMP::OpenMP_CXX
|
||||
)
|
||||
# Python bindings
|
||||
if(BUILD_PYTHON_BINDINGS)
|
||||
pybind11_add_module(small_gicp src/python/python.cpp)
|
||||
target_include_directories(small_gicp PUBLIC
|
||||
include
|
||||
${EIGEN3_INCLUDE_DIR}
|
||||
)
|
||||
target_link_libraries(small_gicp PRIVATE
|
||||
small_gicp_helper
|
||||
OpenMP::OpenMP_CXX
|
||||
)
|
||||
endif()
|
||||
|
||||
###############
|
||||
## Benchmark ##
|
||||
|
|
@ -108,7 +110,8 @@ if(BUILD_BENCHMARKS)
|
|||
add_compile_definitions(BUILD_WITH_IRIDESCENCE)
|
||||
endif()
|
||||
if (BUILD_WITH_FAST_GICP)
|
||||
set(FAST_GICP_INCLUDE_DIR /home/koide/workspace/fast_gicp/include)
|
||||
# set(FAST_GICP_INCLUDE_DIR /home/koide/workspace/fast_gicp/include)
|
||||
set(FAST_GICP_INCLUDE_DIR $ENV{FAST_GICP_INCLUDE_DIR})
|
||||
add_compile_definitions(BUILD_WITH_FAST_GICP)
|
||||
endif()
|
||||
|
||||
|
|
|
|||
12
README.md
12
README.md
|
|
@ -1,12 +1,12 @@
|
|||
# small_gicp (fast_gicp2)
|
||||
|
||||
**small_gicp** is a header-only C++ library that provides efficient and parallelized fine point cloud registration algorithms (ICP, Point-to-Plane ICP, GICP, VGICP, etc.). It is a refined and optimized version of its predecessor, [fast_gicp](https://github.com/SMRT-AIST/fast_gicp), with the following features.
|
||||
**small_gicp** is a header-only C++ library that offers efficient and parallelized algorithms for fine point cloud registration (ICP, Point-to-Plane ICP, GICP, VGICP, etc.). It is a refined and optimized version of its predecessor, [fast_gicp](https://github.com/SMRT-AIST/fast_gicp), re-written from scratch with the following features.
|
||||
|
||||
- **Highly Optimized** : The implementation of the core registration algorithm is further optimized from that in fast_gicp. It offers up to 2x speed up compared to fast_gicp.
|
||||
- **All parallerized** : small_gicp offers parallelized implementations of several algorithms in the point cloud registration process (Downsampling, KdTree construction, Normal/covariance estimation). As a parallelism backend, either (or both) of [OpenMP](https://www.openmp.org/) and [Intel TBB](https://github.com/oneapi-src/oneTBB) can be used.
|
||||
- **Minimum dependency** : Only [Eigen](https://eigen.tuxfamily.org/) (and bundled [nanoflann](https://github.com/jlblancoc/nanoflann) and [Sophus](https://github.com/strasdat/Sophus)) are required at a minimum. Optionally, it provides the [PCL](https://pointclouds.org/) registration interface so that it can be used as a drop-in replacement in many systems.
|
||||
- **Customizable** : small_gicp is implemented with the trait mechanism that allows feeding any custom point cloud class to the registration algorithm. Furthermore, the template-based implementation allows customizing the regisration process with your original correspondence estimator and registration factors.
|
||||
- **Python bindinds** (coming soon) : The isolation from PCL makes the small_gicp's python bindinds more portable and connectable to other libraries seamlessly.
|
||||
- **Highly Optimized** : The implementation of the core registration algorithm is further optimized from that in fast_gicp. It enables up to **2x speed gain** compared to fast_gicp.
|
||||
- **All parallerized** : small_gicp offers parallelized implementations of several preprocessing algorithms to make the entire registration process parallelized (Downsampling, KdTree construction, Normal/covariance estimation). As a parallelism backend, either (or both) of [OpenMP](https://www.openmp.org/) and [Intel TBB](https://github.com/oneapi-src/oneTBB) can be used.
|
||||
- **Minimum dependency** : Only [Eigen](https://eigen.tuxfamily.org/) (and bundled [nanoflann](https://github.com/jlblancoc/nanoflann) and [Sophus](https://github.com/strasdat/Sophus)) are required at a minimum. Optionally, it provides the [PCL](https://pointclouds.org/) registration interface so that it can be used as a drop-in replacement for registration algorithms in PCL.
|
||||
- **Customizable** : small_gicp is implemented with the trait mechanism that enables feeding any custom point cloud class to the registration algorithm. Furthermore, the template-based implementation allows customizing the regisration process with your original correspondence estimator and registration factors.
|
||||
- **Python bindinds** : The isolation from PCL makes small_gicp's python bindinds more portable and connectable to other libraries seamlessly.
|
||||
|
||||
Note that GPU-based implementations are NOT included in this package.
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,13 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
&& apt-get install --no-install-recommends -y \
|
||||
wget nano build-essential git cmake \
|
||||
wget nano build-essential git cmake python3-pip pybind11-dev \
|
||||
libeigen3-dev libfmt-dev libtbb-dev libomp-dev libpcl-dev libgtest-dev \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip install -U setuptools pytest numpy scipy
|
||||
|
||||
COPY . /root/small_gicp
|
||||
WORKDIR /root/small_gicp/build
|
||||
RUN rm -rf ./*
|
||||
|
|
@ -22,6 +24,10 @@ RUN cmake .. -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_BENCHMARKS=ON -DBUILD_
|
|||
RUN cmake --build . -j$(nproc)
|
||||
RUN ctest -j$(nproc)
|
||||
|
||||
WORKDIR /root/small_gicp
|
||||
RUN python3 setup.py build && python3 setup.py install
|
||||
RUN pytest src/example/basic_registration.py
|
||||
|
||||
WORKDIR /
|
||||
|
||||
CMD ["bash"]
|
||||
|
|
@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
&& apt-get install --no-install-recommends -y \
|
||||
wget nano build-essential git cmake \
|
||||
wget nano build-essential git cmake python3-pip pybind11-dev \
|
||||
libeigen3-dev libfmt-dev libtbb-dev libomp-dev libpcl-dev libgtest-dev \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
|
@ -15,6 +15,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
|||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip install -U setuptools pytest numpy scipy
|
||||
|
||||
RUN update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld 50
|
||||
ENV CC=clang
|
||||
ENV CXX=clang++
|
||||
|
|
@ -30,6 +32,10 @@ RUN cmake .. -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_BENCHMARKS=ON -DBUILD_
|
|||
RUN cmake --build . -j$(nproc)
|
||||
RUN ctest -j$(nproc)
|
||||
|
||||
WORKDIR /root/small_gicp
|
||||
RUN python3 setup.py build && python3 setup.py install
|
||||
RUN pytest src/example/basic_registration.py
|
||||
|
||||
WORKDIR /
|
||||
|
||||
CMD ["bash"]
|
||||
5
setup.py
5
setup.py
|
|
@ -45,8 +45,8 @@ class CMakeBuild(build_ext):
|
|||
# EXAMPLE_VERSION_INFO shows you how to pass a value into the C++ code
|
||||
# from Python.
|
||||
cmake_args = [
|
||||
f"-DBUILD_PYTHON_BINDINGS=ON",
|
||||
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}",
|
||||
f"-DPYTHON_EXECUTABLE={sys.executable}",
|
||||
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
|
||||
]
|
||||
build_args = []
|
||||
|
|
@ -55,9 +55,6 @@ class CMakeBuild(build_ext):
|
|||
if "CMAKE_ARGS" in os.environ:
|
||||
cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item]
|
||||
|
||||
# In this example, we pass in the version to C++. You might not need to.
|
||||
cmake_args += [f"-DEXAMPLE_VERSION_INFO={self.distribution.get_version()}"]
|
||||
|
||||
if self.compiler.compiler_type != "msvc":
|
||||
# Using Ninja-build since it a) is available as a wheel and b)
|
||||
# multithreads automatically. MSVC would require all variables be
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import numpy
|
|||
from scipy.spatial.transform import Rotation
|
||||
|
||||
import small_gicp
|
||||
from pyridescence import *
|
||||
|
||||
|
||||
# Basic registation example with numpy arrays
|
||||
|
|
@ -97,8 +96,8 @@ def verify_result(T_target_source, gt_T_target_source):
|
|||
error_trans = numpy.linalg.norm(error[:3, 3])
|
||||
error_rot = Rotation.from_matrix(error[:3, :3]).magnitude()
|
||||
|
||||
assert error_trans < 0.01
|
||||
assert error_rot < 0.01
|
||||
assert error_trans < 0.05
|
||||
assert error_rot < 0.05
|
||||
|
||||
import pytest
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue