Skip to content

Commit

Permalink
editable table rgba for living room, study, kitchen scenes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenxxxx committed Jul 3, 2024
1 parent 32fa42e commit 7ce6c1d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion libero/libero/envs/arenas/kitchen_arena.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ 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=(0.5, 0.5, 0.5, 1),
has_legs=True,
xml="arenas/table_arena.xml",
floor_style="light-gray",
wall_style="light-gray-plaster",
):
super().__init__(xml_path_completion(xml))

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 +87,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
4 changes: 3 additions & 1 deletion libero/libero/envs/arenas/living_room_arena.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from robosuite.models.arenas import Arena
from robosuite.utils.mjcf_utils import xml_path_completion
from robosuite.utils.mjcf_utils import xml_path_completion, array_to_string
import numpy as np

from libero.libero.envs.arenas.style import get_texture_filename
Expand Down Expand Up @@ -33,6 +33,8 @@ def __init__(
"./body[@name='living_room_table']"
)

self.table_visual.set("rgba", array_to_string(self.table_rgba))

texplane = self.asset.find("./texture[@name='texplane']")
plane_file = texplane.get("file")
plane_file = "/".join(
Expand Down
3 changes: 3 additions & 0 deletions libero/libero/envs/arenas/study_arena.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ 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=(0.5, 0.5, 0.5, 1),
has_legs=True,
xml="arenas/empty_arena.xml",
floor_style="light-gray",
wall_style="light-gray-plaster",
):
super().__init__(xml_path_completion(xml))

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 @@ -73,6 +75,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(self.table_rgba))
# self.table_visual.set("rgba", array_to_string([0, 0, 0, 0]))

self.table_top.set(
Expand Down
2 changes: 2 additions & 0 deletions libero/libero/envs/bddl_base_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def _load_model(self):
mujoco_arena = KitchenTableArena(
table_full_size=self.kitchen_table_full_size,
table_offset=self.workspace_offset,
table_rgba=self.table_rgba,
xml=self._arena_xml,
**self._arena_properties,
)
Expand Down Expand Up @@ -364,6 +365,7 @@ def _load_model(self):
)
self.robots[0].robot_model.set_base_xpos(xpos)
mujoco_arena = StudyTableArena(
table_rgba=self.table_rgba,
xml=self._arena_xml,
**self._arena_properties,
)
Expand Down

0 comments on commit 7ce6c1d

Please sign in to comment.