what's the meaning of "ctrl" of mjData?

Discussion in 'Simulation' started by meijuan_jia, Mar 8, 2018.

  1. each element in ctrl of mjData is a float, i want to know the physical meaning of the float, it is the joints' position, orientation, velocity, rotation or something else? If i know each element in ctrl, how can i get the model's state in next time step? is there some formulas?
    thank in advance!
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    This is the vector of control signals for the actuators. The documentation has multiple sections on actuation and control.
  3. thanks for your help! i have another question:
    i have 3D pose coordinates of humanoid joints extracting from videos, how can i convert them to qpos, so that i can make humanoid model imitate human in the video through mj_forward.
    thanks again!
  4. oh, my understanding of qpos is: qpos[0:3] is the root's angle, qpos[3:7] is quaternion representing rotation, and others element in qpos is angle of joints. Whether my understanding is right? Is the joints' angle in qpos related to corresponding previous step's position or current root? how can i get qpos from 3D pose coordinates?
    thank you very much !
    Last edited: Mar 20, 2018
  5. how can i drive the model? as far as i know, i can give the qpos or ctrl of every time step to drive the model . Is there any other methods? and is there any reference to introduce the meaning of each element in qpos?
    thank you !
  6. I would actually recommend you to take a look at the documentation and access qpos, qvel, or ctrl using something like the following expression

    static int root = mj_name2id(m, mjOBJ_JOINT, "root");
    static int left_shoulder1_act = mj_name2id(m, mjOBJ_ACTUATOR, "left_shoulder1");
    d->ctrl[left_shoulder1_act] ;