Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
249c69a
add json serialize for int16_t, uint16_t
eundersander Mar 29, 2022
ce33e63
add json serialize for Magnum types: Matrix3x3, Range3D, Vector2
eundersander Mar 29, 2022
c9f4cca
add episode json save/load; add agent start pos/yaw to episode data
eundersander Mar 29, 2022
05499d9
update googletest commit to avoid maybe-uninitialized warning
eundersander Mar 29, 2022
721357f
per-env resetting and startStepPhysicsOrReset API
eundersander Mar 30, 2022
4c693f5
add robot_joint_positions to PythonEnvironmentState
eundersander Mar 31, 2022
b1baff8
add EpisodeSet::allEpisodesAABB_
eundersander Mar 31, 2022
4d1238c
allow resetting an env to an arbitrary episode; bugfix for physics th…
eundersander Apr 1, 2022
692d657
* added lots of state to PythonEnvironmentState
eundersander Apr 2, 2022
7563eb4
add habitat_sim.build_type string attr
eundersander Apr 3, 2022
e42f36b
add BatchedSimulatorConfig::actionMap
eundersander Apr 3, 2022
6d793f6
hack to force compile errors for missing JSON serialization functions
eundersander Apr 4, 2022
875c5d0
add JSON serialization for std::pair
eundersander Apr 4, 2022
ce0f2ab
* replace python action_map with collection.json actionMap, including…
eundersander Apr 4, 2022
1c8b084
more robust grasping
eundersander Apr 4, 2022
199d8bc
more robust object-dropping; added drop_height to python env state
eundersander Apr 5, 2022
cfa5342
normalizing the actions so that -1 and 1 become the limits (#1719)
vincentpierre Apr 6, 2022
efe29e1
update bps3D commit
eundersander Apr 6, 2022
d4425a8
add setRobotCamera and setFreeCamera
eundersander Apr 6, 2022
7c1467a
fix for default actions == 0.5; add PythonEnvironmentState::robot_joi…
eundersander Apr 11, 2022
63a6698
add include_frame_number option for viz_utils.make_video
eundersander Apr 11, 2022
8e7c0d6
polish for viz_utils include_frame_number
eundersander Apr 11, 2022
dad773c
change actions range from 0..1 to -1..1
eundersander Apr 11, 2022
f8f6f35
add debug RGB sensor; remove debugPairedEnv stuff
eundersander Apr 12, 2022
b5438e3
release compile fix; add num_procedural_episodes config param
eundersander Apr 12, 2022
d234759
added EpisodeGeneratorConfig; fix for CollisionBroadphaseGrid::contac…
eundersander Apr 14, 2022
060c764
json serialize support for std::array
eundersander Apr 18, 2022
39114b7
added EpisodeGeneratorConfig::use_fixed_robot_joint_start_positions a…
eundersander Apr 18, 2022
4309a55
add BatchedSimulatorConfig.enable_robot_collision and enable_held_obj…
eundersander Apr 20, 2022
ee6219f
add debug rendering for object start and goal poses
eundersander Apr 20, 2022
903096d
add get_spherical_coordinates
eundersander Apr 21, 2022
c109bd0
fix for getSphericalCoordinates NaNs
eundersander Apr 29, 2022
46cda12
add static scenes support; formatting cleanup
eundersander May 13, 2022
ce01774
hack update to latest version of datasets_download.py in habitat-sim/…
aclegg3 May 3, 2022
0f836de
gfx-replay scaling fix (relevant for URDF scaling)
eundersander May 13, 2022
ad3ebfb
add --do-gala-kinematic-preprocess to legacy viewer
eundersander May 15, 2022
d770933
add file-write error-checking to Recorder::writeSavedKeyframesToFile
eundersander May 17, 2022
ed3dfb8
nicer file IO error for ColumnGrid
eundersander May 17, 2022
0f1026b
Updated Magnum submodules for the batch renderer.
mosra Dec 20, 2021
66403f4
cmake: update Magnum Find modules.
mosra May 19, 2022
dc08420
Bundle new Basis Universal 1_15_update2, including Zstd.
mosra Dec 20, 2021
70da698
Strange things happening with external Magnum if I don't do this.
mosra Dec 16, 2021
98c5efb
Why those bugs?
mosra Dec 16, 2021
05ae5bc
ye
mosra Dec 8, 2021
569ae09
Remove some sign flipping nonsense.
mosra May 19, 2022
7683fd1
Add more stuff in the converter; handle untextured objects.
mosra May 19, 2022
bddaf64
"Fix" a silly transformation hierarchy bug.
mosra May 19, 2022
19d0488
Handle Phong input materials correctly, texture-transform smaller ima…
mosra May 19, 2022
5c08b83
Adapt to texture layers and typed custom fields now being builtin.
mosra Jun 16, 2022
5f34eef
Better defaults for the demo.
mosra Jun 16, 2022
adf77bc
Use proper kind of asserts.
mosra Jun 16, 2022
47a8c27
What's up with the formatting here.
mosra Jun 16, 2022
3d5b613
WIP
mosra Jul 21, 2022
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ repos:
exclude: docs/

- repo: https://github.com/ambv/black
rev: 21.5b2
rev: 22.3.0
hooks:
- id: black
exclude: ^examples/tutorials/(nb_python|colabs)
Expand Down
1 change: 1 addition & 0 deletions habitat_sim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
SceneNodeType,
SimulatorConfiguration,
built_with_bullet,
build_type,
cuda_enabled,
vhacd_enabled,
)
Expand Down
1 change: 1 addition & 0 deletions habitat_sim/bindings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
SimulatorConfiguration,
VisualSensorSpec,
built_with_bullet,
build_type,
cuda_enabled,
vhacd_enabled,
)
142 changes: 126 additions & 16 deletions habitat_sim/utils/datasets_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ def hm3d_train_configs_post(extract_dir: str) -> List[str]:
return [link_name]


