Dynamic constraints?

Discussion in 'Simulation' started by shormilt, Dec 13, 2017.

  1. Is there a way to dynamically add/remove constraints?

    (Use case: simulate grasping behavior of suction cups)
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    You cannot change the model structure at runtime since MuJoCo uses compiled models. However all constraints have data fields which can be used to enable and disable them at runtime. Equality constraints have mjModel.eq_active. Joint limits have mjModel.jnt_limited etc. There are also global disable flags in mjModel.opt.disableflags that can disable all constraints in a given category.
     
    shormilt likes this.