Why am I unable to create a ROS2 node on Windows 10?
17 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2020 年 11 月 5 日
編集済み: MathWorks Support Team
2021 年 9 月 22 日
I am trying to follow the "Get Started with ROS 2" tutorial below:
However, I get an error when running the first command of the tutorial:
>> test1 = ros2node("/test1")
Error using ros2node/createNode (line 319)
Error creating the ROS 2 node /test1.
Error in ros2node (line 119)
createNode(obj, parser.Results.name, parser.Results.id);
採用された回答
MathWorks Support Team
2021 年 9 月 22 日
編集済み: MathWorks Support Team
2021 年 9 月 22 日
The above error message may be caused by certain paths being present in your PATH variable, and/or other environment variables set on your system. For example, if a native ROS 2 installation is present, there might be a library conflict between it and MATLAB's ROS 2 libraries.
PATH variable:
As a first step, inspect the value of your PATH environment variable by entering the following command at the MATLAB Prompt:
>> getenv('PATH')
The idea is to remove potentially problematic paths from PATH within MATLAB. In particular, remove entries such as:
C:\Program Files\rti_connext_dds-6.0.0\lib\x64Win64VS2015;
C:\WINDOWS\System32\OpenSSH\;
C:\OpenSSL-Win64\bin\;
C:\dev\ros2\Scripts;
C:\dev\ros2\bin;
C:\Program Files\Docker\Docker;
C:\Program Files\Docker\Docker\resources\bin;
C:\ProgramData\DockerDesktop\version-bin;
C:\OpenSSL-Win64\bin\;
To set a new PATH environment variable for your MATLAB session, use the following comands:
% minimum example of a new PATH variable
>> newpath = 'C:\Program Files\MATLAB\R2020b\bin\win64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\PROGRA~1\MATLAB\R2020b\bin;C:\Users\myUser\AppData\Local\Microsoft\WindowsApps;';
>> setenv('PATH', newPath)
>> ros2node('/test1')
Other environment variables:
If shortening PATH within MATLAB does not help, look out for other environment variables that may interfere with ROS 2 libraries, such as RMW_IMPLEMENTATION.
Enter the following command at the MATLAB Prompt to get a list of all set enviroment variables:
>> system('set')
If you find RMW_IMPLEMENTATION in this list, you can unset it in MATLAB by using the following command:
>> setenv('RMW_IMPLEMENTATION','')
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Network Connection and Exploration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!