Custom dynamics implementation

Typically: "How do I... ", "How can I... " questions
Post Reply
Posts: 1
Joined: 06 Jun 2018, 09:56

Custom dynamics implementation

Post by Xenerbeghkm » 11 Jun 2018, 11:02


I have a custom library of rigid body dynamics which I would like to implement in a custom V-REP build. A similar query was posted in viewtopic.php?t=4697. But the solution to the above discussion was related to child scripts. I would like to implement a custom dynamics plugin.
My custom library provides rigid body motion propagation (Newton-Euler Forward dynamics). It also provides collision detection and contact dynamics. I would like to be able to interface V-REP with the custom library in such a way that I get it as a drop-down (Bullet 2.78, 2.83, ODE, Vortex, Newton, <custom>) and the rest of V-REP functionality follows.
So far, I have an overview of the V-REP git repository and had a look at the various implementations in the dynamics plugin. If I implement similar code for the custom library, would it get picked up by V-REP? What would be the ideal way to achieve the functionality?
Also, the V-REP simulation runs at a different rate (0.05 sec) usually while the dynamics plugin has its own rate. Could you describe this a little more how the torque commands are used to compute the forward dynamics. Is it at 0.05 sec or the dynamics rate. Would it be possible to run the V-REP simulation at 0.05 seconds while computing motion for torque commands at 0.001 seconds (Dynamics plugin rate)?
It would be greatly helpful if someone could point me in the right direction.


Site Admin
Posts: 7020
Joined: 14 Dec 2012, 00:25

Re: Custom dynamics implementation

Post by coppelia » 12 Jun 2018, 11:41


adding another physics engine is actually linked with some other things, next to writing another physics plugin. The parameters of each physics engine need to be editable in V-REP and should also be stored, together with a scene. This makes the whole procedure a bit more complicated.

You could try to simply use one of the existing engine plugin, and replace the code to link to your engine, using default settings and parameters. As a first step. If things work out, there are following 2 possibilities:
  • The engine is stable and comparable with the other engines. In that case, we could then work together and add the necessary code on the V-REP side.
  • Or, it doesn't make sense to have other people benefit from that engine, and in that situation you could store all the engine settings and parameters inside of the scene or inside of each object (e.g. using sim.writeCustomDataBlock). You will then probably also need a way to edit those values. That could be done inside of a customization script that offers custom UIs for that task.

Post Reply