MATLAB Answers

Simulating multiple robots in Gazebo through MATLAB/Simulink

14 views (last 30 days)
Sanyam Vyas
Sanyam Vyas on 24 Sep 2020
Commented: Amrtanshu Raj on 29 Sep 2020
I am new to matlab/simulink and gazebo and am looking to set up a multiple robot gazebo environment. The examples provided in the website go through the multiple robot simulations (in warehouse environment) in simulink, but the simulations were not on Gazebo.
Any help would be highly appreciated.. Thank you


Sign in to comment.

Answers (1)

Amrtanshu Raj
Amrtanshu Raj on 28 Sep 2020
You can use gazebo co-simulation to get the desired Implementation. This document explains how to setup gazebo co-sim. This example shows how to simulate a Differential Drive Robot in Gazebo via Simulink
You can refer to this document for the functions and examples related to gazebo co-sim.
Hope this helps !!


Sanyam Vyas
Sanyam Vyas on 29 Sep 2020
These include examples for just one robot. Would you recommend adding two models within one simulink window to get multiple robots?
Also, would each robot have a different ip address? If so, how would I be able to have two ip addresses within one virtual machine?
Amrtanshu Raj
Amrtanshu Raj on 29 Sep 2020
No, you do not need 2 ip addresses. You will be having different topics for each robot. You can publish on each of the topic to get the desired results. It won't be a problem adding more than 1 robot to same gazebo world and simulating it from same simulink model.
For eg - robot1/left_wheel and robot2/left_wheel. Applying torque on first will move the first robot and on second will move the second robot.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!