Difficulty of integrating with different game engines (#386)

Posted by @alexzhang13:

I was wondering how difficult it would be to integrate with other game engines like Unity or Unreal as opposed to Gazebo. I’ve been skimming through the codebase and a lot of components seem pretty heavily integrated with Gazebo.

One idea I had was to communicate with a engine through a ROS bridge as if it were a real fleet of robots and follow this section: Integration - Programming Multiple Robots with ROS 2 but I was wondering if anyone had a starting point to hack something like this together.

That, or if anyone could point me to where (if feasible) I could look to replace Gazebo. Thanks!

Posted by @luca-della-vedova:

Hi!

I believe integrating RMF with an engine that is not Gazebo wouldn’t be too hard, the main repos I would look at are rmf_simulation and rmf_demos.
Most of the logic that you would have to reimplement in your game engine is what is contained in rmf_simulation. The package is currently split in a modular fashion, where the Gazebo independent logic is contained in _common packages, and wrappers for Gazebo / Gazebo Classic are in _gz and _gz_classic packages respectively. It should be possible to use the _common packages as a base and just build the interface to your game engine of choice on top of them.

In addition to the robot / infrastructure logic contained in the book you linked / rmf_simulation, you would also need to create a /clock publisher from your engine that provides the simulation time to the rest of the ROS 2 stack.
Good luck!