Exact labeling

Discussion in 'Priority support' started by Ethan Brooks, Aug 8, 2018.

  1. I need to label an exact 3d coordinate in space. I know that mujoco can put an ascii character on a 3d coordinate, but I have not been able to adjust the size of that character and it is not clear whether the center of the character is on the coordinate, the upper left corner, or something else.

    What do you recommend?
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    You should not use text position to mark exact 3d coordinates. It is better to create a site instead.

    Also, if you left-double-click on any geom, the 3D coordinates of the selection point are stored internally. Then if you enable Select Point visualization, and enable text labeling of Select Point, it will render the selection point as a small sphere and print its local and global coordinates next to it. This is the most convenient way to find out the coordinates of points of interest.
  3. Emo, thanks for the advice. This is very helpful. The point that I am labeling moves at certain points during training. I know that I can set a joint position using qpos. How do I set a site position?
    Last edited: Aug 9, 2018
  4. Emo Todorov

    Emo Todorov Administrator Staff Member

    The "official" way is to create a mocap body with a site or geom attached to it, and move the mocap body by changing mjData.mocap_pos at runtime. But you can also change mjModel.site_pos directly, between mj_step() calls. Don't change mjModel inside any callbacks though, or between mj_step1 and mj_step1, because the code assumes that mjModel remains contstaint throughout one execution of the pipeline.