|
| 1 | +<mujoco model="Active adhesion example"> |
| 2 | + <!-- |
| 3 | + Adding some fluid viscosity to prevent the hanging sphere from jiggling too much. |
| 4 | + --> |
| 5 | + <option viscosity="1"/> |
| 6 | + |
| 7 | + <size memory="10M"/> |
| 8 | + |
| 9 | + <visual> |
| 10 | + <headlight diffuse=".2 .2 .2"/> |
| 11 | + </visual> |
| 12 | + |
| 13 | + <default> |
| 14 | + <joint damping=".3" axis="0 1 0"/> |
| 15 | + <geom type="box" friction=".5"/> |
| 16 | + <default class="wall"> |
| 17 | + <geom rgba=".5 .5 .5 .4"/> |
| 18 | + </default> |
| 19 | + <default class="mechanical"> |
| 20 | + <geom rgba=".5 .5 .8 1"/> |
| 21 | + <tendon rgba=".5 .5 .8 1"/> |
| 22 | + </default> |
| 23 | + <default class="active_adhesion"> |
| 24 | + <!-- |
| 25 | + Geoms in the active_adhesion class are "inflated" with a margin of 1cm, but contacts are |
| 26 | + activated only at a depth gap of 1cm, leading to a layer of inactive contacts at a 1cm |
| 27 | + distance from the surface. However the contacts can be used by the adhesion actuator. |
| 28 | + --> |
| 29 | + <geom rgba=".8 .5 .5 1" margin=".01" gap=".01"/> |
| 30 | + </default> |
| 31 | + <default class="object"> |
| 32 | + <geom rgba=".5 .8 .5 1" density="100"/> |
| 33 | + </default> |
| 34 | + </default> |
| 35 | + |
| 36 | + <worldbody> |
| 37 | + <light pos="0.4 -.15 .6" dir="-1 .5 -1" diffuse=".7 .7 .7"/> |
| 38 | + <light pos="-.4 -.15 .6" dir="1 .5 -1" diffuse=".7 .7 .7"/> |
| 39 | + |
| 40 | + <body name="two crates"> |
| 41 | + <joint name="conveyor" type="slide" damping="100" axis="1 0 0"/> |
| 42 | + <geom size=".2 .1 .01" pos="0 0 -.01"/> |
| 43 | + <geom size=".01 .08 .031" pos="-.19 0 .03" class="wall"/> |
| 44 | + <geom size=".01 .08 .031" pos="0 0 .03" class="wall"/> |
| 45 | + <geom size=".01 .08 .031" pos="0.19 0 .03" class="wall"/> |
| 46 | + <geom size="0.2 .01 .031" pos="0 -.09 .03" class="wall"/> |
| 47 | + <geom size="0.2 .01 .031" pos="0 0.09 .03" class="wall"/> |
| 48 | + </body> |
| 49 | + |
| 50 | + <body name="arm1" pos="-.1 0 .3" childclass="mechanical"> |
| 51 | + <joint name="arm1"/> |
| 52 | + <geom type="cylinder" size=".015 .01" zaxis="0 1 0"/> |
| 53 | + <geom type="capsule" size=".01" fromto="0 0 0 -.12 0 -.07"/> |
| 54 | + <body name="arm2" pos="-.12 0 -.07"> |
| 55 | + <joint name="arm2"/> |
| 56 | + <geom type="cylinder" size=".015 .01" zaxis="0 1 0"/> |
| 57 | + <geom type="capsule" size=".01" fromto="0 0 0 .12 0 -.07"/> |
| 58 | + <body name="4boxes" pos=".12 0 -.08" childclass="active_adhesion"> |
| 59 | + <site name="force_sensor" group="3"/> |
| 60 | + <joint name="arm3" damping=".01" pos="0 -.03 0"/> |
| 61 | + <geom size=".015 .015 .01" pos="0.015 0.015 0"/> |
| 62 | + <geom size=".015 .015 .01" pos="0.015 -.015 0"/> |
| 63 | + <geom size=".015 .015 .01" pos="-.015 0.015 0"/> |
| 64 | + <geom size=".015 .015 .01" pos="-.015 -.015 0"/> |
| 65 | + </body> |
| 66 | + </body> |
| 67 | + </body> |
| 68 | + |
| 69 | + <body name="box" pos="-.1 0 .05"> |
| 70 | + <freejoint/> |
| 71 | + <geom size=".05 .05 .05" class="object"/> |
| 72 | + </body> |
| 73 | + |
| 74 | + <body name="winch" pos="-.01 0 .35" childclass="mechanical"> |
| 75 | + <joint name="winch" damping="1"/> |
| 76 | + <geom type="cylinder" size=".015 .01" zaxis="0 1 0"/> |
| 77 | + <geom type="capsule" size=".01" fromto="0 0 0 .1 0 .05"/> |
| 78 | + <site name="anchor" pos=".1 0 .04"/> |
| 79 | + </body> |
| 80 | + <site name="pulley" pos=".1 0 .32"/> |
| 81 | + <site name="hook_left" pos=".08 0 .3"/> |
| 82 | + <site name="hook_right" pos=".12 0 .3"/> |
| 83 | + <body name="sphere" pos=".1 0 .2" childclass="active_adhesion"> |
| 84 | + <freejoint/> |
| 85 | + <!-- |
| 86 | + The composite balls in the crate have only 3 linear DoFs with condim=1, effectively |
| 87 | + frictionless point particles. In order to make them stick to the sphere we give the sphere |
| 88 | + priority 2, to force condim=3. |
| 89 | +
|
| 90 | + Also note the sphere has a margin+gap of 3cm as opposed to the 1cm of the arm box. |
| 91 | + --> |
| 92 | + <geom type="sphere" size=".03" priority="2" margin=".03" gap=".03"/> |
| 93 | + <site name="pin_left" pos="-.025 0 .025"/> |
| 94 | + <site name="pin_right" pos=".025 0 .025"/> |
| 95 | + </body> |
| 96 | + |
| 97 | + <composite type="particle" count="4 4 4" spacing="0.025" offset=".11 .01 .1"> |
| 98 | + <geom size=".012" rgba=".5 .8 .5 1" solref=".005 1"/> |
| 99 | + </composite> |
| 100 | + </worldbody> |
| 101 | + |
| 102 | + <equality> |
| 103 | + <joint joint1="arm1" joint2="arm2" polycoef="0 -.5 0 0 0"/> |
| 104 | + <joint joint1="arm3" joint2="arm1"/> |
| 105 | + </equality> |
| 106 | + |
| 107 | + <!-- |
| 108 | + By using divisor=3 in the pullies we increase the distance by which the hanging sphere moves |
| 109 | + relative to the motion of the winch arm. One should imagine a double spindle with two radii that |
| 110 | + creates a ratio of 1.5 between the motion of tendon before the pullies and after the pullies. |
| 111 | + (1.5 rather than 3 because the tendon has 2 branches and the length is split between them) |
| 112 | + --> |
| 113 | + <tendon> |
| 114 | + <spatial range="0 .19" limited="true" solreflimit=".01 2" class="mechanical"> |
| 115 | + <site site="anchor"/> |
| 116 | + <site site="pulley"/> |
| 117 | + <pulley divisor="3"/> |
| 118 | + <site site="pulley"/> |
| 119 | + <site site="hook_left"/> |
| 120 | + <site site="pin_left"/> |
| 121 | + <pulley divisor="3"/> |
| 122 | + <site site="pulley"/> |
| 123 | + <site site="hook_right"/> |
| 124 | + <site site="pin_right"/> |
| 125 | + </spatial> |
| 126 | + </tendon> |
| 127 | + |
| 128 | + <actuator> |
| 129 | + <position name="conveyor" joint="conveyor" ctrlrange="-.2 .2" ctrllimited="true" kp="400"/> |
| 130 | + <position name="arm" joint="arm2" ctrlrange="-.8 1" ctrllimited="true" kp="10"/> |
| 131 | + <adhesion name="adhere_arm" body="4boxes" ctrlrange="0 1" gain="5"/> |
| 132 | + <position name="winch" joint="winch" ctrlrange="-.7 .5" ctrllimited="true" kp="10"/> |
| 133 | + <adhesion name="adhere_winch" body="sphere" ctrlrange="0 1" gain="5"/> |
| 134 | + </actuator> |
| 135 | + |
| 136 | + <sensor> |
| 137 | + <force site="force_sensor"/> |
| 138 | + </sensor> |
| 139 | +</mujoco> |
0 commit comments