How to subscribe topic from gazebo by using the "gazebo subscribe block" in simulink

2 ビュー (過去 30 日間)
shengqi xu
shengqi xu 2021 年 3 月 1 日
回答済み: Gaurav Bhosale 2021 年 3 月 15 日
Gazebo (Ubuntu 18.04, gazebo-9) connect Simulink(matlab2020b) correctly!
then i used "gz topic -l", i could see all the topic in gazebo, means the topic have been published.
Connectin between ubuntu and matlab correctly, then i try to follow the tutorial: use "gazebo read block" to read GazeboPlugin msgs, that ok!
but if i use "gazebo subscribe block" , there was no topic that i could choose, when i clic on "select", it shows no topic could subscribe...?
very urgent, please help meto figure out this question!!! Is it the issues of version of ubuntu or gazebo? or code? used google protobuf 3.0.0
thanks in advance !

回答 (1 件)

Gaurav Bhosale
Gaurav Bhosale 2021 年 3 月 15 日
Hi shengqi,
The Gazebo Subscribe block is designed for Custom Message Support. Basically, other than built-in support ( Read Block ), you can subscribe other topic from Gazebo to Simulink. To do that, you need to first define your own message or use Gazebo Msgs support provided in gazebogenmsg support
>> help gazebogenmsg
Once, you build required dependecies with 'gazebogenmsg' for specific cutom message, then you need to create plugin .zip with generated custom source path. Further, you need to copy and build plugin on VM.
In similar way, Gazebo Publish block, publish message on Gazebo from Simulink.
Thanks.

カテゴリ

Help Center および File ExchangeGazebo Co-Simulation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by