Skip to content

Commit

Permalink
LIBERO change
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenxxxx committed May 25, 2024
1 parent f78abd6 commit 32fa42e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libero/libero/assets/scenes/libero_floor_coffee_style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<texture file="coffee_table_seats/FabricLeatherBuffaloRustic001_COL_VAR1_4K.png" name="tex-coffee_table_seats" type="2d"/>
<material name="coffee_table_seats" reflectance="0.5" texrepeat="1 1" texture="tex-coffee_table_seats" texuniform="false"/>
<mesh file="coffee_table_seats/visual/coffee_table_seats_vis.msh" name="coffee_table_seats_vis" scale="1.0 1.0 1.0"/>
<mesh file="coffee_table_seats/visual/coffee_table_seats_vis.msh" name="coffee_table_seats_vis" scale="0.8 0.4 0.1"/>

</asset>
<worldbody>
Expand Down
4 changes: 2 additions & 2 deletions libero/libero/assets/scenes/libero_tabletop_blue_style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
<geom pos="0 0 0" size="0.05 0.1" type="cylinder" conaffinity="0" contype="0" group="1" name="table_leg3_visual" material="table_legs"/>
<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="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"/>
<!-- bird view -->
Expand Down
6 changes: 5 additions & 1 deletion libero/libero/envs/arenas/table_arena.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ def __init__(
table_full_size=(0.8, 0.8, 0.05),
table_friction=(1, 0.005, 0.0001),
table_offset=(0, 0, 0.8),
table_rgba=None,
has_legs=True,
xml="arenas/table_arena.xml",
floor_style="light-gray",
wall_style="light-gray-plaster",
):
super().__init__(xml_path_completion(xml))

if table_rgba is None:
table_rgba = [0.5, 0.5, 0.5, 1]
self.table_rgba = table_rgba
self.table_full_size = np.array(table_full_size)
self.table_half_size = self.table_full_size / 2
self.table_friction = table_friction
Expand Down Expand Up @@ -85,7 +89,7 @@ def configure_location(self):
self.table_collision.set("size", array_to_string(self.table_half_size))
self.table_collision.set("friction", array_to_string(self.table_friction))
self.table_visual.set("size", array_to_string(self.table_half_size))
# self.table_visual.set("rgba", array_to_string([0, 0, 0, 0]))
self.table_visual.set("rgba", array_to_string(self.table_rgba))

self.table_top.set(
"pos", array_to_string(np.array([0, 0, self.table_half_size[2]]))
Expand Down
5 changes: 5 additions & 0 deletions libero/libero/envs/bddl_base_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ def __init__(
arena_type="table",
scene_xml="scenes/libero_base_style.xml",
scene_properties={},
table_rgba: list=None,
**kwargs,
):
if table_rgba is None:
table_rgba = [0.5, 0.5, 0.5, 1]
self.table_rgba = table_rgba
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 @@ -310,6 +314,7 @@ def _load_model(self):
table_full_size=self.table_full_size,
table_offset=self.workspace_offset,
table_friction=(0.6, 0.005, 0.0001),
table_rgba=self.table_rgba,
xml=self._arena_xml,
**self._arena_properties,
)
Expand Down

0 comments on commit 32fa42e

Please sign in to comment.