Curved slide movement

Discussion in 'Modeling' started by Ethan Brooks, Nov 1, 2017.

  1. My robot has omnidirectional wheels. Instead of actually modeling the individual wheels (a level of detail which we do not need), I have placed two actuated slide joints between the base and the floor:

    Code:
    <mujoco>
        <geom type="plane" size="2 2 2" class="floor" name="floor"/>
    ...
        <mujoco model="hsrb">
            <body name="base_link">
                <joint axis="1 0 0" damping="10" name="slide_x" pos="0 0 0" type="slide"/>
                <joint axis="0 1 0" damping="10" name="slide_y" pos="0 0 0" type="slide"/>
                <joint axis="0 0 1" damping="10" name="turn" pos="0 0 0" type="hinge"/>
    ...
        <actuator>
            <motor gear="1000.0" joint="slide_x"/>
            <motor gear="1000.0" joint="slide_y"/>
            <motor gear="1000.0" joint="turn"/>
        </actuator>
    </mujoco>
    
    For some reason, the robot's forward movement is curved, as depicted in the video. Also, the movement is sort of lurching, with friction seeming to affect things unpredictably. Maybe slide joints are not the best way to model a wheeled base?

     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    Slide joints are a good way to accomplish this, but you have to disable contacts between the ground and the robot base. If there are contacts, they will add some forces and possibly generate curved movement as well as produce the lurching you see. Assuming the base of your robot is a cylinder, the cylinder-plane collision in your co-planar configuration generates 3 contact points, so the geometric symmetry is broken.
     
  3. Disabling contacts is just a matter of introducing some space between the bottom of the robot and the floor, right?
     
  4. Emo Todorov

    Emo Todorov Administrator Staff Member

    You could do it that way, but it is better to disable them explicitly so they are not even checked. This can be done by adjusting the contype and conaffinity masks, or by using an explicit exclude element in the XML (it specifies a pair of bodies to be excluded from collision checking -- note that it is bodies, not geoms).
     
  5. It looks like the plane type cannot be placed in a body so it looks like, in order to exclude contacts between the base and the floor, I can't use the exclude element. Do I have that right?
     
  6. Ok. I adjusted contype and conaffinity to 0 for the floor, since nothing should be checking for collisions with the floor. This took care of the curving issue and will probably speed up the simulation quite a bit.
     
  7. Emo Todorov

    Emo Todorov Administrator Staff Member

    The plane is in the body called world, you can use it in an exclude statement. But contype/conaffinity works too.