How to set initial (angular) velocity for a free joint?

Discussion in 'Modeling' started by Minchen Li, Jun 10, 2020.

  1. I'm new to Mujoco and found it very cool! Right now still learning to use it.
    The following xml file drops 2 cubes together onto the ground under gravity, how do I set initial (angular) velocity for the cubes?
    Thanks!

    <mujoco>
    <worldbody>
    <geom name="floor" pos="0 0 -0.5" size="0 0 .25" type="plane" condim="3"/>

    <body pos="-0 0 0.1" quat="0 0 0.707107 0.707107">
    <freejoint/>
    <geom type="box" size="0.5 0.5 0.5" rgba="0.5 0 0 1"/>
    </body>
    <body pos="-0 0 6.0" quat="0 0 0.707107 0.707107">
    <freejoint/>
    <geom type="box" size="5 5 5" rgba="0 0.5 0 1"/>
    </body>
    </worldbody>
    </mujoco>
     
  2. Vikash Kumar

    Vikash Kumar Staff Member

    You can update mjData.qvel field to add an initial velocity to the system