Skip to content

Setting model state in Unity #137

Discussion options

You must be logged in to vote

You can set the MuJoCo state (e.g., data->qpos for root position and joint angles, and data->qvel for respective velocities) at any stage. In order to force Unity to sync to the new state, first call mj_kinematics(model, data) (to update e.g., data->xpos according to the new qpos) and then MjScene.SyncUnityToMjState() (to update Unity transforms according to the new xpos).

You can see an example of this workflow in MjScene.RecreateScene().

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by erez-tom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants