Skip to content

Commit

Permalink
Merge pull request #48 from LimHyungTae/support_ros2
Browse files Browse the repository at this point in the history
Support ROS2 in a stand-alone repository
  • Loading branch information
LimHyungTae authored May 30, 2024
2 parents dc33f59 + 638e575 commit 3e0a57a
Show file tree
Hide file tree
Showing 28 changed files with 1,117 additions and 62 deletions.
219 changes: 217 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,223 @@
.vscode/

build/

*/build/
examples/cpp/demo_visualize
examples/cpp/demo_sequential

Open3D/
Open3D/

install/
log/
results/
wheelhouse/
_skbuild/
.gitlab-ci-local/

# Created by https://www.toptal.com/developers/gitignore/api/python,c++
# Edit at https://www.toptal.com/developers/gitignore?templates=python,c++
### C++ ###
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
cmake-build-release*
cmake-build-debug*
.idea*

# End of https://www.toptal.com/developers/gitignore/api/python,c++
*.orig
# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# End of https://www.toptal.com/developers/gitignore/api/python
nn
63 changes: 37 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
# Patchwork++

## :bookmark_tabs: About Patchwork++ (IROS'22)

* A fast, robust, and self-adaptive **ground segmentation algorithm** on 3D point cloud.

<p align="center"><img src=pictures/patchwork++.gif alt="animated" /></p>

* An extension of [Patchwork][patchworklink] (RA-L'21 with IROS'21).
* Please refer our [paper][patchworkppIEEElink] for detailed explanantions and experimental results!

* Validated on [SemanticKITTI][SemanticKITTIlink] dataset. The benchmark code is available on [here][benchmarklink].

* :bulb: Contents: [YouTube][YouTubeLink], [arXiv][arXivlink], [IEEE *Xplore*][patchworkppIEEElink]
<div align="center">
<h1>Patchwork++</h1>
<a href="https://github.com/url-kaist/patchwork-plusplus/tree/master/patchworkpp"><img src="https://img.shields.io/badge/-C++-blue?logo=cplusplus" /></a>
<a href="https://github.com/url-kaist/patchwork-plusplus/tree/master"><img src="https://img.shields.io/badge/Python-3670A0?logo=python&logoColor=ffdd54" /></a>
<a href="https://github.com/url-kaist/patchwork-plusplus/tree/master/ros"><img src="https://img.shields.io/badge/ROS2-Humble-blue" /></a>
<a href="https://github.com/url-kaist/patchwork-plusplus/tree/master"><img src="https://img.shields.io/badge/Linux-FCC624?logo=linux&logoColor=black" /></a>
<a href="https://ieeexplore.ieee.org/document/9981561"><img src="https://img.shields.io/badge/DOI-10.1109/IROS47612.2022.9981561-004088.svg"/>
<br />
<br />
<a href=https://www.youtube.com/watch?v=fogCM159GRk>Video</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://github.com/url-kaist/patchwork-plusplus/tree/master/README.md###Python">Install</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://github.com/url-kaist/patchwork-plusplus/tree/master/ros">ROS2</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href=https://www.youtube.com/watch?v=fogCM159GRk>Paper</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href=https://github.com/url-kaist/patchwork-plusplus/issues>Contact Us</a>
<br />
<br />
<p align="center"><img src=pictures/patchwork++.gif alt="animated" /></p>

[Patchwork++][arXivlink], an extension of [Patchwork][patchworklink], is **a fast, robust, and self-adaptive ground segmentation algorithm** on 3D point cloud.
</div>

[YouTubeLInk]: https://www.youtube.com/watch?v=fogCM159GRk
[arXivlink]: https://arxiv.org/abs/2207.11919
Expand All @@ -25,7 +35,7 @@
* Python binding of Patchwork++ using pybind11 ([python_wrapper][wraplink])
* Examples codes, which visualizes a ground segmentation result by Patchwork++ ([examples][examplelink]) :thumbsup:

> If you are familiar with ROS, you can also visit [here][roslink] and try executing ROS-based Patchwork++!
> If you are familiar with ROS1, you can also visit [here][roslink] and try executing ROS1-based Patchwork++!
[roslink]: https://github.com/url-kaist/patchwork-plusplus-ros

Expand Down Expand Up @@ -73,13 +83,13 @@ $ sudo make install
### Python
```bash
# in patchwork-plusplus directory
$ pip install .
$ cd python && pip install .
```

