Set qfrc/xfrc in Unity

Discussion in 'Unity Plugin' started by ksjoey0096, Sep 18, 2018.

  1. Hello,

    There are some questions I want to ask.

    1. Since there are only the function names in Unity Plugin, can I know what SetPerturb(TPerturb* perturb) actually do in Unity?
    2. How can I directly control the mjdata, or how can I add functions like qfrc_applied / xfrc_applied to Unity Plugin?

    Thanks
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    You cannot control the simulation except via mouse perturbations. This limitation will be removed with the next update of the Unity plugin -- sometime in December or January.

    SetPerturb sets a mujoco-specific data structure with information about mouse selection and perturbations. It can only apply force and torque to a single body at a time, and cannot be used as a general control mechanism.
     
  3. Is there any update on this?
    We would like to use MuJoCo in Unity to improve our physics. But would have to be able to interact with the engine to make it possible.
     
    Arthurin21 likes this.
  4. I have exactly the same situation as you. But now it seems that Mujoco only utilizes Unity as a rendering and displaying tool. After importing the mujoco models, I tried to edit the objects through Unity editor and add some objects into the scene through Unity, but None of the modifications will be saved even though I clicked the 'save' button. It still displays the original Mujoco model.