필터 지우기
필터 지우기

Unable to start ros2 node

조회 수: 13 (최근 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 CenterFile Exchange에서 Publishers and Subscribers에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by