MATLAB Answers

ROS Subscriber in Simulink does not seem to receive data

8 ビュー (過去 30 日間)
Angel Paredes
Angel Paredes 2021 年 7 月 18 日
回答済み: Cam Salzberger 2021 年 7 月 19 日
I have connected Simulink on a computer, with ROS on another one through a tcp/ip interconnection using the ROS publisher and subscriber blocks. The connection is successful and I am able to send information to ROS through the publisher block.
The problem is the only way I have received data from the subscriber block is when I read data from the same topic I am writing (with the publisher block), all the other topics give a blank message despite I have done an "echo" on the PC running ROS and they are not empty.
I selected the topic source from the ros network and also tried to specify my own. Furthermore, I used a virtual machine before testing it on two diffetent PC's and have te same issue.
I am runing Matlab 2021a on Ubuntu 16.04 and ROS Melodic on Ubuntu 18.04.

回答 (1 件)

Cam Salzberger
Cam Salzberger 2021 年 7 月 19 日
Hello Angel,
This is likely to be caused by the publisher on the ROS machine not having the ROS_IP environment variable set or set correctly. Please see this answer for details.
-Cam

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by