Contact forces

Discussion in 'Simulation' started by mohammad, Jul 2, 2018.

  1. hi
    how can i extract contact forces from efc_force?
    in documents u said that after the constraint forces have been computed, the vector of forces for contact i starts at:
    mjtNum* contactforce = d->efc_force + d->contact.efc_address;
    1_ what is efc_address?
    2_ d->efc_force is a force vector and d->contact.efc_address is a int number. why are they added togheter? what dose it mean?

  2. Hi Mohammad,

    I have the same questions. Did you solve them and find out how to get the contact forces?
  3. Emo Todorov

    Emo Todorov Administrator Staff Member

    efc_address is the integer offset of the contact's data in the global vector efc_force. when you add a pointer and an int in C, you are advancing the pointer.
  4. Thank you for the reply.
    Yes that is right. Actually when i asked this question i worked with python and was not much familiar with C pointer