ROS2 Galactic nodes not shown in Matlab

I have multiple Ubuntu PCs running on a LAN. They all run ROS2 Galactic and can exchage topics withot any issues.
A windows PC on the same LAN with Matlab 2022a dooes not find any nodes or topics.
I made sure everything is on the same subnet and all PCs have the same ROS_DOMAIN_ID set. I also walked through the troubleshooting instructions https://de.mathworks.com/matlabcentral/answers/497662-trying-to-connect-to-an-active-node-ros2 with no success.
Is ROS2 Galactic supported and expected to work with Matlab 2022a?
Thanks!

 Accepted Answer

I think I can answer my own question: as an experiment, I installed ROS2 Foxy on one of the remote Ubuntu PCs and published a topic from Foxy. Matlab will list that topic and subscribe to it with no issue. Apparently Matlab does not support ROS2 Galactic.
New question: Is there a workaround to get Matlab to talk to Galactic?

6 Comments

Foxy used FastDDS (supported by R2022a), Galactic uses Cyclone DDS by default.
Manually selecting FastDDS on the ROS2 Galactic installation makes it discoverable by Matlab R2022a:
# on the ROS2 Galactic installation
export RMW_IMPLEMENTATION="rmw_fastrtps_cpp"
Hello Sebastian,
I haven't experimented with Galactic myself yet. If the cross-DDS middleware communication is the cause of the issue, you can also try the steps listed here to use Foxy in MATLAB with Cyclone DDS, if you wanted to keep using Cyclone DDS with Galactic.
-Cam
@Sebastian Brückner Did you try @Cam Salzberger's suggestions? Were you able to get it working with Galactic? I am trying to decide which version of ROS 2 to install on my machine.
Hi Michael, I did not try changing the DDS on the Matlab side but instead changed it on the ROS2 side. See my comment above https://de.mathworks.com/matlabcentral/answers/1668689-ros2-galactic-nodes-not-shown-in-matlab#comment_2033004
With that change, I have Matlab and ROS2 talking flawlessly.
Michael
Michael on 2 Jun 2022
Edited: Michael on 2 Jun 2022
@Sebastian Brückner FYI, I've got ROS2 Galactic installed on my target machine (Ubuntu) and it seems to be talking fine to nodes that run on my Mac within the Matlab Environement.
UPDATE: It seems my Galactic install can see the Matlab generated nodes on the network, but can't see the Matlab services. I just tied changing the matlab cross-DDS middleware which didn't help. I also tried changing it on the Galactic install per your suggestion with no luck.
Can you confirm that you are able able to see both the Matlab generated nodes and services?
Hi,have you ever tried to make Matlab2021 and ROS2(Galactic) talking successfully?

Sign in to comment.

More Answers (0)

Products

Release

R2022a

Community Treasure Hunt

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

Start Hunting!