Habitat Sim
Habitat Sim
Habitat Demo
Table of contents
Motivation
Citing Habitat
Details
Performance
Installation
Common build issues
Testing
Common testing issues
Documentation
Rendering to GPU Tensors
WebGL
Datasets
Examples
Acknowledgments
External Contributions
License
References
Motivation
If you use the Habitat platform in your research, please cite the following paper:
@inproceedings{habitat19iccv,
title = {Habitat: {A} {P}latform for {E}mbodied {AI} {R}esearch},
author = {Manolis Savva and Abhishek Kadian and Oleksandr Maksymets and
Yili Zhao and Erik Wijmans and Bhavana Jain and Julian Straub and Jia Liu and
Vladlen Koltun and Jitendra Malik and Devi Parikh and Dhruv Batra},
booktitle = {Proceedings of the IEEE/CVF International Conference on Computer
Vision (ICCV)},
year = {2019}
}
Habitat-Sim also builds on work contributed by others. If you use contributed
methods/models, please cite their works. See the External Contributions section for
a list of what was externally contributed and the corresponding work/citation.
Details
The Habitat-Sim backend module is implemented in C++ and leverages the magnum
graphics middleware library to support cross-platform deployment on a broad variety
of hardware configurations. The architecture of the main abstraction classes is
shown below. The design of this module ensures a few key properties:
Performance
The table below reports performance statistics for a test scene from the
Matterport3D dataset (id 17DRP5sb8fy) on a Xeon E5-2690 v4 CPU and Nvidia Titan Xp.
Single-thread performance reaches several thousand frames per second, while multi-
process operation with several independent simulation backends can reach more than
10,000 frames per second on a single GPU!
1 proc 3 procs 5 procs
Sensors / Resolution 128 256 512 128 256 512 128 256 512
RGB 4093 1987 848 10638 3428 2068 10592 3574 2629
RGB + depth 2050 1042 423 5024 1715 1042 5223 1774 1348
RGB + depth + semantics* 709 596 394 1312 1219 979 1521 1429 1291
*Note: The semantic sensor in MP3D houses currently requires the use of additional
house 3D meshes with orders of magnitude more geometric complexity leading to
reduced performance. We expect this to be addressed in future versions leading to
speeds comparable to RGB + depth; stay tuned.
To run the above benchmarks on your machine, see instructions in the examples
section.
Installation
Docker Image
We provide a pre-built docker container for habitat-lab and habitat-sim, refer to
habitat-docker-setup.
From Source
Install Dependencies
Common
See this configuration for a full list of dependencies that our CI installs on
a clean Ubuntu VM. If you run into build errors later, this is a good place to
check if all dependencies are installed.
Build Habitat-Sim
For headless systems (i.e. without an attached display, e.g. in a cluster) and
multiple GPU systems
(Under development) With physics simulation via Bullet Physics SDK: First,
install Bullet Physics using your system's package manager.
Mac
brew install bullet
Linux
Note1: Build flags stack, e.g. to build in headless mode, with CUDA, and
bullet, one would use --headless --with-cuda --bullet.
Note2: some Linux distributions might require an additional --user flag to deal
with permission issues.
Note3: for active development in Habitat, you might find ./build.sh instead of
python setup.py install more useful.
[Only if using build.sh] For use with Habitat Lab and your own python code, add
habitat-sim to your PYTHONPATH. For example modify your .bashrc (or .bash_profile
in Mac OS X) file by adding the line:
export PYTHONPATH=$PYTHONPATH:/path/to/habitat-sim/
If your machine has a custom installation location for the nvidia OpenGL and
EGL drivers, you may need to manually provide the EGL_LIBRARY path to cmake as
follows. Add -DEGL_LIBRARY=/usr/lib/x86_64-linux-gnu/nvidia-opengl/libEGL.so to the
build.sh command line invoking cmake. When running any executable adjust the
environment as follows: LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/nvidia-opengl:$
{LD_LIBRARY_PATH} examples/example.py.
By default, the build process uses all cores available on the system to
parallelize. On some virtual machines, this might result in running out of memory.
You can serialize the build process via:
Build is tested on Tested with Ubuntu 18.04 with gcc 7.4.0 and MacOS 10.13.6
with Xcode 10 and clang-1000.10.25.5. If you experience compilation issues, please
open an issue with the details of your OS and compiler versions.
We also have a dev slack channel, please follow this link to get added to the
channel.
Testing
Download the test scenes from this link and extract locally.
./build/viewer /path/to/data/scene_datasets/habitat-test-scenes/skokloster-
castle.glb
You should be able to control an agent in this test scene. Use W/A/S/D keys to
move forward/left/backward/right and arrow keys to control gaze direction (look
up/down/left/right). Try to find the picture of a woman surrounded by a wreath.
Have fun!
Physical interactions: If you would like to try out habitat with dynamical
objects, first download our pre-processed object data-set from this link and
extract as habitat-sim/data/objects/.
To run an interactive C++ example GUI application with physics enabled run
The agent will traverse a particular path and you should see the performance
stats at the very end, something like this: 640 x 480, total time: 3.208 sec. FPS:
311.7. Note that the test scenes do not provide semantic meshes. If you would like
to test the semantic sensors via example.py, please use the data from the
Matterport3D dataset (see Datasets). We have also provided an example demo for
reference.
To run a physics example in python (after building with "Physics simulation via
Bullet"):
Note that in this mode the agent will be frozen and oriented toward the spawned
physical objects. Additionally, --save_png can be used to output agent visual
observation frames of the physical scene to the current directory.
If you are running on a remote machine and experience display errors when
initializing the simulator, e.g.
ensure you do not have DISPLAY defined in your environment (run unset DISPLAY
to undefine the variable)
chances are your libGL is located at a non-standard location. See e.g. this
issue.
Documentation
To get you started, see the Lighting Setup tutorial for adding new objects to
existing scenes and relighting the scene & objects. The Image Extractor tutorial
shows how to get images from scenes loaded in Habitat-Sim.
Rendering to GPU Tensors
Download the test scenes and extract locally to habitat-sim creating habitat-
sim/data.
Download and install emscripten (version 1.38.42 is verified to work)
Set EMSCRIPTEN in your environment
export EMSCRIPTEN=/pathto/emsdk/fastcomp/emscripten
Open http://127.0.0.1:8000/build_js/esp/bindings_js/bindings.html
Datasets
The full Matterport3D (MP3D) dataset for use with Habitat can be downloaded
using the official Matterport3D download script as follows: python download_mp.py
--task habitat -o path/to/download/. You only need the habitat zip archive and not
the entire Matterport3D dataset. Note that this download script requires python 2.7
to run.
The Gibson dataset for use with Habitat can be downloaded by agreeing to the
terms of use in the Gibson repository.
Semantic information for Gibson is available from the 3DSceneGraph dataset. The
semantic data will need to be converted before it can be used within Habitat:
tools/gen_gibson_semantics.sh /path/to/3DSceneGraph_medium/automated_graph
/path/to/GibsonDataset /path/to/output
Examples
We use clang-format-8 for linting and code style enforcement of c++ code. Code
style follows the Google C++ guidelines. Install clang-format-8 through brew
install clang-format on macOS. For other systems, clang-format-8 can be installed
via conda install clangdev -c conda-forge or by downloading binaries or sources
from releases.llvm.org/download. For vim integration add to your .vimrc file map
<C-K> :%!clang-format<cr> and use Ctrl+K to format entire file. Integration plugin
for vscode.
We use black and isort for linting and code style of python code. Install black and
isort through pip install -U black isort. They can then be ran via black . and
isort.
We use eslint with prettier plugin for linting, formatting and code style of JS
code. Install these dependencies through npm install. Then, for fixing
linting/formatting errors run npm run lint-fix. Make sure you have a node version >
8 for this.
We also offer pre-commit hooks to help with automatically formatting code. Install
the pre-commit hooks with pip install pre-commit && pre-commit install.
Development Tips
Install ninja (sudo apt install ninja-build on Linux, or brew install ninja on
macOS) for significantly faster incremental builds
Install ccache (sudo apt install ccache on Linux, or brew install ccache on
macOS) for significantly faster clean re-builds and builds with slightly different
settings
You can skip reinstalling magnum every time by adding the argument of --skip-
install-magnum to either build.sh or setup.py. Note that you will still need to
install magnum bindings once.
Arguments to build.sh and setup.py can be cached between subsequent invocations
with the flag --cache-args on the first invocation.
Acknowledgments
The Habitat project would not have been possible without the support and
contributions of many individuals. We would like to thank Xinlei Chen, Georgia
Gkioxari, Daniel Gordon, Leonidas Guibas, Saurabh Gupta, Or Litany, Marcus
Rohrbach, Amanpreet Singh, Devendra Singh Chaplot, Yuandong Tian, and Yuxin Wu for
many helpful conversations and guidance on the design and development of the
Habitat platform.
External Contributions
If you use the noise model from PyRobot, please cite the their technical
report.
Specifically, the noise model used for the noisy control functions named
pyrobot_* and defined in habitat_sim/agent/controls/pyrobot_noisy_controls.py
If you use the Redwood Depth Noise Model, please cite their paper
License
Habitat-Sim is MIT licensed. See the LICENSE file for details.
References