Habitat 2.0 Overview
An overview of Habitat 2.0 with documentation, quickstart code, and reproducing the benchmark results.
Quick Start
To get started with Habitat 2.0, see the quick start Jupyter notebook tutorial and the Gym API tutorial.
Local Installation
See the Habitat Lab README for steps to install Habitat.
Interactive Play Script
Test the Habitat environments using your keyboard and mouse to control the robot. On your local machine with a display connected run the following:
python examples/interactive_play.py --never-end
You may be asked to first install a specific version of PyGame. This script will work on Linux or MacOS. For more information about the interactive play script, see the documentation string at the top of the file.
RL Training with Habitat Baselines
Habitat includes an implementation of DD-PPO. As an example, start training a pick skill policy with:
python -u -m habitat_baselines.run \ --config-name=rearrange/rl_skill.yaml
This trains the Pick skill by default. To train the other skills, specify: benchmark/rearrange=skill_name
where skill_name
can be close_cab
, close_fridge
, open_fridge
, pick
, place
, or nav_to_obj
. See here for more information on how to run with Habitat Baselines.
Task-Planning with Skills RL Baseline
Here we will detail how to run the Task-Planning with Skills trained via reinforcement learning (TP-SRL) baseline from the Habitat 2.0 paper. This method utilizes a task-planner and a Planning Domain Definition Language to sequence together low-level skill policies trained independently with reinforcement learning (RL).
- First, train the skills via reinforcement learning. For example, to train the Place policy run
python -u -m habitat_baselines.run \ --config-name=rearrange/rl_skill.yaml \ checkpoint_folder=./place_checkpoints/ \ benchmark/rearrange=place
- To work on HAB tasks, you must also train a
pick
,nav_to_obj
,open_cab
,close_cab
,open_fridge
, andclose_fridge
policy. To do so, substitute the name of the other skill forplace
in the above command. - By default, the TP-SRL baseline will look for the skill checkpoints as
data/models/[skill name].pth
. Thetp-srl.yaml
file can be changed to point to the skills you would like to evaluate, or you can copy the model checkpoints indata/models/
. - Evaluate the TP-SRL baseline on the
tidy_house
HAB task via:
python -u -m habitat_baselines.run \ --config-name=rearrange/tp_srl.yaml \ habitat_baselines.evaluate=True \ benchmark/rearrange=tidy_house
Evaluate on different HAB tasks by overriding the benchmark/rearrange
. The TP-SRL baseline only runs in evaluation mode.
Running the Benchmark
To reproduce the benchmark table from the Habitat 2.0 paper follow these steps:
- Download the benchmark assets:
python -m habitat_sim.utils.datasets_download --uids hab2_bench_assets
- Copy the benchmark episodes into the data folder.
cp data/hab2_bench_assets/bench_scene.json.gz data/ep_datasets/
- Run the benchmark.
bash scripts/hab2_bench/bench_runner.sh
- Generate the results table.
python scripts/hab2_bench/plot_bench.py