Unable to start ros2 node

26 ビュー (過去 30 日間)
Bert Van Acker
Bert Van Acker 2023 年 5 月 4 日
回答済み: Prabeen Sahu 2023 年 5 月 9 日
I'm unable to start a ros2 node on Matlab 2022a running on Windows 10.
Error indicates that the lib,wros2server cannot be launched. How can this be solved?
>> ros2node('/test1')
Error using ros2node/createNode
Error creating the ROS 2 node /test1.
Error in ros2node (line 129)
createNode(obj, parser.Results.name, parser.Results.id);
Caused by:
Error using ros.internal.Node/create
Server failed to start. Details: Unable to launch Simple server: Unable to launch C:\Program
Files\MATLAB\R2022a\toolbox\ros\bin\win64\libmwros2server.exe
because: Unable to launch Simple server: Unable to launch server: initialization failed
  2 件のコメント
Prabeen Sahu
Prabeen Sahu 2023 年 5 月 8 日
Hello Bert,
The error message you mentioned occurs when MATLAB cannot start the "ibmwros2server.exe" executable, which is responsible for launching the ROS2 node. This issue is typically caused by conflicting environment variables.
Please close MATLAB and reopen from a fresh command prompt and then try creating ROS 2 node. By restarting MATLAB from a newly opened command prompt, you can ensure that any conflicting environment variables are cleared, which should help in successfully creating the ROS 2 node.
If you're still encountering the same problem, please run the following command in MATLAB and share the resulting file with us. This will assist in further investigating the issue.
>>ros.internal.generateSupportFile
-Prabeen
Bert Van Acker
Bert Van Acker 2023 年 5 月 8 日
Hello,
I tried to restart MATLAB but this does not solve the issue.
In attachment the support log.
Thanks in advance

サインインしてコメントする。

回答 (1 件)

Prabeen Sahu
Prabeen Sahu 2023 年 5 月 9 日
Hi Bert,
Based on the attached support file, it appears that the 'RMW_IMPLEMENTATION' environment variable is currently set to 'rmw_fastrtps_cp', which is incorrect. The correct value for this variable should be 'rmw_fastrtps_cpp', which uses the default DDS as FAST DDS.
To correct this issue, please use the following command to set the RMW_IMPLEMENTATION environment variable to the correct value:
setenv('RMW_IMPLEMENTATION','rmw_fastrtps_cpp')
Alternatively, you can simply unset the RMW_IMPLEMENTATION environment variable using the following command:
setenv('RMW_IMPLEMENTATION','')
This will remove the RMW_IMPLEMENTATION environment variable and allow the system to automatically use the default RMW implementation which is 'rmw_fastrtps_cpp'.
After making above change please start the ROS 2 node and let us know if you still face any issues.
-Prabeen

カテゴリ

Help Center および File ExchangePublishers and Subscribers についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by