Skip to content

Commit

Permalink
Initial open source commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nachovizzo committed Mar 25, 2021
0 parents commit fcb7baf
Show file tree
Hide file tree
Showing 61 changed files with 2,958 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/.git
**/.bin
**/.ply
**/*results/
**/*data/
174 changes: 174 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
**/*results/
**/*data/

# 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/
pip-wheel-metadata/
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/

# 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
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.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

# 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/

# End of https://www.toptal.com/developers/gitignore/api/python,c++
86 changes: 86 additions & 0 deletions 3rdparty/Open3D.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/bin/bash
# Install Open3D with GeneralizedICP support
# Based on Open3D/util/ci_utils.sh

set -ex

NPROC=${NPROC:-$(getconf _NPROCESSORS_ONLN)} # POSIX: MacOS + Linux

# Patch for PSR
patch_psr() {
git apply --ignore-whitespace <<EOF
diff --git a/Src/FEMTree.Initialize.inl b/Src/FEMTree.Initialize.inl
index df0e156..cb6ca50 100644
--- a/Src/FEMTree.Initialize.inl
+++ b/Src/FEMTree.Initialize.inl
@@ -190,7 +190,7 @@ size_t FEMTreeInitializer< Dim , Real >::Initialize( FEMTreeNode& root , InputPo
pointStream.reset();
}
if( outOfBoundPoints ) WARN( "Found out-of-bound points: " , outOfBoundPoints );
- if( badData ) WARN( "Found bad data: " , badData );
+ /* if( badData ) WARN( "Found bad data: " , badData ); */
if( std::is_same< Real , float >::value )
{
std::vector< size_t > badNodeCounts( ThreadPool::NumThreads() , 0 );
diff --git a/Src/FEMTree.IsoSurface.specialized.inl b/Src/FEMTree.IsoSurface.specialized.inl
index 28b5ef0..88710e4 100644
--- a/Src/FEMTree.IsoSurface.specialized.inl
+++ b/Src/FEMTree.IsoSurface.specialized.inl
@@ -1855,7 +1855,7 @@ public:
FEMTree< Dim , Real >::MemoryUsage();
if( pointEvaluator ) delete pointEvaluator;
size_t badRootCount = _BadRootCount;
- if( badRootCount!=0 ) WARN( "bad average roots: " , badRootCount );
+ /* if( badRootCount!=0 ) WARN( "bad average roots: " , badRootCount ); */
return isoStats;
}
};
EOF
}

build_all() {

echo "Using cmake: $(which cmake)"
cmake --version

mkdir -p build
cd build

cmakeOptions=(
-DCMAKE_BUILD_TYPE=Release
-DPYTHON_EXECUTABLE="$(which python)"
-DBUILD_LIBREALSENSE=OFF
-DBUILD_UNIT_TESTS=OFF
-DBUILD_BENCHMARKS=OFF
-DBUILD_EXAMPLES=OFF
-DENABLE_HEADLESS_RENDERING=ON
-DBUILD_GUI=OFF
-DUSE_SYSTEM_GLEW=OFF
-DUSE_SYSTEM_GLFW=OFF
)

echo Running cmake "${cmakeOptions[@]}" ..
cmake "${cmakeOptions[@]}" ..
echo "Build & install Open3D..."
make VERBOSE=1 -j"$NPROC"
make install -j"$NPROC"
make VERBOSE=1 install-pip-package -j"$NPROC"
}

# install open3d with python bindings
git clone --depth 1 --recurse-submodules \
https://github.com/nachovizzo/Open3D.git /tmp/Open3D -b nacho/generalized_icp &&
cd /tmp/Open3D/

# Patch Poisson Surface Reconstruction so it doesn't fill up the console.
cd 3rdparty/PoissonRecon/PoissonRecon/ && patch_psr && cd -

# Was impossible to pass the SUDO env variable to the script, so remove it :)
sed -i 's/sudo//' util/install_deps_ubuntu.sh

# install Open3D dependencies
bash util/install_deps_ubuntu.sh assume-yes

# Build and cleanup to save space
build_all
rm -rf /tmp/Open3D && rm -rf /var/lib/apt/lists/*
20 changes: 20 additions & 0 deletions 3rdparty/cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# Instructions from https://apt.kitware.com/

set -ex

apt-get update && apt-get install --no-install-recommends -y \
apt-transport-https \
ca-certificates \
gnupg \
software-properties-common &&
rm -rf /var/lib/apt/lists/*

wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null |
gpg --dearmor - |
tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null

apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'
apt-get update && apt-get install --no-install-recommends -y \
cmake &&
rm -rf /var/lib/apt/lists/*
16 changes: 16 additions & 0 deletions 3rdparty/embree.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Taken from the trimesh library, all copyrights belong to the original authors
# https://raw.githubusercontent.com/mikedh/trimesh/master/docker/builds/embree.bash
set -xe

# Fetch the archive from GitHub releases.
wget https://github.com/embree/embree/releases/download/v2.17.7/embree-2.17.7.x86_64.linux.tar.gz -O /tmp/embree.tar.gz -nv
echo "2c4bdacd8f3c3480991b99e85b8f584975ac181373a75f3e9675bf7efae501fe /tmp/embree.tar.gz" | sha256sum --check
tar -xzf /tmp/embree.tar.gz --strip-components=1 -C /usr/local
# remove archive
rm -rf /tmp/embree.tar.gz

# Install python bindings for embree (and upstream requirements).
pip install --no-cache-dir numpy cython
pip install --no-cache-dir https://github.com/scopatz/pyembree/releases/download/0.1.6/pyembree-0.1.6.tar.gz
20 changes: 20 additions & 0 deletions 3rdparty/patch_pykitti.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -ex

# Obtain the location of the pykitti package
pykitti_dir=$(
python - <<-EOF
import sys
import traceback
import os
try:
import pykitti
except ModuleNotFoundError as err:
print(os.path.dirname(traceback.extract_tb(sys.exc_info()[2])[-1].filename))
EOF
)

echo "Patching pykitti in $pykitti_dir"
sed -i '/import cv2/d' "${pykitti_dir}/tracking.py"
Loading

0 comments on commit fcb7baf

Please sign in to comment.