Relative feature vector?

Discussion in 'Simulation' started by Amin, Oct 23, 2017.

  1. Hi

    I'm reading the documentation but I cannot find out how I can get a feature vector that is relative to the trunk.

    This is the piece of code that generates the observation vector in Humanoid environment of Mujoco-py:

    Code:
    def _get_obs(self):
        data = self.model.data
        return np.concatenate([data.qpos.flat[2:],
                               data.qvel.flat,
                               data.cinert.flat,
                               data.cvel.flat,
                               data.qfrc_actuator.flat,
                               data.cfrc_ext.flat])
    But does it create a relative feature vector or not? and Why is it ignoring the first 2 elements of data.qpos.flat? How can I find such detailed information?

    Thanks
    Amin
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    With the caveat that I have never used mujoco-py, here is my guess:

    The dynamics and cost of the humanoid are translation-invariant, meaning that the horizontal position in the plane is irrelevant. So they are skipping the X and Y coordinates of the torso, which happen to be the first two numbers in qpos for this model.

    To find out what each quantity means you would have to read the MuJoCo documentation. Keep in mind that MuJoCo uses joint coordinates, so in some sense the data are relative.
     
  3. Hi
    Thanks for your reply.
    Yeah that makes sense.
    But I really think the documentation is too abstract. In some research subjects we need to study detailed information of each bone separately and I find it very difficult to find such information in the documentation.
    For example, about qpos I could find this in the documentation:
    Here it's not clear whether it's stored like (pos_0, ori_0, pos_1, ori_1, ...) or (pos_0, pos_1, ..., Ori_0, Ori_1, ...).
     
  4. Emo Todorov

    Emo Todorov Administrator Staff Member

    For free joints, the order is: posX, posY, posZ, quatW, quatX, quatY, quatZ

    Throughout my teaching career students have complained that my explanations are too abstract :) People should feel free to write MuJoCo tutorials and make things more concrete, while I continue to develop the software. The level of abstraction in the documentation is what it is; I am happy to insert clarifications here and there as needed. Will put this one on the list.
     
    Amin likes this.