File size: 2,262 Bytes
620dc33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<mujoco model="franka_stacking">
  <!-- Include the prebuilt Panda model from MuJoCo Menagerie -->
  <include file="panda.xml"/>

  <!-- Compiler and option settings -->
  <compiler angle="degree" coordinate="local" inertiafromgeom="true"/>
  <option timestep="0.002" gravity="0 0 -9.81" integrator="implicitfast"/>

  <!-- Visual settings -->
  <visual>
    <map znear="0.01" zfar="50" fogstart="10" fogend="50"/>
    <rgba fog="0.8 0.8 0.8 1"/>
  </visual>

  <!-- Default joint settings (optional, for new joints if added) -->
  <default>
    <joint/>
  </default>

  <!-- Extend the worldbody with blocks and target zone -->
  <worldbody>
    <!-- Reference the included Panda arm, positioned for stacking -->
    <body name="panda" pos="0 0 0.1"/>

    <!-- Floor -->
    <geom name="floor" type="plane" size="2 2 0.1" material="floor_mat" condim="4"/>

    <!-- Blocks (moved slightly forward and adjusted z for clearance) -->
    <body name="block0" pos="0.3 0.1 0.15"> <!-- Moved to x=0.3, z=0.15 to avoid base -->
      <joint name="block0_free" type="free"/>
      <geom name="block0_geom" type="box" size="0.05 0.05 0.05" material="block0_mat" rgba="1 0 0 1"/>
    </body>
    <body name="block1" pos="0.2 0.1 0.15"> <!-- Moved to x=0.2, z=0.15 -->
      <joint name="block1_free" type="free"/>
      <geom name="block1_geom" type="box" size="0.05 0.05 0.05" material="block1_mat" rgba="0 1 0 1"/>
    </body>
    <body name="block2" pos="0.1 0.1 0.15"> <!-- Moved to x=0.1, z=0.15 -->
      <joint name="block2_free" type="free"/>
      <geom name="block2_geom" type="box" size="0.05 0.05 0.05" material="block2_mat" rgba="0 0 1 1"/>
    </body>

    <!-- Target Zone -->
    <body name="target_zone" pos="0 0 0.01">
      <geom name="target_zone_geom" type="plane" size="0.2 0.2 0.01" material="target_mat" rgba="0 1 1 0.5"/>
    </body>
  </worldbody>

  <!-- Materials for visualization -->
  <asset>
    <material name="floor_mat" rgba="0.8 0.8 0.8 1"/>
    <material name="block0_mat" rgba="1 0 0 1"/> <!-- Red -->
    <material name="block1_mat" rgba="0 1 0 1"/> <!-- Green -->
    <material name="block2_mat" rgba="0 0 1 1"/> <!-- Blue -->
    <material name="target_mat" rgba="0 1 1 0.5"/> <!-- Cyan, semi-transparent -->
  </asset>
</mujoco>