Skip to content

Commit

Permalink
libero_long variations
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenxxxx committed Sep 19, 2024
1 parent 3e0633a commit 86114c4
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
<geom pos="0 0 0" size="0.05 0.1" type="cylinder" conaffinity="0" contype="0" group="1" name="table_leg4_visual" material="table_legs"/>
</body>

<light name="light1" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="1 1 4.0" specular="0.3 0.3 0.3" castshadow="True"/>
<light name="light2" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="-3. -3. 4.0" specular="0.3 0.3 0.3" castshadow="True"/>
<light name="light1" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="1 1 4.0" specular="0.3 0.3 0.3" castshadow="true"/>
<light name="light2" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="-3. -3. 4.0" specular="0.3 0.3 0.3" castshadow="true"/>

<!-- front view -->
<camera mode="fixed" name="frontview" pos="1.0 0 1.45" quat="0.56 0.43 0.43 0.56"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<geom pos="-2 0 1.5" quat="0.5 0.5 0.5 0.5" size="1.5 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_rear_visual" material="walls_mat"/>
<geom pos="3 0 1.5" quat="0.5 0.5 -0.5 -0.5" size="3 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_front_visual" material="walls_mat"/>
<!-- Table body -->
<light name="light1" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="1 1 4.0" specular="0.3 0.3 0.3" castshadow="false"/>
<light name="light2" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="-3. -3. 4.0" specular="0.3 0.3 0.3" castshadow="false"/>
<light name="light1" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="1 1 4.0" specular="0.3 0.3 0.3" castshadow="true"/>
<light name="light2" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="-3. -3. 4.0" specular="0.3 0.3 0.3" castshadow="true"/>

<!-- front view -->
<camera mode="fixed" name="frontview" pos="1.0 0 1.45" quat="0.56 0.43 0.43 0.56"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<geom pos="-2 0 1.5" quat="0.5 0.5 0.5 0.5" size="1.5 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_rear_visual" material="walls_mat"/>
<geom pos="3 0 1.5" quat="0.5 0.5 -0.5 -0.5" size="3 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_front_visual" material="walls_mat"/>
<!-- Table body -->
<light name="light1" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="1 1 4.0" specular="0.3 0.3 0.3" castshadow="True"/>
<light name="light2" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="-3. -3. 4.0" specular="0.3 0.3 0.3" castshadow="True"/>
<light name="light1" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="1 1 4.0" specular="0.3 0.3 0.3" castshadow="true"/>
<light name="light2" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="-3. -3. 4.0" specular="0.3 0.3 0.3" castshadow="true"/>

<!-- front view -->
<camera mode="fixed" name="frontview" pos="1.0 0 1.45" quat="0.56 0.43 0.43 0.56"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<material name="table_mat" texture="textable" />

<texture file="living_room_table/living_room_table_texture.png" name="tex-living_room_table" type="2d"/>
<material name="living_room_table" reflectance="0.5" texrepeat="1 1" texture="tex-living_room_table" texuniform="false" rgba="0.2 0.2 0.2 1"/>
<material name="living_room_table" reflectance="0.5" texrepeat="1 1" texture="tex-living_room_table" texuniform="false" rgba="0.2 0.8 0.2 1"/>
<mesh file="living_room_table/visual/living_room_table_vis.msh" name="living_room_table_vis" scale="1.5 1.5 1.5"/>

<texture file="wall_decoration/wall_decoration_texture.png" name="tex-wall_decoration" type="2d"/>
Expand Down
4 changes: 2 additions & 2 deletions libero/libero/assets/scenes/libero_study_mix_style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
<geom pos="-2 0 1.5" quat="0.5 0.5 0.5 0.5" size="1.5 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_rear_visual" material="walls_mat"/>
<geom pos="3 0 1.5" quat="0.5 0.5 -0.5 -0.5" size="3 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_front_visual" material="walls_mat"/>

<light name="light1" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="1 1 4.0" specular="0.3 0.3 0.3" castshadow="false"/>
<light name="light2" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="-3. -3. 4.0" specular="0.3 0.3 0.3" castshadow="false"/>
<light name="light1" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="1 1 4.0" specular="0.3 0.3 0.3" castshadow="true"/>
<light name="light2" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="-3. -3. 4.0" specular="0.3 0.3 0.3" castshadow="true"/>

<!-- front view -->
<camera mode="fixed" name="frontview" pos="1.0 0 1.45" quat="0.56 0.43 0.43 0.56"/>
Expand Down
4 changes: 2 additions & 2 deletions libero/libero/assets/scenes/libero_study_reflection_style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
<geom pos="-2 0 1.5" quat="0.5 0.5 0.5 0.5" size="1.5 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_rear_visual" material="walls_mat"/>
<geom pos="3 0 1.5" quat="0.5 0.5 -0.5 -0.5" size="3 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_front_visual" material="walls_mat"/>

