Online adaptation of friction parameters

Discussion in 'Support requests' started by florianw, Jul 8, 2018.

  1. I am alternating the three dimensional friction parameters of my geoms online.
    I know how mujoco creates the contact friction parameters (5D) from each of the geoms friction values (elementwise max).

    I tried to set large values for the geom friction parameters to make sure they appear in the contact friction parameter. Unfortunately the setting of the geom friction parameters during simulation has no effect on the contact friciton.

    Any clue what I am doing wrong?
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    You have to make online changes in the compiled mjModel directly -- in this case mjModel.geom_friction[3*n ... 3*n+2] where n is the index of the geom you want to change. Note that when two geoms collide, the larger of the two geom friction values is used to determine the contact friction. So you can change the friction of some geoms and see no change in behavior, because the other geom in the contact pair has larger friction.

    Also, if the geom pair is listed explicitly, then the pair friction parameters (5D) are used and the individual geom frictions are ignored.