Information about simulation environment (#645)

Posted by @mb0514:

Hello,

I work in a research project and we are studying Open-RMF and the various adapters in order to develop an integration with other frameworks. Currently we are trying to make software based simulation and we would like some information or insight on how to simulate robot API like MiR Rest API and the MiR fleet adapter in a simulation environment like Gazebo. Is it possible to do so? Are there any mock for MiR API that are linked to Gazebo?

Thank you in advance for your help.

Best regards

Posted by @xiyuoh:

Hello @mb0514 ! We currently use our slotcar plugin to simulate robots running with RMF. We use our own ROS 2 messages, i.e. PathRequest, to send target waypoints to the robot, and the slotcar plugin will handle the simulation. In RMF demos, these path requests are sent from a fleet manager, specifically this REST endpoint where the robot is asked to navigate to a target location. You’ll also find other important endpoints that relay commands or retrieve robot status.

Although we’ve worked with MiR API, we haven’t integrated them with Gazebo as the objectives for hardware and simulation testing are usually different, so there is currently no mock MiR API for our simulation plugins.

If I’m understanding correctly, your intention is to replicate the MiR REST API in simulation with your own Gazebo plugin, so that you can have a simulated robot receive MiR missions the same way a physical MiR does. I’d recommend defining the necessary MiR REST endpoints to simulate robot behavior, similar to what we have in demos fleet manager. Here’s the list of MiR API used in fleet_adapter_mir that we’ve used to retrieve/post information on physical robots. You’ll need to implement the corresponding endpoints in your own plugin, i.e. your own simulated MiR.

The other crucial step in MiR integration is to ensure that RMF-related missions are created properly on the physical robots. In fleet_adapter_mir, we do it automatically in the fleet adapter by posting these rmf_missions to the robot. You can refer to this README to understand how RMF creates these missions. For your case, in your simulated MiR plugin, you’d have to translate these missions (and their mission parameters) to robot behavior.

Let me know if you need further clarification.

Posted by @mb0514:

Thanks for your kind feedback,

I have seen in the adapters repository some references about other Company like OTTO Motors. Based on your knowledge, is there any implementation for others company robot’s API endpoints that can be used to perform simulations like I asked in the previous question?

Thank you for your help

Posted by @xiyuoh:

If you are referring to the awesome_adapters page, I believe those are all fleet adapter implementations for physical robots, but you can run the free_fleet adapter with turtlebots in simulation since Nav2 is compatible with Gazebo.

Posted by @mb0514:

Thank you again!

About the simulation environment. Is it possible to integrate some of the already made Gazebo Fuel’s worlds (like the warehouse’s world) in the traffic editor to make a more realistic scenario?

Posted by @aaronchongth:

Yes, you will need to use the --TEMPLATE_WORLD_FILE argument when generating your simulation world, here is an example, nexus/nexus_demos/CMakeLists.txt at main · osrf/nexus · GitHub

Posted by @mb0514:

Thank for your feedback!
I correctly launched the depot_template.sdf within a rmf demo simulation.
In order to create a similar simulation environment, I would like to ask you the correct working flow to combine the use of the traffic editor and an “externally” generated Gazebo world.
Which option is right way to construct a similar simulation?

  • I make a Gazebo world ( .sdf file) and then I design the traffic lines and the nav graph with the traffic editor. In this case, how can I “visualize” the .sdf structure in the traffic editor to correctly draw the lines? how can I regulate the correct distances and measures of the sdf file?
  • I design the traffic lines and the nav graph and then I create an external Gazebo World based on the output .sdf/world file that the building_map_generator produce by adding external scenic objects to it (for example by the resource spawner of Gazebo).
    Let me known if I explained it correctly.
    Thank you again for your support and help

Posted by @aaronchongth:

Which option is right way to construct a similar simulation?

Either of the option works, it depends on what you start with

  • if you already have a building’s floor plan (PNG or JPG), you can use traffic editor directly, but you’ll need to add in any assets that you’d like to have in the world manually
  • if you want to start with an already existing world, you’ll need to use the --TEMPLATE_WORLD_FILE argument, as well as figure out a way to map it yourself so you can obtain a usable “floorplan” for traffic editor

I make a Gazebo world ( .sdf file) and then I design the traffic lines and the nav graph with the traffic editor. In this case, how can I “visualize” the .sdf structure in the traffic editor to correctly draw the lines? how can I regulate the correct distances and measures of the sdf file?

Since there is no “official” floorplan for the depot world, I’d suggest the laser scan map that is conveniently provided by the nav2_bringup package upstream, navigation2/nav2_bringup/maps at main · ros-navigation/navigation2 · GitHub. However, if you decide to use a map that is not already mapped, you’ll need to figure out a way to map it or measure it yourself. The easy way would be to follow the turtlebot examples, spawn a turtlebot in the map, start the mapping, drive it around in simulation, and save the captured map.

I design the traffic lines and the nav graph and then I create an external Gazebo World based on the output .sdf/world file that the building_map_generator produce by adding external scenic objects to it (for example by the resource spawner of Gazebo).

It’ll come down to how scenic you’d like your world to be. Out-of-the-box, traffic editor has a few models that folks can use, but it is definitely not as extensive as all the models available on Fuel


Edited by @aaronchongth at 2025-04-01T10:51:05Z