Home | Tutorials | Wiki | Issues
Ask Your Question

simulink model as GAZEBO plugin

asked 2014-11-09 09:19:54 -0500

dmeltz gravatar image

Hello all

Is it possible to connect simulink to gazebo as a plugin ? for example if i like to model a nonlinear spring using simulink and include it as part of my robot ?

Does anyone have an idea if and how it can be done ?


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-11-18 03:04:08 -0500

kpykc gravatar image

updated 2014-11-18 03:06:55 -0500


i didn't made anything like that for Gazebo, but i suppose what you need is Gazebo model plugin which will communicate with Matlab. Communication itself can be done in different way i think, e.g. all kind of: pipes, IPC, udp over network, etc.

Call MATLAB Functions from C and C++ Applications

C/C++ Wrapper for SIMULINK models

Also you can probably split this task in two pieces and communicate using gazebo topics, than you need to implement Simulink S-Function block which will publish data you need to model plugin. E.g something like that:

ROS/Matlab Simulink communication

And connect this block to the outputs of your model.

Hope this helps.

edit flag offensive delete link more


I can say first hand, that trying to use gazebo functionality within a S-function will not work. At run time the library libgdal.so.1 will have a couple undefined symbols to a library (cannot remember the name lets call it libA.so) and you cannot symbolically link to libA.so from an external directoy that can resolve the undefined symbol because libA.so already exists within the matlab directory and it has slightly different definitions that are needed by other libraries within matlab.

Francis123 gravatar imageFrancis123 ( 2017-01-20 11:15:07 -0500 )edit

^ Adding to the previous comment, if anyone has figured a way to get passed needing to use libgdal with gazebo on a ubuntu installation please give some insight :)

Francis123 gravatar imageFrancis123 ( 2017-01-20 11:15:57 -0500 )edit

answered 2014-12-02 15:41:51 -0500

scpeters gravatar image

We haven't yet connected it to Simulink, but we are working on a project that is connecting gazebo to matlab using ignition-transport. Here are some links to documentation about it:



We will create a Gazebo to Matlab/Simulink tutorial when we have it working well.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-11-09 09:19:54 -0500

Seen: 1,118 times

Last updated: Dec 02 '14