Functional Mock-up Interface (FMI) import plugins for the Gazebo Simulator.
The project is undergoing heavy development: APIs may still be subject to changes, and some functionalities may be broken.
This repository contains plugins for the Gazebo robotic simulator to enable co-simulation between the physics simulation of Gazebo and simulation tools that support the Functional Mock-up Interface (FMI) standard. At the moment, the report just contains a plugin that import Functional Mock-up Units (FMUs) for simulation of the actuator dynamics.
A good introductory paper to the co-simulation concept is available at https://arxiv.org/abs/1702.00686 .
gazebo-fmi depends on
- Gazebo -
version >= 7
- FMILibrary (see https://github.com/svn2github/FMILibrary for an updated GitHub mirror) -
version >= 2.0.3
We recommend to install Gazebo as described in official documentation.
For FMILibrary, one option is to compile it as any CMake project and then add its installation prefix to CMAKE_PREFIX_PATH
.
See CGold guide if you need some details on how to build a CMake project.
An easier option is provided by the gazebo-fmi repository which downloads and compiles the FMILibrary internally within its build folder using CMake's FetchContent module. This is performed when FMILibrary package is not already existing in the system or if the FMILibrary related environment variable (FMILibrary_ROOT
) is not set, making gazebo-fmi unable to find FMILibrary package. To use this option, the CMake option USE_SYSTEM_FMILIBRARY
should be set to OFF
.
Use the following commands to build and install the plugin.
With make
facilities:
$ git clone https://github.com/robotology-playground/gazebo-fmi
$ cd gazebo-fmi
$ mkdir build && cd build
$ cmake ..
$ make
$ [sudo] make install
With IDE build tool facilities:
$ git clone https://github.com/robotology-playground/gazebo-fmi
$ cd gazebo-fmi
$ mkdir build && cd build
$ cmake ..
$ cmake --build . --target ALL_BUILD --config Release
$ cmake --build . --target INSTALL --config Release
See CGold guide if you need more details on how to build a CMake project.
See plugin-specific documentation on how to use each plugin:
For running the automatic tests of the plugins contained in this repo, you need the additional dependency of the OpenModelica compiler. The OpenModelica compiler is used to generate test FMUs from Modelica models. We recommend to use OpenModelica at least version 1.13 as OpenModelica 1.12 has several bugs related to FMU generation (see #5 and https://trac.openmodelica.org/OpenModelica/ticket/4135 ).
Once you installed OpenModelica on your system, you can regenerated the project with the BUILD_TESTING
CMake option set to ON
to compile the tests. Once test are compiled, you can run them using ctest, for example run:
$ ctest [-VV]
to run all the tests.