How to add springs between two non-adjacent objects

Discussion in 'Modeling' started by Chengxu Zhuang, Aug 1, 2017.

  1. Hi, I am new to MuJoCo and trying to reimplement one of my models in Bullet to MuJoCo.

    The problem is that I used a lot of springs between different objects in that model. Some of those objects are connected using some joints but some of them are not.

    I checked some tutorials in MuJoCo. It seems to me that MuJoCo could only add spring constraints as an attribute of a joint. Is that true? Can I add spring constraints between two objects that's not connected by joints (they could be far away from each other, for example)?

    Thanks!
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    Yes this is doable:

    1. Add a site on each body, at the point where you want the spring force to act.
    2. Create a spatial tendon between the two sites, and set its stiffness and damping attributes.

    Note that the equilibrium position of the spring will correspond to the distance between the sites at the pose in which the model was created.
     
    Kyokushin likes this.
  3. Great! Thanks for your response!