Skip to content
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

[WIP] Loading Fremont Space #934

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions configs/tasks/rearrange/rearrange_fremont.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Config for empty task to explore the scene.
ENVIRONMENT:
MAX_EPISODE_STEPS: 0
DATASET:
TYPE: RearrangeDataset-v0
SPLIT: train
DATA_PATH: data/datasets/fremont/test.json.gz
SCENES_DIR: "data/fremont/"
TASK:
TYPE: RearrangeEmptyTask-v0
COUNT_OBJ_COLLISIONS: True
COUNT_ROBOT_OBJ_COLLS: False

# In radians
BASE_ANGLE_NOISE: 0.0
BASE_NOISE: 0.0
CONSTRAINT_VIOLATION_ENDS_EPISODE: False

# If true, does not care about navigability or collisions with objects when spawning
# robot
EASY_INIT: False
FORCE_REGENERATE: True

SENSORS: ["JOINT_SENSOR"]

MEASUREMENTS:
# General measure
- "ROBOT_FORCE"
ACTIONS:
ARM_ACTION:
TYPE: "ArmAction"
ARM_CONTROLLER: "ArmRelPosAction"
GRIP_CONTROLLER: "MagicGraspAction"
ARM_JOINT_DIMENSIONALITY: 7
GRASP_THRESH_DIST: 0.15
DISABLE_GRIP: False
DELTA_POS_LIMIT: 0.0125
EE_CTRL_LIM: 0.015
BASE_VELOCITY:
TYPE: "BaseVelAction"
LIN_SPEED: 10.0
ANG_SPEED: 10.0
ALLOW_DYN_SLIDE: True
END_ON_STOP: False
ALLOW_BACK: True
MIN_ABS_LIN_SPEED: 1.0
MIN_ABS_ANG_SPEED: 1.0
EMPTY:
TYPE: "EmptyAction"
POSSIBLE_ACTIONS:
- ARM_ACTION
- BASE_VELOCITY
- EMPTY

SIMULATOR:
ADDITIONAL_OBJECT_PATHS:
- "data/objects/ycb/configs/"
ACTION_SPACE_CONFIG: v0
GRASP_IMPULSE: 1000.0
HOLD_THRESH: 0.09
AC_FREQ_RATIO: 4
DEBUG_RENDER: False
DEBUG_RENDER_GOAL: True
AGENTS: ['AGENT_0']
AGENT_0:
HEIGHT: 1.5
RADIUS: 0.3
SENSORS: ['HEAD_DEPTH_SENSOR']
ROBOT_URDF: ./data/robots/hab_fetch/robots/hab_fetch.urdf
ROBOT_TYPE: "FetchRobot"
IK_ARM_URDF: ./data/robots/hab_fetch/robots/fetch_onlyarm.urdf
HEAD_RGB_SENSOR:
WIDTH: 128
HEIGHT: 128
HEAD_DEPTH_SENSOR:
WIDTH: 128
HEIGHT: 128
MIN_DEPTH: 0.0
MAX_DEPTH: 10.0
NORMALIZE_DEPTH: True
ARM_REST: [0.6, 0.0, 0.9]
CTRL_FREQ: 120.0
DEFAULT_AGENT_ID: 0
FORWARD_STEP_SIZE: 0.25
HABITAT_SIM_V0:
ALLOW_SLIDING: True
ENABLE_PHYSICS: True
GPU_DEVICE_ID: 0
GPU_GPU: False
PHYSICS_CONFIG_FILE: ./data/default.physics_config.json
SEED: 100
TYPE: RearrangeSim-v0
107 changes: 107 additions & 0 deletions habitat/datasets/rearrange/configs/fremont.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
dataset_path: "data/fremont/fremont_knuckles.scene_dataset_config.json"
additional_object_paths:
- "data/objects/ycb/configs/"
scene_sets:
-
name: "scene_train_split"
included_substrings:
- ""
excluded_substrings: []


object_sets:
-
name: "kitchen"
included_substrings:
- "024_bowl"
excluded_substrings: []

-
name: "clutter"
excluded_substrings: []
included_substrings:
- "002_master_chef_can"
- "003_cracker_box"
- "004_sugar_box"
- "005_tomato_soup_can"
- "007_tuna_fish_can"
- "008_pudding_box"
- "009_gelatin_box"
- "010_potted_meat_can"
- "011_banana.object_config.json"
- "012_strawberry.object_config.json"
- "013_apple.object_config.json"
- "014_lemon.object_config.json"
- "015_peach.object_config.json"
- "016_pear.object_config.json"
- "017_orange.object_config.json"
- "018_plum.object_config.json"
- "021_bleach_cleanser.object_config.json"
- "024_bowl.object_config.json"
- "025_mug.object_config.json"
- "026_sponge.object_config.json"

receptacle_sets:
-
name: "counter"
included_object_substrings: [""]
included_receptacle_substrings:
- "right_top_kitchen_island"
excluded_object_substrings: []
excluded_receptacle_substrings: []
-
name: "clutter"
included_object_substrings: [""]
included_receptacle_substrings:
- "top_kitchen_island"
- "sink_kitchen_island"
- "volume_table"
- "volume_dresser"
- "livingroom_roundtable"
excluded_object_substrings: []
excluded_receptacle_substrings: []
-
name: "table"
included_object_substrings: [""]
included_receptacle_substrings:
- "receptacle_aabb_volume_table"
excluded_receptacle_substrings: []
excluded_object_substrings: []

scene_sampler:
type: "single"

params:
scene_sets: ["scene_train_split"]
scene: fremont_dynamic

object_samplers:
- name: "target"
type: "uniform"
params:
object_sets: ["kitchen"]
receptacle_sets: ["counter"]
num_samples: [1, 1]
orientation_sampling: "up"
- name: "clutter"
type: "uniform"
params:
object_sets: ["clutter"]
receptacle_sets: ["clutter"]
num_samples: [20, 30]
orientation_sampling: "up"

object_target_samplers:
-
name: "target"
type: "uniform"
params:
object_samplers: ["target"]
receptacle_sets: ["table"]
num_samples: [1, 1]
orientation_sampling: "up"



markers: []
1 change: 0 additions & 1 deletion habitat/datasets/rearrange/rearrange_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ def generate_single_episode(self) -> Optional[RearrangeEpisode]:

ep_scene_handle = self.generate_scene()
scene_base_dir = osp.dirname(osp.dirname(ep_scene_handle))

scene_name = ep_scene_handle.split(".")[0]
navmesh_path = osp.join(
scene_base_dir, "navmeshes", scene_name + ".navmesh"
Expand Down
1 change: 1 addition & 0 deletions habitat/datasets/rearrange/samplers/object_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def sample_receptacle(
if self.receptacle_candidates is None:
self.receptacle_candidates = []
for receptacle in self.receptacle_instances:
print(receptacle.name)
found_match = False
for receptacle_set in match_recep_sets:
culled = False
Expand Down
7 changes: 5 additions & 2 deletions habitat/tasks/rearrange/rearrange_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
rearrange_collision,
rearrange_logger,
)
from habitat_sim.nav import NavMeshSettings
from habitat_sim.physics import CollisionGroups, JointMotorSettings, MotionType
from habitat_sim.sim import SimulatorBackend

Expand Down Expand Up @@ -302,9 +301,13 @@ def _setup_targets(self):

def _load_navmesh(self):
scene_name = self.ep_info["scene_id"].split("/")[-1].split(".")[0]
base_dir = osp.join(*self.ep_info["scene_id"].split("/")[:2])
base_dir = osp.dirname(self.active_dataset)

navmesh_path = osp.join(base_dir, "navmeshes", scene_name + ".navmesh")
if not osp.exists(navmesh_path):
rearrange_logger.warning(
f"Cannot load navmesh path {navmesh_path}"
)
self.pathfinder.load_nav_mesh(navmesh_path)

self._navmesh_vertices = np.stack(
Expand Down