<!-- Copyright 2021 DeepMind Technologies Limited
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
         http://www.apache.org/licenses/LICENSE-2.0
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<mujoco>
  <!--
  Same as force_free.xml, but with a distractor constraint.
  -->
  <option gravity="1 2 3"/>

  <default>
    <!-- A cube of size 0.1^3 with density of 1000 has mass of 1. -->
    <geom size="0.05 0.05 0.05" type="box"/>
  </default>

  <worldbody>
    <body name="body0" pos="-3 0 ">
      <joint name="joint0" type="slide" axis="0 0 1"/>
      <geom/>
    </body>
    <body name="body1">
      <geom/>
      <site name="sensor"/>
    </body>
    <body name="body2" pos="1 2 3">
      <joint type="free"/>
      <geom/>
    </body>
    <body name="body3" pos="3 0 0">
      <geom/>
      <body name="body3b" pos="3 0 -1">
        <joint type="slide" axis="0 0 1" frictionloss="9"/>
        <geom/>
      </body>
    </body>
    <body name="body4" pos="4 0 0">
      <joint type="free"/>
      <geom/>
    </body>
  </worldbody>

  <equality>
    <joint joint1="joint0"/>
    <weld body1="body3" body2="body4"/>
    <connect body1="body1" body2="body2" anchor="0 0 0"/>
  </equality>

  <sensor>
    <force site="sensor" user="-2 -4 -6"/>
  </sensor>
</mujoco>