def hm3d_semantic_configs_post(extract_dir: str) -> List[str]:
all_scene_dataset_cfg = os.path.join(
extract_dir, "hm3d_annotated_basis.scene_dataset_config.json"
)
assert os.path.exists(all_scene_dataset_cfg)

dst_name = os.path.join(
extract_dir, "..", "hm3d_annotated_basis.scene_dataset_config.json"
)
os.replace(all_scene_dataset_cfg, dst_name)

return [dst_name]


def initialize_test_data_sources(data_path):
global data_sources
global data_groups
Expand Down Expand Up @@ -75,10 +89,10 @@ def initialize_test_data_sources(data_path):
"version": "0.2",
},
"mp3d_example_scene": {
"source": "http://dl.fbaipublicfiles.com/habitat/mp3d_example.zip",
"package_name": "mp3d_example.zip",
"source": "http://dl.fbaipublicfiles.com/habitat/mp3d/mp3d_example_v1.1.zip",
"package_name": "mp3d_example_v1.1.zip",
"link": data_path + "scene_datasets/mp3d_example",
"version": "1.0",
"version": "1.1",
},
"coda_scene": {
"source": "https://dl.fbaipublicfiles.com/habitat/coda_v1.0.zip",
Expand All @@ -95,22 +109,22 @@ def initialize_test_data_sources(data_path):
"version": "1.0",
},
"replica_cad_dataset": {
"source": "https://dl.fbaipublicfiles.com/habitat/ReplicaCAD/ReplicaCAD_dataset_v1.1.zip",
"package_name": "ReplicaCAD_dataset_v1.1.zip",
"source": "https://dl.fbaipublicfiles.com/habitat/ReplicaCAD/ReplicaCAD_dataset_v1.5.zip",
"package_name": "ReplicaCAD_dataset_v1.5.zip",
"link": data_path + "replica_cad",
"version": "1.1",
"version": "1.5",
},
"replica_cad_baked_lighting": {
"source": "https://dl.fbaipublicfiles.com/habitat/ReplicaCAD/ReplicaCAD_baked_lighting_v1.1.zip",
"package_name": "ReplicaCAD_baked_lighting_v1.1.zip",
"source": "https://dl.fbaipublicfiles.com/habitat/ReplicaCAD/ReplicaCAD_baked_lighting_v1.5.zip",
"package_name": "ReplicaCAD_baked_lighting_v1.5.zip",
"link": data_path + "replica_cad_baked_lighting",
"version": "1.1",
"version": "1.5",
},
"ycb": {
"source": "https://dl.fbaipublicfiles.com/habitat/ycb/hab_ycb_v1.0.zip",
"package_name": "hab_ycb_v1.0.zip",
"source": "https://dl.fbaipublicfiles.com/habitat/ycb/hab_ycb_v1.1.zip",
"package_name": "hab_ycb_v1.1.zip",
"link": data_path + "objects/ycb",
"version": "1.0",
"version": "1.1",
},
"hab_fetch": {
"source": "http://dl.fbaipublicfiles.com/habitat/hab_fetch_v1.0.zip",
Expand All @@ -124,6 +138,18 @@ def initialize_test_data_sources(data_path):
"link": data_path + "datasets/rearrange_pick/replica_cad/v0",
"version": "1.0",
},
"rearrange_dataset_v1": {
"source": "https://dl.fbaipublicfiles.com/habitat/data/datasets/replica_cad/v1.zip",
"package_name": "v1.zip",
"link": data_path + "datasets/replica_cad/rearrange",
"version": "1.0",
},
"hab2_bench_assets": {
"source": "https://dl.fbaipublicfiles.com/habitat/ReplicaCAD/hab2_bench_assets.zip",
"package_name": "hab2_bench_assets.zip",
"link": data_path + "hab2_bench_assets",
"version": "1.0",
},
}