<light name="light1" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="1 1 4.0" specular="0.3 0.3 0.3" castshadow="True"/>
<light name="light2" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="-3. -3. 4.0" specular="0.3 0.3 0.3" castshadow="True"/>
<light name="light1" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="1 1 4.0" specular="0.3 0.3 0.3" castshadow="true"/>
<light name="light2" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="-3. -3. 4.0" specular="0.3 0.3 0.3" castshadow="true"/>

<!-- front view -->
<camera mode="fixed" name="frontview" pos="1.0 0 1.45" quat="0.56 0.43 0.43 0.56"/>
Expand Down
2 changes: 1 addition & 1 deletion libero/libero/assets/scenes/libero_study_rgba2_style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<mesh file="living_room_table/visual/living_room_table_vis.msh" name="living_room_table_vis" scale="1.0 1.0 1.0"/> -->

<texture file="desk/desk_texture.png" name="tex-desk" type="2d"/>
<material name="desk" reflectance="0.5" texrepeat="1 1" texture="tex-desk" texuniform="false" rgba="0.2 0.2 0.2 1"/>
<material name="desk" reflectance="0.5" texrepeat="1 1" texture="tex-desk" texuniform="false" rgba="0.2 0.8 0.2 1"/>
<mesh file="desk/visual/desk_vis.msh" name="desk_vis" scale="1.0 1.0 1.0"/>

<texture file="floor_lamp/lamp_texture.png" name="tex-floor_lamp" type="2d"/>
Expand Down
24 changes: 18 additions & 6 deletions libero/libero/envs/bddl_base_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,17 @@ def __init__(
table_rgba: list = None,
change_table_color1: bool = False,
change_table_color2: bool = False,
light_refelction: bool = False,
light_reflection: bool = False,
all_mix: bool = False,
**kwargs,
):
if table_rgba is None:
table_rgba = [0.5, 0.5, 0.5, 1]
self.table_rgba = table_rgba
self.change_table_color1 = change_table_color1
self.change_table_color2 = change_table_color2
self.light_refelction = light_refelction
self.light_reflection = light_reflection
self.all_mix = all_mix
t0 = time.time()
# settings for table top (hardcoded since it's not an essential part of the environment)
self.workspace_offset = workspace_offset
Expand Down Expand Up @@ -315,7 +317,7 @@ def _load_model(self):
self.table_full_size[0]
)
self.robots[0].robot_model.set_base_xpos(xpos)
if self.light_refelction:
if self.light_reflection or self.all_mix:
mujoco_arena = TableArena(
table_full_size=self.table_full_size,
table_offset=self.workspace_offset,
Expand All @@ -338,7 +340,7 @@ def _load_model(self):
)
self.robots[0].robot_model.set_base_xpos(xpos)

if self.light_refelction:
if self.light_reflection or self.all_mix:
mujoco_arena = KitchenTableArena(
table_full_size=self.kitchen_table_full_size,
table_offset=self.workspace_offset,
Expand Down Expand Up @@ -388,11 +390,16 @@ def _load_model(self):
xml=os.path.join(self.custom_asset_dir, "scenes/libero_living_room_tabletop_rgba2_style.xml"),
**self._arena_properties,
)
elif self.light_refelction:
elif self.light_reflection:
mujoco_arena = LivingRoomTableArena(
xml=os.path.join(self.custom_asset_dir, "scenes/libero_living_room_tabletop_reflection_style.xml"),
**self._arena_properties,
)
elif self.all_mix:
mujoco_arena = LivingRoomTableArena(
xml=os.path.join(self.custom_asset_dir, "scenes/libero_living_room_tabletop_mix_style.xml"),
**self._arena_properties,
)
else:
mujoco_arena = LivingRoomTableArena(
xml=self._arena_xml,
Expand All @@ -415,11 +422,16 @@ def _load_model(self):
xml=os.path.join(self.custom_asset_dir, "scenes/libero_study_rgba2_style.xml"),
**self._arena_properties,
)
elif self.light_refelction:
elif self.light_reflection:
mujoco_arena = StudyTableArena(
xml=os.path.join(self.custom_asset_dir, "scenes/libero_study_reflection_style.xml"),
**self._arena_properties,
)
elif self.all_mix:
mujoco_arena = StudyTableArena(
xml=os.path.join(self.custom_asset_dir, "scenes/libero_study_mix_style.xml"),
**self._arena_properties,
)
else:
mujoco_arena = StudyTableArena(
xml=self._arena_xml,
Expand Down

0 comments on commit 86114c4

Please sign in to comment.