Skip to content

Commit

Permalink
habitat-lab tutorial (facebookresearch#445)
Browse files Browse the repository at this point in the history
* habitat-lab tutoriall

* Make tutorial runnable

* Added unit testing framework

* Fix black formatting in tests

* Hacky fix

* Try to properly guard everything

* linter changes

* Fix .circleci

* Fix env indent

* Fix typo

* Fix flatten to modern version

* Fix envs

* Undo pre-commit changes

* make cat path relative

* Fix flake8 errors

* Rename tutorial

* add missing files

* Fix Habitat Interactive Tasks

Co-authored-by: Aaron Gokaslan <[email protected]>
  • Loading branch information
abhiskk and Skylion007 authored Aug 23, 2020
1 parent 358969e commit 1120195
Show file tree
Hide file tree
Showing 8 changed files with 1,024 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- run:
name: run black
command: |
black habitat/. habitat_baselines/. examples/. test/. setup.py --diff
black habitat/. habitat_baselines/. examples/. test/. setup.py --check
black --exclude '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist)|examples/tutorials/(colabs|nb_python)' habitat/. habitat_baselines/. examples/. test/. setup.py --diff
black --exclude '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist)|examples/tutorials/(colabs|nb_python)' habitat/. habitat_baselines/. examples/. test/. setup.py --check
- run:
name: run isort
command: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ repos:
- id: jupytext-sync
name: Sync scripts and notebooks
files: '^examples/tutorials/(colabs|nb_python)/(.*\.py|.*\.ipynb)$'
entry: jupytext --update-metadata '{"jupytext":{"notebook_metadata_filter":"all", "cell_metadata_filter":"-all"}, "accelerator":"GPU"}' --set-formats 'nb_python//py:percent,colabs//ipynb' --pipe black --pipe "sed s/[[:space:]]*\#[[:space:]]\%\%/\#\%\%/g" --pipe 'isort -' --pipe-fmt 'py:percent' --sync
entry: jupytext --update-metadata '{"jupytext":{"notebook_metadata_filter":"all", "cell_metadata_filter":"-all"}, "accelerator":"GPU"}' --set-formats 'nb_python//py:percent,colabs//ipynb' --pipe black --pipe "sed s/[[:space:]]*\#[[:space:]]\%\%/\#\%\%/g" --pipe 'isort -' --pipe-fmt 'py:percent' --sync
pass_filenames: true
additional_dependencies:
- 'jupytext==1.5.2'
Expand Down
10 changes: 7 additions & 3 deletions examples/tutorials/colabs/Habitat_Interactive_Tasks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,14 @@
" # Object's initial position 3m away from the agent.\n",
" object_id = sim.add_object_by_handle(chair_attr.handle)\n",
" set_object_in_front_of_agent(sim, object_id, -3.0)\n",
" sim.set_object_motion_type(habitat_sim.MotionType.STATIC, object_id)\n",
" sim.set_object_motion_type(\n",
" habitat_sim.physics.MotionType.STATIC, object_id\n",
" )\n",
"\n",
" # Object's final position 7m away from the agent\n",
" goal_id = sim.add_object_by_handle(chair_attr.handle)\n",
" set_object_in_front_of_agent(sim, goal_id, -7.0)\n",
" sim.set_object_motion_type(habitat_sim.MotionType.STATIC, goal_id)\n",
" sim.set_object_motion_type(habitat_sim.physics.MotionType.STATIC, goal_id)\n",
"\n",
" return object_id, goal_id\n",
"\n",
Expand Down Expand Up @@ -785,7 +787,9 @@
" print(f\"Chair's object id is {object_id}\")\n",
"\n",
" set_object_in_front_of_agent(sim, object_id, -1.5)\n",
" sim.set_object_motion_type(habitat_sim.MotionType.STATIC, object_id)\n",
" sim.set_object_motion_type(\n",
" habitat_sim.physics.MotionType.STATIC, object_id\n",
" )\n",
" if make_video:\n",
" # Visualize the agent's initial position\n",
" simulate_and_make_vid(\n",
Expand Down
Loading

0 comments on commit 1120195

Please sign in to comment.