data_sources.update(
Expand Down Expand Up @@ -179,6 +205,59 @@ def initialize_test_data_sources(data_path):
}
)

data_sources.update(
{
f"hm3d_{split}_semantic_{data_format}_v0.1": {
"source": "https://api.matterport.com/resources/habitat/hm3d-{split}-semantic-{data_format}-v0.1.tar{ext}".format(
ext=".gz" if data_format == "annots" else "",
split=split,
data_format=data_format,
),
"download_pre_args": "--location",
"package_name": "hm3d-{split}-semantic-{data_format}-v0.1.tar{ext}".format(
ext=".gz" if data_format == "annots" else "",
split=split,
data_format=data_format,
),
"link": data_path + "scene_datasets/hm3d",
"version": "1.0",
"version_dir": "hm3d-{version}/hm3d",
"extract_postfix": f"{split}",
"downloaded_file_list": f"hm3d-{{version}}/{split}-semantic-{data_format}-files.json.gz",
"requires_auth": True,
"use_curl": True,
"post_extract_fn": hm3d_semantic_configs_post
if data_format == "configs"
else None,
}
for split, data_format in itertools.product(
["minival", "train", "val"],
["annots", "configs"],
)
}
)

data_sources.update(
{
f"hm3d_example_semantic_{data_format}_v0.1": {
"source": "https://github.com/matterport/habitat-matterport-3dresearch/raw/main/example/hm3d-example-semantic-{data_format}-v0.1.tar{ext}".format(
ext=".gz" if data_format == "annots" else "",
data_format=data_format,
),
"package_name": "hm3d-example-semantic-{data_format}-v0.1.tar{ext}".format(
ext=".gz" if data_format == "annots" else "",
data_format=data_format,
),
"link": data_path + "scene_datasets/hm3d",
"version": "1.0",
"version_dir": "hm3d-{version}/hm3d",
"extract_postfix": "example",
"downloaded_file_list": f"hm3d-{{version}}/example-semantic-{data_format}-files.json.gz",
}
for data_format in ["annots", "configs"]
}
)

