Comparative Study of Physics Engines For Robot Simulation With Mechanical Interaction
Comparative Study of Physics Engines For Robot Simulation With Mechanical Interaction
Article
Special Issue
Intelligent Control and Applications for Robotics
Edited by
Dr. Fan Zhang
https://doi.org/10.3390/app13020680
applied
sciences
Article
Comparative Study of Physics Engines for Robot Simulation
with Mechanical Interaction
Jaemin Yoon † , Bukun Son and Dongjun Lee *
Department of Mechanical Engineering, IAMD (Institute of Advanced Machines and Design) and IER (Institute of
Engineering Research), Seoul National University, Seoul 08826, Republic of Korea
* Correspondence: [email protected]
† Current address: Robot Center, Samsung Research, Seoul 08826, Republic of Korea.
Abstract: Simulation with a reasonable physical model is important to develop control algorithms for
robots quickly, accurately, and safely without damaging the associated physical systems in various
environments. However, it is difficult to choose the suitable tool for simulating a specific project. To
help users in selecting the best tool when simulating a given project, we compare the performance of
the four widely used physics engines, namely, ODE, Bullet, Vortex, and MoJoco, for various simple
and complex industrial scenarios. We first summarize the technical algorithms implemented in each
physics engine. We also designed four simulation scenarios ranging from simple scenarios for which
analytic solution exists to complex industrial scenarios to compare the performance of each physics
engine. We then present the simulation results in the default settings of all the physics engines, and
analyze the behavior and contact force of the simulated objects.
Keywords: simulation; physics engine; multipoint contacts; open-source software; robotic assembly
1. Introduction
With the recent development of robotic technology, there is a growing movement to
use robots for the efficiency and safety of tasks in real industrial fields [1]. To perform
various and complex industrial scenarios using robots, a simple hand-tuned controller
Citation: Yoon, J.; Son, B.; Lee, D. cannot achieve a high level of performance, which leads robots to perform tasks using
Comparative Study of Physics model-based controllers. Furthermore, recently, data-driven approaches have been widely
Engines for Robot Simulation with used for controlling robots, especially reinforcement learning [2], to enable robots to react
Mechanical Interaction. Appl. Sci. to an unexpected environment. However, the development of control algorithms requires
2023, 13, 680. https://doi.org/
preprocessing such as validating the controller for model-based approaches, and obtaining
10.3390/app13020680
a large number of data for meaningful generalization to various environments for data-
Academic Editor: Jose Machado driven approaches, which is time-consuming and dangerous when using a real robot.
Simulation with a reasonable physical model can overcome these challenges by allow-
Received: 10 December 2022
ing for users to develop control algorithms for robots in a variety of environments without
Revised: 25 December 2022
the possibility of damaging the associated physical systems. For this, a large number of
Accepted: 28 December 2022
physics engines (e.g., ODE [3], Bullet [4], Vortex [5], MuJoCo [6]) that provide an approxi-
Published: 4 January 2023
mate simulation of certain physical systems have been developed, but simulation results
often show unstable or inaccurate behavior when performing complex multipoint contact
simulations. To address these problems, a fast and physically accurate contact simulation
Copyright: © 2023 by the authors. framework should be developed, but currently developed physics engines still have many
Licensee MDPI, Basel, Switzerland. limitations. In a situation with such limitations, it is necessary to select a physics engine that
This article is an open access article is close to the real one for performing realistic simulations, but none of the physics engines
distributed under the terms and has been consistently better than the others when considering various scenarios. There is
conditions of the Creative Commons also no well-organized document on the properties of each physics engine, and it is not
Attribution (CC BY) license (https:// intuitive how the properties of each physics engine affect the simulation results. Therefore,
creativecommons.org/licenses/by/ it is difficult to select a suitable physics engine for a specific project to be simulated.
4.0/).
In this paper, we compare the performance of four widely used physics engines for
various scenarios to help users in deciding which physics engine to use by referring to
the performance of each analyzed physics engine in this paper when simulating a given
project. More precisely, we performed a variety of scenarios ranging from simple scenarios
for which an analytic solution exists to complex scenarios used in the real industrial field
(e.g., peg-in-hole assembly [7], bolt assembly [8]), and various object-to-object contact sce-
narios ranging from simple contact between primitive-shape objects to complex multipoint
contacts between mesh objects. We also analyze how accurately physics engines simulate
real-world physics by observing the contact force, which is important for the behavior of the
object. These results can help many researchers in choosing a physics engine for a specific
application, and in determining new research directions through the identified limitations.
Numerous studies have been proposed to compare the properties or performance of
robotic simulators or physics engines. However, most studies have only tested simulators
for simple scenarios for which analytic solutions exist, such as sliding an object on a
slope or dropping an object to bounce using simple primitive-shape objects such as a
sphere, box, and cylinder [9,10]. While there are studies that performed simulations for
complex scenarios and analyzed the characteristics of each physics engine [11,12], these
studies showed that the simulated objects were simple with a primitive shape, and the
simulated scenarios did not cover widely performed tasks in real industries (e.g., assembly).
In numerous studies, robot simulators that include modeling and visualization based
on several physics engines to create an application for a physical robot (e.g., Gazebo,
CoppeliaSim) were compared [13–16], and not physics engines, which affects the accuracy
of the simulation. On the other hand, we analyzed the performance of several physics
engines for various scenarios ranging from simple scenarios for which analytic solution
exists to complex scenarios performed in the real industrial field, including primitive-shape
and mesh objects. In addition, while other studies focused on the speed of simulation
to analyze its performance, we observed how accurately the physics engines simulated
real-world physics.
The rest of the paper is organized as follows. Section 2 presents the technical review
of each physics engine. Section 3 presents information about the implemented scenarios to
compare each physics engine. Section 4 presents the simulation results and discusses them.
Summary and some comments on future works are then given in Section 5.
Collision Contact
Physics Engine Object Contact Solver Integration Coordinate
Detection Clustering
Primitive and Ignores some LCP + Semi-implicit
ODE Built-in Maximal
mesh contact points Dantzig/PGS Euler
LCP +
Primitive and Maximizes Semi-implicit
Bullet Built-in Dantzig/PGS Generalized
mesh contact area Euler
/NNCG/SI
LCP +
Primitive and Details are not Semi-implicit
Vortex Built-in direct/iterative Generalized
mesh disclosed Euler
method
Semi-implicit
Keeps only a
Primitive and Convex Euler/fourth-
MuJoCo libccd few contact Generalized
convex mesh optimization order
points in front
Runge–Kutta
2.1. ODE
Open Dynamics Engine (ODE) is an open-source physics engine that is integrated
with several robot simulators, including Gazebo and CoppeliaSim. It has a built-in collision
detection system that supports primitive-shape and mesh objects. When calculating the con-
tact force, including friction, ODE uses a polyhedral approximation that relaxes Coulomb’s
friction cone constraint as a pyramid shape, which transforms the contact problem into a
linear complementarity problem (LCP [18]). To obtain the solution of LCP, ODE provides
the Dantzig solver [19], which is a type of direct solver that finds an exact solution, and
the projected Gauss–Seidel (PGS [20]) solver, which is a type of iterative solver that finds
an approximated solution iteratively and quickly. The default setting in CoppeliaSim is
PGS. When calculating the contact forces, ODE ignores some contact points to improve the
simulation speed, although its details are not fully disclosed. Here, the default maximal
number of contact points to generate in CoppeliaSim was 64.The integrator implemented
in ODE that determined the numerical accuracy of the simulation was a semi-implicit Euler
integrator [21]. Additionally, ODE supports multibody dynamics in maximal coordinate
representation, but it does not support generalized coordinate representation, which is
more computationally efficient and accurate for heavily constrained systems such as robots
with a large number of joints.
2.2. Bullet
Bullet is an open-source physics engine, commonly used for computer games, com-
puter graphics, and robotics. The Bullet collision detection algorithm proceeds similarly to
most physics engines that support primitive-shape and mesh objects. When calculating
the contact force, Bullet uses polyhedral approximation, similar to ODE, and provides
Dantzig, PGS, nonsmooth nonlinear conjugate gradient (NNCG [22]), and the sequential
impulse (SI [23]) solver. The default setting in CoppeliaSim is SI. Similar to ODE, Bullet
also reduces the contact points to reduce the computational burden when calculating the
contact force; the difference is that the rules for this are known, which is that the contact
point with the deepest penetration is always maintained, and up to 4 contact points are
determined to maximize the area covered by the contact points. The integrator in Bullet
is a semi-implicit Euler integrator. Additionally, unlike ODE, Bullet uses the generalized
coordinate representation.
Appl. Sci. 2023, 13, 680 4 of 13
2.3. Vortex
Vortex is a closed-source/limited free physics engine. Its collision detection algorithm
consists of a series of overlap tests, beginning with fast, efficient, and approximate overlap
tests on bounding volumes of the colliding objects to reduce computational complexity,
and supports primitive-shape and mesh objects, similar to most physics engines. When
calculating the contact force, Vortex also uses polyhedral approximation, and offers both a
direct and an iterative solver to calculate the contact force. Here, unless simulation speed is
more important than accuracy, such as in granular materials, the direct solver is the default
setting. Similar to other physics engines, Vortex also reduces the contact points to increase
the simulation speed, but the details are not fully disclosed. Vortex uses a semi-implicit
Euler integrator and the generalized coordinate representation similar to Bullet.
2.4. MuJoCo
Multi-Joint dynamics with Contact (MuJoCo) is a commercial physics engine that
requires a license. The collision detection algorithm in MuJoCo uses a general-purpose con-
vex collider implemented by libccd [24], which is an open-source collision detection library,
so it supports primitive-shape and convex mesh objects, but not nonconvex mesh objects.
Unlike other physics engines, MuJoCo does not approximate the friction cone, but converts
the contact problem into a convex optimization problem by relaxing the nonpenetration
constraint between colliding objects [6,25]. To solve this convex optimization problem,
MuJoCo provides the conjugate gradient method, Newton’s method, and PGS, which used
to be the default. Similar to other physics engines, MuJoCo also reduces the contact points
to reduce the computational burden by keeping only the first 16 contact points. In MuJoCo,
two integrators are currently available, which are the semi-implicit Euler method and
the fourth-order Runge–Kutta method. Additionally, it uses the generalized coordinate
representation.
3. Robotic Scenarios
To compare the physics engines from various perspectives, we simulated four simula-
tion scenarios. Two of them were simple scenarios with criteria that could be compared
with an analytic solution, while the other two were complex scenarios required in the real
industrial field. Details of each scenario are as follows.
Figure 1. Snapshot of a simple scenario: 16 small cubes are placed on top of a large box and force is
applied to the large box. Over time, the small cubes and the large box separate (1→4).
Figure 2. Illustration of the mesh objects: (a) cylinder; (b) hole; (c) bolt; (d) nut.
Appl. Sci. 2023, 13, 680 6 of 13
Figure 3. Snapshot of multi-point contact scenario: a cylinder is placed on a box and pressed down
and pushed forward. When a cylinder reaches the end after pushing it in x direction (1→2), we push
it in − x direction (2, 3), and push it in x direction when it reaches the end (4).
Figure 4. Snapshot of peg-in-hole scenario: the peg is first pressed down to insert the peg into the
hole (1,2), and once the peg is in, it is pressed down and pushed in x direction to generate contact
(3,4).
Figure 5. Performance of each physics engine for a simple scenario: (left) average percentage error
of the friction force acting on all upper boxes with an analytic solution; (right) maximal penetration
depth of all upper boxes.
From the results, for a simple scenario, ODE and Bullet showed good performance on
the basis of the contact force, and Bullet showed the best performance when penetration
was also considered. In the case of MuJoCo, a relatively large contact force error was
observed, and a large penetration occurred, since it ignored the nonpenetration constraint,
as stated in Section 2.4. However, it improved the simulation speed compared to other
physics engines not only in the simple scenario, but also in all other scenarios that we had
implemented.
Figure 6. Performance of each physics engine for multipoint contact scenario: (left) maximal angle of
the friction force acting on the cylinder; (right) maximal penetration depth of the cylinder.
Figure 7. Snapshot of failure case of multipoint contact scenario: the contact force is not properly
simulated, so the cylinder cannot stand upright and falls over time (1→4).
Figure 8. Contact force acting on the peg of each physics engine for peg-in-hole scenario: (a) ODE;
(b) Bullet; (c) Vortex; (d) MuJoCo.
Figure 9. Snapshot of peg-in-hole scenario for MuJoCo: the peg is pressed down to insert the peg
into the hole (1), but MuJoCo does not support nonconvex meshes, so peg cannot be inserted even if
we keep pressing down (2–4).
Figure 10. Snapshot of bolting scenario: (first row) ODE; (second row) Bullet; (third row) Vortex;
(fourth row) MuJoCo.
Figure 11. Snapshot of bolting experiment: when the nut is rotated and pressed down using the robot
manipulator, it is fastened with the bolt over time and goes down (1→4).
4.5. Discussion
From our observation, ODE and Bullet showed good performance for a simple sce-
nario with primitive-shape objects, and Bullet and Vortex showed good performance for
multipoint contact scenarios including mesh objects depending on the situation (Vortex
for multipoint contact on simple surface, Bullet for the peg-in-hole scenario). The reasons
for these results are that, in the case of ODE and Bullet, the contact simulation algorithms
are basically similar, so they showed similar performance for simple scenarios, but in
the case of multipoint contact scenarios, the method of reducing the number of contact
points and the default option of contact solver were different, resulting in a difference in
performance. In addition, since ODE uses maximal coordinates, in the case of scenarios
involving multilink robot, simulation must be performed while satisfying the constraints
between links compared to generalized coordinates that operate as one object, which can
cause errors and reduce simulation accuracy. In the case of Vortex, it is difficult to know
the exact reason, because most of the algorithms are not open to the public, but considering
Appl. Sci. 2023, 13, 680 12 of 13
that the performance was relatively good for multipoint contact scenarios between com-
plex objects, it seems that the algorithm had been tuned or improved, so that multipoint
contact simulation of complex objects could be performed well. MuJoCo showed relatively
poor performance in terms of contact force and penetration compared to other physics
engines because it calculates the contact force by relaxing the nonpenetration constraints.
However, this can greatly improve the simulation speed when multipoint contacts occur,
so it is thought to be useful when it is necessary to quickly perform various scenarios such
as reinforcement learning for tasks where contact force is not crucial rather than when
simulating accurate behavior between complex objects.
These analytical results can be helpful reference materials for selecting a suitable
physics engine for a specific project to be simulated. Furthermore, by identifying the
limitations of the currently developed simulators, it would be possible to suggest points to
be improved and future research directions in the field of simulation research.
5. Conclusions
In this paper, we summarized the technical algorithms and compared the performance
of several physics engines (ODE, Bullet, Vortex, and MuJoCo). For this, we performed a
variety of scenarios ranging from simple scenarios for which an analytic solution exists to
complex industrial scenarios, and various object-to-object contact scenarios ranging from
simple contact between primitive-shape objects to complex multipoint contacts between
mesh objects. We identified the characteristics and limitations of existing physics engines.
This process can give us useful information when we want to select physics engines
depending on task and explore future research directions for simulation. Some possible
future research topics include: (1) comparisons of more physics engines; (2) the extension
of test scenarios to more various scenarios to provide more informative comparison results.
Author Contributions: Conceptualization, J.Y. and D.L.; methodology, J.Y.; software, J.Y. and B.S.;
validation, J.Y.; formal analysis, J.Y.; investigation, J.Y.; resources, J.Y.; data curation, J.Y. and B.S.;
writing—original draft preparation, J.Y.; writing—review and editing, D.L.; visualization, J.Y.; super-
vision, D.L.; project administration, D.L.; funding acquisition, D.L. All authors have read and agreed
to the published version of the manuscript.
Funding: This research was supported by the Industrial Strategic Technology Development Program
(20001045), funded by the Ministry of Trade, Industry, and Energy (MOTIE, Korea), and the National
Research Foundation of Korea (NRF) (grants no. 2016R1A5A193847223, RS-2022-00144468), funded
by the Korean government (MSIT).
Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.
Data Availability Statement: Not applicable.
Conflicts of Interest: The authors declare no conflict of interest.
References
1. Wang, T.M.; Tao, Y.; Liu, H. Current researches and future development trend of intelligent robot: A review. Int. J. Autom. Comput.
2018, 15, 525–546. [CrossRef]
2. Ibarz, J.; Tan, J.; Finn, C.; Kalakrishnan, M.; Pastor, P.; Levine, S. How to train your robot with deep reinforcement learning:
Lessons we have learned. Int. J. Robot. Res. 2021, 40, 698–721. [CrossRef]
3. Smith, R. Open Dynamics Engine. Available online: http://www.ode.org/ (accessed on 2 February 2016).
4. Coumans, E. Bullet Real-Time Physics Simulation. Available online: http://bulletphysics.org/wordpress/ (accessed on 1
May 2015).
5. CM-Labs. Vortex Studio. Available online: http://www.cm-labs.com/vortex-studio/ (accessed on 29 July 2019).
6. Todorov, E.; Erez, T.; Tassa, Y. Mujoco: A physics engine for model-based control. In Proceedings of the IEEE/RSJ International
Conference on Intelligent Robots and Systems, Vilamoura-Algarve, Portugal, 7–12 October 2012; pp. 5026–5033.
7. Park, H.; Park, J.; Lee, D.H.; Park, J.H.; Baeg, M.H.; Bae, J.H. Compliance-based robotic peg-in-hole assembly strategy without
force feedback. IEEE Trans. Ind. Electron. 2017, 64, 6299–6309. [CrossRef]
Appl. Sci. 2023, 13, 680 13 of 13
8. Xu, J.; Zhang, C.; Liu, Z.; Pei, Y. A Review on Significant Technologies Related to the Robot-Guided Intelligent Bolt Assembly
Under Complex or Uncertain Working Conditions. IEEE Access 2019, 7, 136752–136776. [CrossRef]
9. Hummel, J.; Wolff, R.; Stein, T.; Gerndt, A.; Kuhlen, T. An evaluation of open source physics engines for use in virtual reality
assembly simulations. In Proceedings of the International Symposium on Visual Computing; Springer: Rethymnon, Greece, 2012;
pp. 346–357.
10. Chung, S.J.; Pollard, N. Predictable behavior during contact simulation: A comparison of selected physics engines. Comput.
Animat. Virtual Worlds 2016, 27, 262–270. [CrossRef]
11. Erez, T.; Tassa, Y.; Todorov, E. Simulation tools for model-based robotics: Comparison of bullet, havok, mujoco, ode and physx.
In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), Seattle, WA, USA, 26–30 May 2015;
pp. 4397–4404.
12. Körber, M.; Lange, J.; Rediske, S.; Steinmann, S.; Glück, R. Comparing Popular Simulation Environments in the Scope of Robotics
and Reinforcement Learning. arXiv 2021, arXiv:2103.04616.
13. Ivaldi, S.; Padois, V.; Nori, F. Tools for dynamics simulation of robots: A survey based on user feedback. arXiv 2014,
arXiv:1402.7050.
14. de Melo, M.S.P.; da Silva Neto, J.G.; da Silva, P.J.L.; Teixeira, J.M.X.N.; Teichrieb, V. Analysis and comparison of robotics 3d
simulators. In Proceedings of the 21st Symposium on Virtual and Augmented Reality (SVR), Rio de Janeiro, Brazil, 28–31 October
2019; pp. 242–251.
15. Ayala, A.; Cruz, F.; Campos, D.; Rubio, R.; Fernandes, B.; Dazeley, R. A Comparison of Humanoid Robot Simulators: A
Quantitative Approach. In Proceedings of the IEEE 10th International Conference on Development and Learning and Epigenetic
Robotics (ICDL-EpiRob), Valparaiso, Chile, 26–30 October 2020; pp. 1–6.
16. Collins, J.; Chand, S.; Vanderkop, A.; Howard, D. A Review of Physics Simulators for Robotic Applications. IEEE Access 2021, 9,
51416–51431. [CrossRef]
17. Kim, M.; Yoon, J.; Son, D.; Lee, D.J. Data-Driven Contact Clustering for Robot Simulation. In Proceedings of the IEEE International
Conference on Robotics and Automation (ICRA), Montreal, QC, Canada, 20–24 May 2019; pp. 8278–8284.
18. Drumwright, E.; Shell, D.A. Extensive analysis of linear complementarity problem (lcp) solver performance on randomly
generated rigid body contact problems. In Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and
Systems, Vilamoura-Algarve, Portugal, 7–12 October 2012; pp. 5034–5039.
19. Cottle, R.W.; Dantzig, G.B. Complementary Pivot Theory of Mathematical Programming; Technical Report; Stanford Univ CA
Operations Research House: Berkeley, CA, USA, 1967.
20. Liu, T.; Wang, M.Y. Computation of three-dimensional rigid-body dynamics with multiple unilateral contacts using time-stepping
and gauss-seidel methods. IEEE Trans. Autom. Sci. Eng. 2005, 2, 19–31. [CrossRef]
21. Hairer, E.; Lubich, C.; Wanner, G. Geometric numerical integration illustrated by the Störmer-Verlet method. Acta Numer. 2003,
12, 399–450. [CrossRef]
22. Silcowitz-Hansen, M.; Niebe, S.; Erleben, K. A nonsmooth nonlinear conjugate gradient method for interactive contact force
problems. Vis. Comput. 2010, 26, 893–901. [CrossRef]
23. Catto, E. Fast and simple physics using sequential impulses. In Proceedings of the Game Developer Conference, San Jose, CA,
USA, 20–24 March 2006.
24. Fiser, D. Libccd—Collision Detection Between Convex Shapes. Available online: http://libccd.danfis.cz/ (accessed on 1
April 2015).
25. Todorov, E. Convex and analytically-invertible dynamics with contacts and constraints: Theory and implementation in mujoco.
In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), Hong Kong, China, 31 May–5 June
2014; pp. 6054–6061.
26. Spong, M.W.; Hutchinson, S.; Vidyasagar, M. Robot Modeling and Control; Wiley: New York, NY, USA, 2006; Volume 3.
27. Montgomery, W.; Levine, S. Guided policy search as approximate mirror descent. arXiv 2016, arXiv:1607.04614.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual
author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to
people or property resulting from any ideas, methods, instructions or products referred to in the content.