Cannot echo Topics from Simulink in ROS on WSL2
Show older comments
I'm troubling in connecting Simulink and Unreal Engine through ROS on WSL2.
I want to send some messages from Simulink to UE (ROS Integration) using ROS Topics, but the topics from Simulink cannot be subscribed. (Actually the topic itself is subscribed, but no message is coming.)
My environment is as follows:
- MATLAB R2024a + ROS Toolbox
- Unreal Engine 5.1.1 (+ ROS Integration)
- Ubuntu 20.04 on WSL2
- ROS Noetic
I have confirmed the ROS communications below:
- Simulink to the same Simulink: succes
- Simulink to the other Simulink on the same computer: partly success (✔A→B, while ✘B→A. I suspected that the same port cannot be used for both publishing and subscribing, but alternating their roles did not work.)
- Simulink to ROS: failed (The topics can be found by rostopic list, but I couldn't rostopic echo.)
- Simulink to UE: failed
- UE to ROS: success (only String messages)
- UE to Simulink: success (only String messages)
Regarding to the rostopic list, the rosnode info /SimulinkSystem_xxxxx (the node created by Simulink) response says that the connection to the node is failed.
I searched for the similar issues on internet and it may be caused by that the hostname cannot be resolved by ROS.
I have tried to set the environment variables so that they are not "localhost" nor "127.0.0.1", but it did not work. (When doing it, I could not connect to the ROS master.)
Could anyone figure out what is the true problem(s), and how to solve it?
Thank you
Accepted Answer
More Answers (1)
Nishan Nekoo
on 12 Jun 2024
0 votes
Hi Nakanishi, MATLAB offers a tight integration with the Unreal Engine through Simulink 3D Animation that offers deterministic simulation and shared memory for data exchange. In particular, you can use Simulation 3D Message Set and Simulation 3D Message Get blocks to exchange custom data between Simulink and Unreal Engine.
Is there any reason you need a ROS interface specifically? Are there other nodes besides Simulink and Unreal Engine?
Nishan
1 Comment
NAKANISHI
on 12 Jun 2024
Categories
Find more on ROS Network Access in Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!