-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1f3457
commit a3ba844
Showing
5 changed files
with
98 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env python | ||
from gibson2.simulator import Simulator | ||
from gibson2.scenes.igibson_indoor_scene import InteractiveIndoorScene | ||
from gibson2.utils.utils import parse_config | ||
from gibson2.render.mesh_renderer.mesh_renderer_cpu import MeshRendererSettings | ||
from gibson2.objects.ycb_object import YCBObject | ||
import os | ||
import gibson2 | ||
import time | ||
import random | ||
import sys | ||
|
||
# human interaction demo | ||
|
||
|
||
def test_import_igsdf(): | ||
hdr_texture = os.path.join( | ||
gibson2.ig_dataset_path, 'scenes', 'background', 'probe_02.hdr') | ||
hdr_texture2 = os.path.join( | ||
gibson2.ig_dataset_path, 'scenes', 'background', 'probe_03.hdr') | ||
light_modulation_map_filename = os.path.join( | ||
gibson2.ig_dataset_path, 'scenes', 'Rs_int', 'layout', 'floor_lighttype_0.png') | ||
background_texture = os.path.join( | ||
gibson2.ig_dataset_path, 'scenes', 'background', 'urban_street_01.jpg') | ||
|
||
scene = InteractiveIndoorScene( | ||
'Rs_int', texture_randomization=False, object_randomization=False) | ||
# scene._set_first_n_objects(10) | ||
settings = MeshRendererSettings(env_texture_filename=hdr_texture, | ||
env_texture_filename2=hdr_texture2, | ||
env_texture_filename3=background_texture, | ||
light_modulation_map_filename=light_modulation_map_filename, | ||
enable_shadow=True, msaa=True, | ||
light_dimming_factor=1.0) | ||
s = Simulator(mode='iggui', image_width=960, | ||
image_height=720, device_idx=0, rendering_settings=settings) | ||
|
||
s.viewer.min_cam_z = 1.0 | ||
|
||
s.import_ig_scene(scene) | ||
|
||
# Add objects | ||
# obj1 = YCBObject(filename= | ||
|
||
while True: | ||
start = time.time() | ||
s.step() | ||
end = time.time() | ||
print("Elapsed time: ", end - start) | ||
print("Frequency: ", 1 / (end - start)) | ||
s.disconnect() | ||
print("end") | ||
|
||
|
||
def main(): | ||
test_import_igsdf() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters