Forces applied to a link

Hi everyone!
I’m trying to get forces applied to a single link (spherical in my case) during its contact with a surface. I’ve tried out every available force-related methods in BodyNode, Skeleton and Joint classes. For now only two of them seem to be appropriate:

  • getBodyForce() in BodyNode class;
  • getConstraintForces() in Skeleton class;

However I’m not sure if they are what I’m looking for. Could anybody please tell me what kind of forces are measured by those functions and which one is more suitable for my task?

Thanks in advance!

Somehow I am unable to attach links to these functions in my post - I get this warning: “Sorry you cannot post a link to that host.”

That information should be provided by the dart::collision::Contact class.

You can get the most recent contacts from a simulation world using dart::simulation::World::getLastCollisionResult().

You’ll need to iterate through the contacts to find the ones that are associated with the link you care about and add up their forces.

1 Like

Wow, I’ll try that one, thank you so much @grey!