Unable to start ros2 node
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Prabeen Sahu
am 8 Mai 2023
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
Antworten (1)
Prabeen Sahu
am 9 Mai 2023
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 Kommentare
Siehe auch
Kategorien
Mehr zu Custom Message Support finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!