### C++
```bash
# in patchwork-plusplus directory
$ mkdir build && cd build
$ mkdir cpp/build && cd cpp/build
$ cmake ..
$ make
```
Expand All @@ -91,22 +101,22 @@ $ make
### Python
```bash
# Run patchwork++ and visualize ground points(green) and nonground points(red)
$ python examples/python/demo_visualize.py
$ python examples/demo_visualize.py

# Run patchwork++ with sequential point cloud inputs
$ python examples/python/demo_sequential.py
$ python examples/demo_sequential.py
```

### C++
```bash
# Run patchwork++ and visualize ground points(green) and nonground points(red)
$ ./build/examples/cpp/demo_visualize
$ ./examples/demo_visualize

# Run patchwork++ with sequential point cloud inputs
$ ./build/examples/cpp/demo_sequential
$ ./examples/demo_sequential

# Run patchwork++ with your point cloud file, example here
$ ./build/examples/cpp/demo_visualize ./data/000000.bin # specify file path
$ ./examples/demo_visualize ./data/000000.bin # specify file path
```

### Demo Result
Expand Down Expand Up @@ -143,17 +153,18 @@ In addition, you can also check the paper of our baseline, Patchwork. ([arXiv][p

## :triangular_flag_on_post: Tested Environment

- Ubuntu 18.04 and 20.04
- Ubuntu ~~18.04 and~~ 20.04 and 22.04
- CMake 3.25.1 (>=3.20, min. Required to install Open3D)
- Open3D 0.15.2
- In `scripts/install_open3d.bash`, the installation of the higher version of CMake is already implemented.
- Open3D ~~0.15.2~~ 0.18.0
- pybind11 v2.2.3
- Eigen 3.3.7


## :mailbox: Contact Information
If you have any questions, please do not hesitate to contact us
* [Seungjae Lee][sjlink] :envelope: `sj98lee at kaist.ac.kr`
* [Hyungtae Lim][htlink] :envelope: `shapelim at kaist.ac.kr`
* [Seungjae Lee][sjlink] :envelope: sj98lee `at` kaist `ac` kr
* [Hyungtae Lim][htlink] :envelope: shapelim `at` kaist `ac` kr

[sjlink]: https://github.com/seungjae24
[htlink]: https://github.com/LimHyungTae
21 changes: 5 additions & 16 deletions CMakeLists.txt → cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.11)
project(PATCHWORK VERSION 1.0.0)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 20)
set(PYTHON_EXECUTABLE python3)
set(CMAKE_BUILD_TYPE Release)

Expand All @@ -22,19 +22,8 @@ list(APPEND Open3D_LIBRARIES dl)

add_subdirectory(patchworkpp)

set(INCLUDE_PYTHON_WRAPPER OFF CACHE BOOL "Build Python wrapper")
set(INCLUDE_EXAMPLES ON CACHE BOOL "Build examples")

if (INCLUDE_PYTHON_WRAPPER)

message(STATUS "Building Python wrapper")
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
include(FetchContent)
include(pybind11)
add_subdirectory(python_wrapper)

endif()

if (INCLUDE_EXAMPLES)

message(STATUS "Building examples for c++")
Expand All @@ -44,14 +33,14 @@ if (INCLUDE_EXAMPLES)
link_directories(${Open3D_LIBRARY_DIRS})
message(STATUS "Found Open3D ${Open3D_VERSION}")

add_executable(demo_visualize examples/cpp/demo_visualize.cpp)
add_executable(demo_visualize ${CMAKE_CURRENT_SOURCE_DIR}/patchworkpp/examples/demo_visualize.cpp)
target_link_libraries(demo_visualize PRIVATE PATCHWORK::patchworkpp ${Open3D_LIBRARIES} "stdc++fs")
target_include_directories(demo_visualize PUBLIC ${Open3D_INCLUDE_DIRS})
set_target_properties(demo_visualize PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build/examples/cpp")
set_target_properties(demo_visualize PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/examples")

add_executable(demo_sequential examples/cpp/demo_sequential.cpp)
add_executable(demo_sequential ${CMAKE_CURRENT_SOURCE_DIR}/patchworkpp/examples/demo_sequential.cpp)
target_link_libraries(demo_sequential PRIVATE PATCHWORK::patchworkpp ${Open3D_LIBRARIES} "stdc++fs")
target_include_directories(demo_sequential PUBLIC ${Open3D_INCLUDE_DIRS})
set_target_properties(demo_sequential PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build/examples/cpp")
set_target_properties(demo_sequential PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/examples")

endif()
Empty file added cpp/COLCON_IGNORE
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3e0a57a

Please sign in to comment.