andreadelprete / consim

GNU General Public License v3.0
14 stars 1 forks source link

bhammoud_refactor #11

Closed hammoudbilal closed 4 years ago

hammoudbilal commented 4 years ago

Here's a brief of what changed,

  1. all contact point specific methods were moved to class ContactPoint it is not a struct anymore, this includes computing all kinematic variables such as velocity, jacobian, etc ..

  2. for the ContactObject class, computing the kinematics was moved to ContactPoint, now it only stores a specific contact model, checks collision and sets the anchor point

  3. Comparing it to your python code, i thought I could skip creating a third class "Contact" to store both the point and the object, the only downside of this is having to define the ContactObject base class in the contact header "contact.hpp" rather than "object.hpp" since both classes are dependent on each other.

  4. The reference for the contact object penetration parameters here is now consistent with the same conventions (f = K dx - B v), it seems that the directions for Normal and Tangent were not consistent before so the forces would have to be computed with different (+/-) combinations of stiffness and damping

  5. The only for loop over a vector remains here this makes sure that no pulling force occurs, I will try to change it later if I figure out a way to do it better.

  6. There might be few memory allocations happening in ContactPoint, I will have to track it down, I wanted to make sure things are working before I start creating extra variables in the class.

  7. for now, in python i still have to store the contact points and access the force separately from the simulator object, should we move this into the simulator with a getForce method ? or is there any convenience to storing the contact points separated that I am not aware of ?