Co-simulation between Simulink and Gazebo with ROS 2: How to include GazeboPlugin in a launch file?

조회 수: 12 (최근 30일)
Hi,
I want to co-simulate this robot developed in ROS 2 with Simulate (control) and Gazebo (visual). Just in case, I'm using Ubuntu 18.04 running ROS Melodic and ROS 2 Dashing.
I've successfully co-simulated the UR10 robot with ROS following the tutorial of MathWorks: Control Manipulator Robot with Co-Simulation in Simulink and Gazebo.
However, I'm wondering how could be done this with ROS 2 and with a robot containing a more complex architecture (.launch instead of .world). I've seen here that the GazeboPlugin is available in C++, but I'm not sure about how to integrate it to the .launch of the existent project.
Any help is welcome.
Jon

답변 (1개)

Gaurav Bhosale
Gaurav Bhosale 2022년 5월 20일
편집: Gaurav Bhosale 2022년 5월 20일
Hi Jon,
In the VM, the plugin location is /home/user/src/GazeboPlugin/
The Plugin C++ code is located at /home/user/src/GazeboPlugin/src/gazeboplugin/GazeboPlugin.cpp
You can refer Gazebo Co-Sim tutorial.
Further, .launch file should include .world file and respective .world file should contain <plugin> details.
To integrate Gazebo Co-Sim plugin, you need add <plugin> details in the .world file as mentioned in this example.
<plugin name="GazeboPlugin" filename="lib/libGazeboCoSimPlugin.so"><portNumber>14581</portNumber></plugin> [ Relative Path - if Gazebo launched from /home/user/src/GazeboPlugin/export/ ]
OR
<plugin name="GazeboPlugin" filename="/home/user/src/GazeboPlugin/export/lib/libGazeboCoSimPlugin.so"><portNumber>14581</portNumber></plugin> [ Absolute Path ]
Thanks.
  댓글 수: 1
Jon Aztiria
Jon Aztiria 2022년 5월 25일
Thanks for the answer @Gaurav Bhosale. However, I would need a more detailed guide to integrate it to the mentioned robot with a ROS 2 launch file, but don't worry, it's not extremely necessary for me right now. Thanks again!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Network Connection and Exploration에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by