Unable to start ros2 node
조회 수: 21 (최근 30일)
이전 댓글 표시
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
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
답변 (1개)
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Custom Message Support에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!