rapier icon indicating copy to clipboard operation
rapier copied to clipboard

Hard real-time dynamics

Open JurajLieskovsky opened this issue 2 years ago • 4 comments

Hi, I've developed some methods for modelling and controlling cable driven robots which I would like to implement in a library that can run in real-time. I have two questions

  1. Is there a resource that captures well the implementation of dynamics in rapier? (personally I am familiar with Rigid Body Dynamics Algorithms by Roy Featherstone)
  2. Is rapier and rust in general suitable for hard real-time applications?

JurajLieskovsky avatar Feb 28 '22 17:02 JurajLieskovsky

Hi! Rapier uses a symplectic Euler integration scheme. For multibodies (based on reduced-coordinates joints) we derived the equations of motions manually taking the reduced coordinates into account, and construct a full NxN (where N is the number of degrees of freedoms) mass matrix that we invert at each timestep. So the external and inertial forces applied to multibodies are integrated in a linearly-implicit way. For contacts and impulse-based joints, the constraints solver is based on PGS with Baumgarte stabilization (using implicit springs for stabilization).

Regarding hard-real-time applications, it depends on your workload and the efficiency of your device. I personally never tried Rapier in a performance-constrained environment, so benchmarking is the best way to figure out if it’s suitable to your use-case. Rust in general is very suitable for hard real-time application (it is as suitable as any other native languages like C/C++).

sebcrozet avatar Feb 28 '22 17:02 sebcrozet

So I would imagine that for each "reduced-coordinate joint" you have a 6xn matrix and len 6 vector (lets say S and c) where the acceleration of the body succeeding the joint is a = S*\ddot{q} + c ?

JurajLieskovsky avatar Feb 28 '22 18:02 JurajLieskovsky

This is correct.

sebcrozet avatar Mar 19 '22 10:03 sebcrozet

@sebcrozet Would it be possible to provide other, higher order integration methods (like Verlet or Forest Ruth) or maybe even a custom integrator? It would be useful in some high fidelity simulations (like orbital simulations, in which symplectic Euler is very inaccurate)

d-bucur avatar Aug 18 '23 12:08 d-bucur