How to change model default values ?

Discussion in 'Simulation' started by Parijat Dewangan, Oct 30, 2017.

  1. I am able to set the qpos initial values at default pose. Due the change is qpos0 values, the robot becomes unstable(because of high qvel values) when mj_step is performed. Interesting thing is that the robot is stable when all the qpos0 values are zero. For non zero qpos0 values, there is high change in angle, hence high force acting which make the robot unstable.

    How to set the values at default pose, without any change in qvel ? Since we are dealing with humanoids, stability is a major criteria.

    I hope you understand. Below is the code.
    ----------------------------------------------------------------------------
    for(int i=0;i<13;i++)
    {
    m->qpos0[13+i] =newqposvalues;
    }
    mj_resetData(m,d);
    mj_kinematics(m,d);
    mj_step(m,d);
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    You can set mjData.qpos to whatever you need, and then run mj_step. If the simulation becomes unstable, that probably means the qpos has large constraint violations, or qvel is too large - in which case you also need to change qvel.