2323
2424# TODO: Edit GPU settings for softbody contact buffer size
2525# TODO: mess with deformable object settings
26- # TODO: Add container
2726
2827def get_robot () -> ArticulationCfg :
2928 return ArticulationCfg (
@@ -49,7 +48,9 @@ def get_robot() -> ArticulationCfg:
4948 "panda_joint6" : 1.003 ,
5049 "panda_joint7" : 0.469 ,
5150 "panda_finger_joint.*" : 0.035 ,
52- }
51+ },
52+ pos = (- 0.05 , 0.0 , 1.0 ),
53+ rot = (1.0 , 0.0 , 0.0 , 0.0 )
5354 ),
5455 actuators = {
5556 "panda_shoulder" : ImplicitActuatorCfg (
@@ -93,28 +94,49 @@ def get_object() -> DeformableObjectCfg:
9394 youngs_modulus = 1e5
9495 ),
9596 ),
96- init_state = DeformableObjectCfg .InitialStateCfg (pos = (0.0 , 0.0 , CUBE_SIZE / 1.9 )),
97+ init_state = DeformableObjectCfg .InitialStateCfg (pos = (0.0 , 0.0 , 1.0 + CUBE_SIZE / 1.9 )),
9798 debug_vis = True ,
9899 )
99100
100101def get_container () -> RigidObjectCfg :
101102 return RigidObjectCfg (
102103 prim_path = "/World/envs/env_.*/Container" ,
103104 spawn = sim_utils .UsdFileCfg (
104- usd_path = f"./Container_B04_01 .usd" ,
105+ usd_path = f"{ ISAAC_NUCLEUS_DIR } /Props/KLT_Bin/small_KLT_visual_collision .usd" ,
105106 rigid_props = sim_utils .RigidBodyPropertiesCfg (
106107 disable_gravity = False ,
107108 ),
108109 mass_props = sim_utils .MassPropertiesCfg (density = 5000.0 ),
109110 collision_props = sim_utils .CollisionPropertiesCfg (
110111 collision_enabled = True ,
111112 ),
112- visual_material = sim_utils .PreviewSurfaceCfg (diffuse_color = (0.0 , 1.0 , 1.0 ), metallic = 0.2 ),
113- scale = (0.02 , 0.02 , 0.02 ),
113+ scale = (2.4 , 2.5 , 1.2 ),
114+ ),
115+ init_state = RigidObjectCfg .InitialStateCfg (
116+ pos = (0.5 , 0.75 , 1.02 ),
117+ rot = (math .sqrt (2 )/ 2 , 0.0 , 0.0 , math .sqrt (2 )/ 2 )
118+ ),
119+ )
120+
121+ def get_table () -> RigidObjectCfg :
122+ return RigidObjectCfg (
123+ prim_path = "/World/envs/env_.*/Table" ,
124+ spawn = sim_utils .UsdFileCfg (
125+ usd_path = f"{ ISAAC_NUCLEUS_DIR } /Props/Mounts/SeattleLabTable/table_instanceable.usd" ,
126+ rigid_props = sim_utils .RigidBodyPropertiesCfg (
127+ disable_gravity = False ,
128+ ),
129+ collision_props = sim_utils .CollisionPropertiesCfg (
130+ collision_enabled = True ,
131+ ),
132+ ),
133+ init_state = RigidObjectCfg .InitialStateCfg (
134+ pos = (0.5 , 0.0 , 1.0 ),
135+ rot = (0.707 , 0.0 , 0.0 , 0.707 )
114136 ),
115- init_state = RigidObjectCfg .InitialStateCfg (pos = (0.5 , 1.0 , 0.1 )),
116137 )
117138
139+
118140@configclass
119141class DeformableCubeEnvCfg (DirectRLEnvCfg ):
120142 num_envs = 32
@@ -138,6 +160,7 @@ class DeformableCubeEnvCfg(DirectRLEnvCfg):
138160 )
139161
140162 # entities
163+ table_cfg : RigidObjectCfg = get_table ()
141164 robot_cfg : ArticulationCfg = get_robot ()
142165 object_cfg : DeformableObjectCfg = get_object ()
143166 container_cfg : RigidObjectCfg = get_container ()
@@ -163,6 +186,7 @@ def _setup_scene(self):
163186 self .robot = Articulation (self .cfg .robot_cfg )
164187 self .object = DeformableObject (self .cfg .object_cfg )
165188 self .container = RigidObject (self .cfg .container_cfg )
189+ self .table = RigidObject (self .cfg .table_cfg )
166190 self .scene .articulations ["robot" ] = self .robot
167191
168192 spawn_ground_plane (prim_path = "/World/ground" , cfg = GroundPlaneCfg ())
@@ -220,6 +244,6 @@ def _reset_idx(self, env_ids: Sequence[int] | None):
220244 self .robot .write_joint_state_to_sim (position = joint_pos , velocity = joint_vel , env_ids = env_ids )
221245
222246 # reset containers
223- container_pose = self .container .data .default_root_state [env_ids , :]
224- container_pose [:, :3 ] += self .scene .env_origins
225- self .container .write_root_state_to_sim (container_pose , env_ids )
247+ # container_pose = self.container.data.default_root_state[env_ids, :]
248+ # container_pose[:, :3] += self.scene.env_origins
249+ # self.container.write_root_state_to_sim(container_pose, env_ids)
0 commit comments