Automatic Modelica Package and Model Generation from
Templates and Data Files with Python, Exemplified with URDF
Antoine Pignède, Carsten Oldemeyer
Creating correct Modelica models and packages from templates and data files describing a multi-physics system is useful in numerous situations. For example, in laying out power plants, designing airplane air conditioning or chemical reactions. This publication shows two possibilities of doing this with an example from robotics design and simulation. The URDFModelica library contains templates for links, joints and whole robots that can be mobile or stationary. The library also has a Python script that takes a valid URDF file as input. With minimal manual processing of this input file, a complete robot simulation package is created automatically. Alternatively, the input file, translated to a Modelica record, can be used to set the parameters and connections of a generic robot model. The URDFModelica library has already been successfully used for quick generation of first Modelica simulations of existing robots or robots yet to be fully developed. The general structure and approach can be adapted to other application domains without much effort. It is planned to release URDFModelica as open source Modelica library.