필터 지우기
필터 지우기

Why am I unable to create a ROS2 node on Windows 10?

조회 수: 17 (최근 30일)
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
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개)

카테고리

Help CenterFile Exchange에서 Network Connection and Exploration에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by