ROS in Simulink never receive anything

3 次查看(过去 30 天)

I am having really hard time getting ROS in Simulink to receive any messages from a remote PC.

It never works in MatLab either but here's the rub:
I run
rosinit('111.111.0.8') % a sudo address for my remote running turtlebot3_fake
I then jump over to Simulink and create a model that looks like this:

I hit run and it is always zero. What am I doing wrong?

Cheers,

Coach

采纳的回答

Ameer Hamza
Ameer Hamza 2020-3-10
More specifically, you also need to set ROS_MASTER_URI and ROS_IP as specified in the mentioned link to connect to a remote master. Additionally, make sure that you can successfully ssh into the remote server.
  3 个评论
Clayton Allen
Clayton Allen 2020-3-11
I moved my install to a windows based PC and viola! I would like the MatLab folks to maybe consider this a bug.
Orginal install:
MacBookPro
OS Mojave
Ameer Hamza
Ameer Hamza 2020-3-11
It appears to be some issues with network configuration or the setting of environment variables. I am able to receive a message published by a node from an external server in MATLAB running on macOS Catalina, and I have previously done it on Mojave too.
The problem you mentioned: you are able to get the node list but cannot receive a message from a subscribed topic that happens when environment variables on the master server and MATLAB are not set properly. This link explains how to configure these variables: https://www.mathworks.com/matlabcentral/answers/119559-why-is-the-ros-subscriber-callback-in-matlab-not-triggered-when-messages-are-published-from-an-exter

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 ROS Network Access in MATLAB 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by