Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Is getImpulse() the only way to get contact force? #64

Open
ZQX323 opened this issue Nov 13, 2020 · 1 comment
Open

Is getImpulse() the only way to get contact force? #64

ZQX323 opened this issue Nov 13, 2020 · 1 comment

Comments

@ZQX323
Copy link

ZQX323 commented Nov 13, 2020

Hi Jemin,

I want to get the contact force of the contact point. Seems like there is only a method getImpulse() to calculate contact impulse. To calculate the contact force, I have to calculate the derivative of force with respect to time. But how can I get dP/dt? Or is there a method to direct get the force?

A similar problem is the acceleration of the body. It seems no direct way to get acceleration. Should I use the integral of velocity?

Best,
Qingxu

@jhwangbo
Copy link
Contributor

In RaiSim, the contact impulse is applied during a time step. If you want to get force, you have to just divide it by the time step. This will give you an average force applied over that time step.

You can compute the acceleration by a finite-difference. Almost all simulators that you will see are velocity-based and do not provide acceleration directly

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants