-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Episode Creator Script for Habitat 2.0 #764
Conversation
…t peek. Config to gen in fridge. pre-commit refactors.
…echnique. Add some utilities.
…ded SceneDataset investigation helper for easier config authoring.
…s (e.g. only "drawers" for a "counter")
…aradigm. Start migration from programmatic default config to yaml files for testing/examples
@@ -0,0 +1,178 @@ | |||
--- | |||
dataset_path: "data/replica_cad/replicaCAD.scene_dataset_config.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really relevant to this PR but I get the sense that configurations and datasets/scenes are often referred as their paths. I think this is going to be maybe hard to maintain on the long-term. This forces users to hard code paths at a lot of places. I think having some static registry of keys to paths might be a better approach. This way if you want to move an asset, you would just need to change it at one place (and you could also populate this registry every time an asset is downloaded).
…ecetpacle classes. Added docstrings/comments. Reduced/merged redundant code. Added handling for stage margin in snapping. Moved visualization into Receptacle class.
self._gym_action_keys = env._rl_config.get("GYM_ACTION_KEYS", None) | ||
self._gym_obs_keys = env._rl_config.get("GYM_OBS_KEYS", None) | ||
|
||
if self._gym_obs_keys is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the source of truth is the config and if there is no GYM_OBS_KEYS
in the config, then the fallback is the observation space of the environment. Is that the expected behavior?
If the observation_space is always available, why is there a GYM_OBS_KEYS
in the config? (It looks redundant).
I think we should always use env.observation_space.spaces
and throw an error if it is different from the config provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is how it works and I think this should be the desired behavior. The GYM_OBS_KEY is used for filtering out the observations that are wanted in the Gym environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts after documenting/typing the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Introduce RearrangeEpisodeGenerator with redesigned RearrangeEpisode and RearrangeDataset for generating small object clutter within Receptacles fixed to objects or defined in the global frame. * Various Habitat-sim utilities supporting episode generation and debugging. * Refactored rearrange tasks to fix bugs, refine implementation and support new episode format. * Gym API for rearrange task training. * Updated rearrange task and episode generation config files. * Improved interactive_play application for interactive task design and debugging. * Refactored unit tests to better cover rearrange episode generation and task execution. Co-authored-by: Alexander William Clegg <alexclegg@fb.com> Co-authored-by: Oleksandr Maksymets <maksymets@gmail.com> Co-authored-by: Naoki Yokoyama <naokiyokoyama@devfair0196.h2.fair>
* Introduce RearrangeEpisodeGenerator with redesigned RearrangeEpisode and RearrangeDataset for generating small object clutter within Receptacles fixed to objects or defined in the global frame. * Various Habitat-sim utilities supporting episode generation and debugging. * Refactored rearrange tasks to fix bugs, refine implementation and support new episode format. * Gym API for rearrange task training. * Updated rearrange task and episode generation config files. * Improved interactive_play application for interactive task design and debugging. * Refactored unit tests to better cover rearrange episode generation and task execution. Co-authored-by: Alexander William Clegg <alexclegg@fb.com> Co-authored-by: Oleksandr Maksymets <maksymets@gmail.com> Co-authored-by: Naoki Yokoyama <naokiyokoyama@devfair0196.h2.fair>
Motivation and Context
New episode creator and ReplicaCAD integration code for Habitat 2.0. Also new Gym API and upgrades to the interactive play script. These are the core functionalities I need to test things are working.
New components listed in detail below.
Download Rearrangment assets:
python -m habitat_sim.utils.datasets_download --uids rearrange_task_assets
Episode Generation
Running
python habitat/datasets/rearrange/rearrange_generator.py --run
will generate a single episode with default config and save it locally as
rearrange_ep_dataset.json.gz
.Use:
--config
to pass a custom generator config file. (See example config: habitat/datasets/rearrange/configs/test_config.yaml)--num-episodes
to specify the number of episodes to generate.--out
to specify the output location for the serialized dataset.--debug
to also generate and save debugging images/videos.--db-output
to specify the output location for debugging images/videos (default isrearrange_ep_gen_output/
).NOTE:
python habitat/datasets/rearrange/rearrange_generator.py --list
will print concise list of scene, object, and receptacle handles for reference when authoring a custom generator config file.Gym API
Create Habitat environments from Gym by first
import habitat_baselines.utils.gym_definitions
and thenenv = gym.make("EnvironmentID")
the environment IDs are listed below:HabitatGymPick-v0
HabitatGymPickState-v0
HabitatGymReachState-v0
HabitatGymOpenCabState-v0
HabitatGymCloseCabState-v0
You can also create a "render" version of the environment which has a high-resolution 3rd person camera to show what the robot with
env.render()
(but this is slower!). Do this using prefixHabitatGymRender
, for exampleHabitatGymRenderPick-v0
instead ofHabitatGymPick-v0
.Pass overrides to the task with the
override_options
named argument ingym.make
. For examplegym.make("HabitatGymPick-v0", override_options=["TASK_CONFIG.TASK.ACTIONS.ARM_ACTION.GRIP_CONTROLLER", "SuctionGraspAction"])
.Interactive Play Script
Example to run
Some useful arguments:
--never-end
if specified the episode will never end due to a time out.--add-ik
will change the arm action space to IK control. Note you needPyBullet installed for this to work.
--play-task
will add the visualization camera to the task so you caneasily view what's going on in the play window.
How Has This Been Tested
Added new tests:
test/test_rearrange_task.py::test_rearrange_baseline_envs
test/test_rearrange_task.py::test_rearrange_tasks
test/test_examples.py::test_rearrange_example_modules
test/test_gym_wrapper.py
Types of changes
Checklist