# data sources can be grouped for batch commands with a new uid
data_groups = {
"ci_test_assets": [
Expand All @@ -196,11 +275,42 @@ def initialize_test_data_sources(data_path):
"hab_fetch",
"ycb",
"rearrange_pick_dataset_v0",
"rearrange_dataset_v1",
],
"hm3d_example": [
"hm3d_example_habitat",
"hm3d_example_configs",
"hm3d_example_semantic_annots_v0.1",
"hm3d_example_semantic_configs_v0.1",
],
"hm3d_val": [
"hm3d_val_habitat",
"hm3d_val_configs",
"hm3d_val_semantic_annots_v0.1",
"hm3d_val_semantic_configs_v0.1",
],
"hm3d_train": [
"hm3d_train_habitat",
"hm3d_train_configs",
"hm3d_train_semantic_annots_v0.1",
"hm3d_train_semantic_configs_v0.1",
],
"hm3d_minival": [
"hm3d_minival_habitat",
"hm3d_minival_configs",
"hm3d_minival_semantic_annots_v0.1",
"hm3d_minival_semantic_configs_v0.1",
],
"hm3d_semantics": [
"hm3d_example_semantic_annots_v0.1",
"hm3d_example_semantic_configs_v0.1",
"hm3d_val_semantic_annots_v0.1",
"hm3d_val_semantic_configs_v0.1",
"hm3d_train_semantic_annots_v0.1",
"hm3d_train_semantic_configs_v0.1",
"hm3d_minival_semantic_annots_v0.1",
"hm3d_minival_semantic_configs_v0.1",
],
"hm3d_example": ["hm3d_example_habitat", "hm3d_example_configs"],
"hm3d_val": ["hm3d_val_habitat", "hm3d_val_configs"],
"hm3d_train": ["hm3d_train_habitat", "hm3d_train_configs"],
"hm3d_minival": ["hm3d_minival_habitat", "hm3d_minival_configs"],
"hm3d_full": list(filter(lambda k: k.startswith("hm3d_"), data_sources.keys())),
}

Expand Down
11 changes: 8 additions & 3 deletions habitat_sim/utils/viz_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def is_notebook() -> bool:
return True


def get_fast_video_writer(video_file: str, fps: int = 60):
def get_fast_video_writer(video_file: str, fps: int = 60, include_frame_number = False):
if (
"google.colab" in sys.modules
and os.path.splitext(video_file)[-1] == ".mp4"
Expand All @@ -51,7 +51,11 @@ def get_fast_video_writer(video_file: str, fps: int = 60):
)
else:
# Use software encoding
writer = imageio.get_writer(video_file, fps=fps)
output_params = [
"-vf",
"drawtext=fontfile=Arial.ttf: text='%{frame_num}': start_number=0: x=0: y=1: fontcolor=black: fontsize=10: box=1: boxcolor=white: boxborderw=1"
] if include_frame_number else None
writer = imageio.get_writer(video_file, fps=fps, output_params=output_params)
return writer


Expand Down Expand Up @@ -210,6 +214,7 @@ def make_video(
overlay_settings: Optional[List[Dict[str, Any]]] = None,
depth_clip: Optional[float] = 10.0,
observation_to_image=observation_to_image,
include_frame_number = False,
):
"""Build a video from a passed observations array, with some images optionally overlayed.
:param observations: List of observations from which the video should be constructed.
Expand All @@ -233,7 +238,7 @@ def make_video(
if not video_file.endswith(".mp4"):
video_file = video_file + ".mp4"
print("Encoding the video: %s " % video_file)
writer = get_fast_video_writer(video_file, fps=fps)
writer = get_fast_video_writer(video_file, fps=fps, include_frame_number=include_frame_number)
observation_to_image = partial(observation_to_image, depth_clip=depth_clip)

for ob in observations:
Expand Down
Loading