Physics Engine Development - C++ vs. OOP in Matlab

11 vues (au cours des 30 derniers jours)
Eddy Sanoli
Eddy Sanoli le 9 Juil 2020
Commenté : Eddy Sanoli le 9 Juil 2020
Recently I've been interested in implementing a top-down physics engine for a group of differential robots, all inside Matlab. The thing is, there is a lot of additional computations that I want to do apart from the physics simulations asociated with the engine. However, after looking a little bit into it, its obvious that a physics engine will hog a lot of the computational resources available, in particular if you use object oriented programming to implement physical entities (Given that OOP in Matlab is relatively slow). A possible solution that came to mind was to code the physics engine in C++ and then import the .cpp file to Matlab. However, I don't know if this will result in a better performance or the possible performance gains would be undermined by the additional processing required to parse a .cpp file.
I tried a physics engine called "CapSim" and it runs too slow for my liking.
Thanks in advance!
  2 commentaires
James Tursa
James Tursa le 9 Juil 2020
I suggest you code up a small C++ example that does something you will need and see how you like the performance. It is hard to advise you without knowing all of the things your physics engine will be doing.
Eddy Sanoli
Eddy Sanoli le 9 Juil 2020
Oh, sorry for not going into detail. The engine will handle collisions between multiple robots (Generally between 10 and 30 robots modeled as circles seen from above) and their environment (Mostly consisting of static obstacles and a few polygons that can be pushed around).

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Robotics dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by