Date: Fri, 3 Feb 2023 09:33:46 +0100
Subject: [PATCH 1/3] init code release
---
.gitignore | 175 +++++++++++
PREPARE_DATA.md | 63 ++++
README.md | 146 ++++++++-
config/fr079_nof_weights.ckpt | Bin 0 -> 5907839 bytes
.../global_localization/loc_config_test1.yml | 65 ++++
.../global_localization/loc_config_test2.yml | 67 +++++
.../global_localization/loc_config_test3.yml | 67 +++++
.../global_localization/loc_config_test4.yml | 67 +++++
.../global_localization/loc_config_test5.yml | 67 +++++
config/intel_nof_weights.ckpt | Bin 0 -> 5907775 bytes
config/ipblab_nof_weights.ckpt | Bin 0 -> 5895043 bytes
config/mit_nof_weights.ckpt | Bin 0 -> 5907775 bytes
config/pose_tracking/loc_config_test1.yml | 59 ++++
config/pose_tracking/loc_config_test2.yml | 59 ++++
config/pose_tracking/loc_config_test3.yml | 59 ++++
config/pose_tracking/loc_config_test4.yml | 59 ++++
config/pose_tracking/loc_config_test5.yml | 59 ++++
environment.yml | 131 ++++++++
eval.py | 131 ++++++++
loc_demo.py | 56 ++++
main.py | 171 +++++++++++
mcl/CMakeLists.txt | 13 +
mcl/Makefile | 2 +
mcl/initialization.py | 53 ++++
mcl/motion_model.py | 183 ++++++++++++
mcl/rendering.py | 176 +++++++++++
mcl/sensor_model.py | 78 +++++
mcl/setup.py | 85 ++++++
mcl/srrg_utils/pf_library/pf_utils.py | 18 ++
.../pf_library/pybind/CMakeLists.txt | 4 +
.../pf_library/pybind/pf_library.cpp | 74 +++++
mcl/srrg_utils/pf_library/pybind/pf_library.h | 26 ++
.../pf_library/pybind/pf_library_pybind.cpp | 29 ++
.../pf_library/pybind/stl_vector_eigen.h | 105 +++++++
mcl/srrg_utils/test_srrg.py | 13 +
mcl/vis_loc_result.py | 178 +++++++++++
mcl/visualizer.py | 282 ++++++++++++++++++
nof/__init__.py | 0
nof/criteria/__init__.py | 8 +
nof/criteria/loss.py | 47 +++
nof/criteria/metrics.py | 30 ++
nof/criteria/pointcloud_metrics.py | 44 +++
nof/dataset/__init__.py | 6 +
nof/dataset/ipb2dmapping.py | 128 ++++++++
nof/dataset/ray_utils.py | 58 ++++
nof/networks/__init__.py | 1 +
nof/networks/models.py | 123 ++++++++
nof/nof_utils.py | 134 +++++++++
nof/render.py | 194 ++++++++++++
shells/loc_demo.sh | 6 +
shells/pretraining/fr079.sh | 13 +
shells/pretraining/intel.sh | 14 +
shells/pretraining/ipblab.sh | 13 +
shells/pretraining/mit.sh | 13 +
train.py | 159 ++++++++++
utils.py | 236 +++++++++++++++
56 files changed, 4036 insertions(+), 11 deletions(-)
create mode 100644 .gitignore
create mode 100644 PREPARE_DATA.md
create mode 100644 config/fr079_nof_weights.ckpt
create mode 100644 config/global_localization/loc_config_test1.yml
create mode 100644 config/global_localization/loc_config_test2.yml
create mode 100644 config/global_localization/loc_config_test3.yml
create mode 100644 config/global_localization/loc_config_test4.yml
create mode 100644 config/global_localization/loc_config_test5.yml
create mode 100644 config/intel_nof_weights.ckpt
create mode 100644 config/ipblab_nof_weights.ckpt
create mode 100644 config/mit_nof_weights.ckpt
create mode 100644 config/pose_tracking/loc_config_test1.yml
create mode 100644 config/pose_tracking/loc_config_test2.yml
create mode 100644 config/pose_tracking/loc_config_test3.yml
create mode 100644 config/pose_tracking/loc_config_test4.yml
create mode 100644 config/pose_tracking/loc_config_test5.yml
create mode 100644 environment.yml
create mode 100644 eval.py
create mode 100644 loc_demo.py
create mode 100644 main.py
create mode 100644 mcl/CMakeLists.txt
create mode 100644 mcl/Makefile
create mode 100644 mcl/initialization.py
create mode 100644 mcl/motion_model.py
create mode 100644 mcl/rendering.py
create mode 100644 mcl/sensor_model.py
create mode 100644 mcl/setup.py
create mode 100644 mcl/srrg_utils/pf_library/pf_utils.py
create mode 100644 mcl/srrg_utils/pf_library/pybind/CMakeLists.txt
create mode 100644 mcl/srrg_utils/pf_library/pybind/pf_library.cpp
create mode 100644 mcl/srrg_utils/pf_library/pybind/pf_library.h
create mode 100644 mcl/srrg_utils/pf_library/pybind/pf_library_pybind.cpp
create mode 100644 mcl/srrg_utils/pf_library/pybind/stl_vector_eigen.h
create mode 100644 mcl/srrg_utils/test_srrg.py
create mode 100644 mcl/vis_loc_result.py
create mode 100644 mcl/visualizer.py
create mode 100644 nof/__init__.py
create mode 100644 nof/criteria/__init__.py
create mode 100644 nof/criteria/loss.py
create mode 100644 nof/criteria/metrics.py
create mode 100644 nof/criteria/pointcloud_metrics.py
create mode 100644 nof/dataset/__init__.py
create mode 100644 nof/dataset/ipb2dmapping.py
create mode 100644 nof/dataset/ray_utils.py
create mode 100644 nof/networks/__init__.py
create mode 100644 nof/networks/models.py
create mode 100644 nof/nof_utils.py
create mode 100644 nof/render.py
create mode 100644 shells/loc_demo.sh
create mode 100644 shells/pretraining/fr079.sh
create mode 100755 shells/pretraining/intel.sh
create mode 100644 shells/pretraining/ipblab.sh
create mode 100644 shells/pretraining/mit.sh
create mode 100644 train.py
create mode 100644 utils.py
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e65e8c4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,175 @@
+.idea/
+
+# logs
+logs*
+test.py
+
+# data
+data/
+results/
+
+
+### Python ###
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# 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
+
+# pdm
+# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
+#pdm.lock
+# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
+# in version control.
+# https://pdm.fming.dev/#use-with-ide
+.pdm.toml
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
+__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.
+#.idea/
+
+# End of https://www.toptal.com/developers/gitignore/api/python
+nn
\ No newline at end of file
diff --git a/PREPARE_DATA.md b/PREPARE_DATA.md
new file mode 100644
index 0000000..469358d
--- /dev/null
+++ b/PREPARE_DATA.md
@@ -0,0 +1,63 @@
+## IPBLab dataset
+Downloading IPBLab dataset from our server:
+```shell
+cd ir-mcl && mkdir data
+wget https://www.ipb.uni-bonn.de/html/projects/kuang2023ral/ipblab.zip
+unzip ipblab.zip
+```
+
+For each sequence, we provide :
+- seq_{id}.bag: the ROS bag format, include raw odometer reading and raw lidar reading.
+- seq_{id}.json: include raw odometer reading, ground-truth poses, and raw lidar reading.
+- seq_{id}_gt_pose: the ground-truth poses in TUM format (for evaluation with evo).
+
+Besides, there are also some configuration files are provided:
+- lidar_info.json: the parameters of the 2D LiDAR sensor.
+- occmap.npy: the pre-built occupancy grid map.
+- b2l.txt: the transformation from the lidar link to robot's base link
+
+The final data structure should look like
+```
+data/
+├── ipblab/
+│ ├── loc_test/
+│ │ ├── test1/
+│ │ │ ├──seq_1.bag
+│ │ │ ├──seq_1.json
+│ │ │ ├──seq_1_gt_pose.txt
+│ │ ├──b2l.txt
+│ ├──lidar_info.json
+│ ├──occmap.npy
+```
+
+There is one sequence available for the localization experiments now, the full dataset will be released after our dataset paper is published!
+
+## Intel Lab datatse, Freiburg Building 079 dataset, and MIT CSAIL dataset
+Downloading these three classical indoor 2D SLAM datasets from our server:
+```shell
+cd ir-mcl && mkdir data
+wget https://www.ipb.uni-bonn.de/html/projects/kuang2023ral/2dslam.zip
+unzip 2dslam.zip
+```
+
+For each sequence, we provide :
+- train.json: the training set which is used for mapping or train the NOF model.
+- val.json: the validation set for evaluating the model during training.
+- test.json: the test set for evaluating the final model.
+- occmap.npy: the pre-built occupancy grid map by using training set.
+
+The final data structure should look like
+```
+data/
+├── fr079/
+│ ├──occmap.npy
+│ ├──train.json
+│ ├──val.json
+│ ├──test.json
+├── intel/
+│ ├──...
+├── mit/
+│ ├──...
+```
+
+Here, we provide the converted format of these dataset for ease of use. The raw data could be found on our website: [2D Laser Dataset](https://www.ipb.uni-bonn.de/datasets/).
\ No newline at end of file
diff --git a/README.md b/README.md
index 4a975b7..22f0a74 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,24 @@
-# IR-MCL: Implicit Representation-Based Online Global Localization
-This repo contains the code of the paper:
-*IR-MCL: Implicit Representation-Based Online Global Localization*,
-
-by [Haofei Kuang](https://www.ipb.uni-bonn.de/people/haofei-kuang/), [Xieyuanli Chen](https://www.ipb.uni-bonn.de/people/xieyuanli-chen/), [Tiziano Guadagnino](https://phd.uniroma1.it/web/TIZIANO-GUADAGNINO_nP1536210_IT.aspx), [Nicky Zimmerman](https://www.ipb.uni-bonn.de/people/nicky-zimmerman/), [Jens Behley](https://www.ipb.uni-bonn.de/people/jens-behley/) and [Cyrill Stachniss](https://www.ipb.uni-bonn.de/people/cyrill-stachniss/)
+
+
IR-MCL: Implicit Representation-Based Online Global Localization
+
+ Haofei Kuang
+ ·
+ Xieyuanli Chen
+ ·
+ Tiziano Guadagnino
+ ·
+ Nicky Zimmerman
+ ·
+ Jens Behley
+ ·
+ Cyrill Stachniss
+
+ University of Bonn
+
+
+