Skip to content

Commit

Permalink
Episode Creator Script for Habitat 2.0 (facebookresearch#764)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
4 people authored Dec 10, 2021
1 parent d6a1930 commit e7d746a
Show file tree
Hide file tree
Showing 59 changed files with 4,869 additions and 5,720 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ If you use the Habitat platform in your research, please cite the [Habitat](http
## Example
<!--- Please, update `examples/example.py` if you update example. -->
🆕Example code-snippet which uses [`tasks/rearrangepick_replica_cad.yaml`](configs/tasks/rearrangepick_replica_cad.yaml) for configuration of task and agent.
🆕Example code-snippet which uses [`configs/tasks/rearrange/pick.yaml`](configs/tasks/rearrange/pick.yaml) for configuration of task and agent.
```python
import habitat
# Load embodied AI task (RearrangePick) and a pre-specified virtual robot
env = habitat.Env(
config=habitat.get_config("configs/tasks/rearrangepick_replica_cad.yaml")
config=habitat.get_config("configs/tasks/rearrange/pick.yaml")
)
observations = env.reset()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,24 @@ ENVIRONMENT:
DATASET:
TYPE: RearrangeDataset-v0
SPLIT: train
DATA_PATH: data/datasets/rearrange_pick/replica_cad/v0/{split}/{split}_counter_L_analysis_5000_500.json.gz
DATA_PATH: data/datasets/rearrange_pick/replica_cad/v0/rearrange_pick_replica_cad_v0/pick.json.gz
SCENES_DIR: "data/replica_cad/"
TASK:
TYPE: RearrangePickTask-v0
MAX_COLLISIONS: -1.0
COUNT_OBJ_COLLISIONS: True
COUNT_ROBOT_OBJ_COLLS: False
DESIRED_RESTING_POSITION: [0.5, 0.0, 1.0]

# In radians
BASE_ANGLE_NOISE: 0.15
BASE_NOISE: 0.05
CONSTRAINT_VIOLATION_ENDS_EPISODE: True
FORCE_REGENERATE: False

# Measurements for composite tasks.
REWARD_MEASUREMENT: "rearrangepick_reward"
SUCCESS_MEASUREMENT: "rearrangepick_success"

# If true, does not care about navigability or collisions with objects when spawning
# robot
Expand Down Expand Up @@ -44,52 +51,52 @@ TASK:
TYPE: "IsHoldingSensor"
RELATIVE_RESTING_POS_SENSOR:
TYPE: "RelativeRestingPositionSensor"
LOCAL_SENSOR:
TYPE: "LocalizationSensor"
SENSORS: ["TARGET_START_SENSOR", "GOAL_SENSOR", "JOINT_SENSOR", "IS_HOLDING_SENSOR", "END_EFFECTOR_SENSOR", "LOCAL_SENSOR", "RELATIVE_RESTING_POS_SENSOR"]
SENSORS: ["TARGET_START_SENSOR", "JOINT_SENSOR", "IS_HOLDING_SENSOR", "END_EFFECTOR_SENSOR", "RELATIVE_RESTING_POS_SENSOR"]
ROBOT_FORCE:
TYPE: "RobotForce"
MIN_FORCE: 20.0
EXCESSIVE_FORCE_SHOULD_END:
TYPE: "ForceTerminate"
MAX_ACCUM_FORCE: 5000.0
ROBOT_COLLS:
TYPE: "RobotCollisions"
TYPE: "RobotCollisions"
OBJECT_TO_GOAL_DISTANCE:
TYPE: "ObjectToGoalDistance"
END_EFFECTOR_TO_OBJECT_DISTANCE:
TYPE: "EndEffectorToObjectDistance"
END_EFFECTOR_TO_REST_DISTANCE:
TYPE: "EndEffectorToRestDistance"
REARRANGE_PICK_REWARD:
PICK_REWARD:
TYPE: "RearrangePickReward"
DIST_REWARD: 20.0
SUCC_REWARD: 10.0
PICK_REWARD: 20.0
CONSTRAINT_VIOLATE_PEN: 10.0
DROP_PEN: 5.0
WRONG_PICK_PEN: 5.0
COLL_PEN: 1.0
ROBOT_OBJ_COLL_PEN: 0.0
MAX_ACCUM_FORCE: 5000.0
USE_DIFF: True
DROP_OBJ_SHOULD_END: False
WRONG_PICK_SHOULD_END: False

# General Rearrange Reward config
CONSTRAINT_VIOLATE_PEN: 10.0
FORCE_PEN: 0.001
MAX_FORCE_PEN: 1.0
FORCE_END_PEN: 10.0
USE_DIFF: True

DROP_OBJ_SHOULD_END: False
WRONG_PICK_SHOULD_END: False

REARRANGE_PICK_SUCCESS:
PICK_SUCCESS:
TYPE: "RearrangePickSuccess"
SUCC_THRESH: 0.15

MEASUREMENTS:
- "OBJECT_TO_GOAL_DISTANCE"
- "ROBOT_FORCE"
- "EXCESSIVE_FORCE_SHOULD_END"
- "ROBOT_COLLS"
- "END_EFFECTOR_TO_REST_DISTANCE"
- "END_EFFECTOR_TO_OBJECT_DISTANCE"
- "REARRANGE_PICK_SUCCESS"
- "REARRANGE_PICK_REWARD"
- "PICK_SUCCESS"
- "PICK_REWARD"
ACTIONS:
ARM_ACTION:
TYPE: "ArmAction"
Expand All @@ -99,12 +106,14 @@ TASK:
GRASP_THRESH_DIST: 0.15
DISABLE_GRIP: False
DELTA_POS_LIMIT: 0.0125
EE_CTRL_LIM: 0.015
POSSIBLE_ACTIONS:
- ARM_ACTION

SIMULATOR:
ACTION_SPACE_CONFIG: v0
AGENTS: ['AGENT_0']
ROBOT_JOINT_START_NOISE: 0.0
AGENT_0:
HEIGHT: 1.5
IS_SET_START_STATE: False
Expand Down Expand Up @@ -136,8 +145,8 @@ SIMULATOR:
CTRL_FREQ: 120.0
AC_FREQ_RATIO: 4
ROBOT_URDF: ./data/robots/hab_fetch/robots/hab_fetch.urdf
ROBOT_TYPE: "FetchRobot"
FORWARD_STEP_SIZE: 0.25
LAG_OBSERVATIONS: 1

# Grasping
HOLD_THRESH: 0.09
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# The configuration to run the SensePlanAct baseline architecture from https://arxiv.org/abs/2106.14405
ENVIRONMENT:
MAX_EPISODE_STEPS: 200
MAX_EPISODE_STEPS: 30
DATASET:
TYPE: RearrangeDataset-v0
SPLIT: train
DATA_PATH: data/datasets/rearrange_pick/replica_cad/v0/{split}/{split}_counter_L_analysis_5000_500.json.gz
DATA_PATH: data/datasets/rearrange_pick/replica_cad/v0/rearrange_pick_replica_cad_v0/pick.json.gz
SCENES_DIR: "data/replica_cad/"
TASK:
TYPE: RearrangePickTask-v0
MAX_COLLISIONS: -1.0
COUNT_OBJ_COLLISIONS: True
COUNT_ROBOT_OBJ_COLLS: False
CONSTRAINT_VIOLATION_ENDS_EPISODE: True

# In radians
BASE_ANGLE_NOISE: 0.15
BASE_NOISE: 0.05
FORCE_RECACHE: False
FORCE_REGENERATE: False
DESIRED_RESTING_POSITION: [0.5, 0.0, 1.0]

# If true, does not care about navigability or collisions with objects when spawning
# robot
Expand Down Expand Up @@ -48,11 +50,9 @@ TASK:
TYPE: "EEPositionSensor"
IS_HOLDING_SENSOR:
TYPE: "IsHoldingSensor"
LOCAL_SENSOR:
TYPE: "LocalizationSensor"
RELATIVE_RESTING_POS_SENSOR:
TYPE: "RelativeRestingPositionSensor"
SENSORS: ["TARGET_START_SENSOR", "GOAL_SENSOR", "JOINT_SENSOR", "IS_HOLDING_SENSOR", "END_EFFECTOR_SENSOR", "LOCAL_SENSOR", "TARGET_CUR_SENSOR", "TARGET_CUR_SENSOR", "RELATIVE_RESTING_POS_SENSOR"]
SENSORS: ["TARGET_START_SENSOR", "GOAL_SENSOR", "JOINT_SENSOR", "IS_HOLDING_SENSOR", "END_EFFECTOR_SENSOR", "TARGET_CUR_SENSOR", "TARGET_CUR_SENSOR", "RELATIVE_RESTING_POS_SENSOR"]
ROBOT_FORCE:
TYPE: "RobotForce"
MIN_FORCE: 20.0
Expand All @@ -64,37 +64,37 @@ TASK:
TYPE: "EndEffectorToObjectDistance"
END_EFFECTOR_TO_REST_DISTANCE:
TYPE: "EndEffectorToRestDistance"
REARRANGE_PICK_REWARD:
EXCESSIVE_FORCE_SHOULD_END:
TYPE: "ForceTerminate"
MAX_ACCUM_FORCE: 0.0
PICK_REWARD:
TYPE: "RearrangePickReward"
DIST_REWARD: 20.0
SUCC_REWARD: 10.0
PICK_REWARD: 20.0
DIST_REWARD: 10.0
PICK_REWARD: 5.0
CONSTRAINT_VIOLATE_PEN: 10.0
DROP_PEN: 5.0
WRONG_PICK_PEN: 5.0
COLL_PEN: 1.0
ROBOT_OBJ_COLL_PEN: 0.0
MAX_ACCUM_FORCE: null
COLLISION_PENALTY: 0.0
ROBOT_OBJ_COLLISION_PENALTY: 0.0

FORCE_PEN: 0.001
MAX_FORCE_PEN: 1.0
FORCE_END_PEN: 10.0
FORCE_PEN: 0.0
MAX_FORCE_PEN: 0.0
FORCE_END_PEN: 0.0
USE_DIFF: True

DROP_OBJ_SHOULD_END: False
WRONG_PICK_SHOULD_END: False

REARRANGE_PICK_SUCCESS:
PICK_SUCCESS:
TYPE: "RearrangePickSuccess"
SUCC_THRESH: 0.3

SUCC_THRESH: 0.15
MEASUREMENTS:
- "ROBOT_FORCE"
- "ROBOT_COLLS"
- "END_EFFECTOR_TO_OBJECT_DISTANCE"
- "EXCESSIVE_FORCE_SHOULD_END"
- "END_EFFECTOR_TO_REST_DISTANCE"
- "REARRANGE_PICK_SUCCESS"
- "REARRANGE_PICK_REWARD"
- "END_EFFECTOR_TO_OBJECT_DISTANCE"
- "PICK_SUCCESS"
- "PICK_REWARD"
ACTIONS:
ARM_ACTION:
TYPE: "ArmAction"
Expand All @@ -105,6 +105,7 @@ TASK:
DISABLE_GRIP: False
DELTA_POS_LIMIT: 0.0125
EE_CTRL_LIM: 0.015
ORACLE_GRASP: True
EMPTY:
TYPE: "EmptyAction"
POSSIBLE_ACTIONS:
Expand All @@ -114,6 +115,7 @@ TASK:
SIMULATOR:
ACTION_SPACE_CONFIG: v0
AGENTS: ['AGENT_0']
ROBOT_JOINT_START_NOISE: 0.0
AGENT_0:
HEIGHT: 1.5
IS_SET_START_STATE: False
Expand Down Expand Up @@ -146,11 +148,11 @@ SIMULATOR:
# Agent setup
ARM_REST: [0.6, 0.0, 0.9]
CTRL_FREQ: 120.0
AC_FREQ_RATIO: 4
AC_FREQ_RATIO: 8
ROBOT_URDF: ./data/robots/hab_fetch/robots/hab_fetch.urdf
ROBOT_TYPE: "FetchRobot"
IK_ARM_URDF: ./data/robots/hab_fetch/robots/fetch_onlyarm.urdf
FORWARD_STEP_SIZE: 0.25
LAG_OBSERVATIONS: 1

# Grasping
HOLD_THRESH: 0.09
Expand Down
Loading

0 comments on commit e7d746a

Please sign in to comment.