Ask Your Question
0

ROS2 Windows - rmw_implementation error when running examples

asked 2020-07-09 10:39:10 -0600

jhassold gravatar image

I have been trying to install ROS 2 from binary onto Windows by following these instructions. When on the step to run the examples, the C++ talker exits silently, while the Python listener raises the following exception:

C:\Users\Testing>call "C:\dev\ros2_foxy\local_setup.bat"
[connext_cmake_module] Warning: The location at which Connext was found when the workspace was built [[C:\Program Files\rti_connext_dds-5.3.1]] does not point to a valid directory, and the NDDSHOME environment variable has not been set. Support for Connext will not be available.

C:\Users\Testing>ros2 run demo_nodes_py listener
Traceback (most recent call last):
  File "C:\dev\ros2_foxy\lib\demo_nodes_py\listener-script.py", line 11, in <module>
    load_entry_point('demo-nodes-py==0.9.3', 'console_scripts', 'listener')()
  File "C:\dev\ros2_foxy\Lib\site-packages\demo_nodes_py\topics\listener.py", line 32, in main
    rclpy.init(args=args)
  File "C:\dev\ros2_foxy\Lib\site-packages\rclpy\__init__.py", line 71, in init
    return context.init(args)
  File "C:\dev\ros2_foxy\Lib\site-packages\rclpy\context.py", line 59, in init
    rclpy_implementation.rclpy_init(args if args is not None else sys.argv, capsule)
RuntimeError: Failed to initialize init_options: failed to load shared library of rmw implementation: C:\dev\ros2_foxy\bin/rmw_fastrtps_cpp.dll Exception: LoadLibrary error: 126, at C:\ci\ws\src\ros2\rcutils\src\shared_library.c:72, at C:\ci\ws\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:64, at C:\ci\ws\src\ros2\rcl\rcl\src\rcl\init_options.c:55

Running ros2 node list generates a related sort of error:

C:\Users\Testing>ros2 node list
Unable to get rmw_implementation_identifier, try specifying the implementation to use via the 'RMW_IMPLEMENTATION' environment variable

I used DependencyWalker to see if anything was missing for the rmw_fastrtps_cpp.dll file, and it looks like several core Windows files are missing, such as API-MS-WIN-CORE-APIQUERY-L1-1-0.DLL, API-MS-WIN-CORE-APIQUERY-L1-1-1.DLL, API-MS-WIN-CORE-APPCOMPAT-L1-1-0.DLL, and many others. I was assuming these files should have been provided by one of the steps in the installation instructions. Am I wrong?

Has anyone found a fix for this? I need this to work so that I can test that ROS 2 code I develop will work on Windows installations.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2021-06-25 17:56:38 -0600

This solution on GitHub from worked for me when having the same problem that @jhassold reported after following the "Installing ROS 2 on Windows" instructions linked in the original question. Here is a direct link to the install instructions that succeeded.

edit flag offensive delete link more
0

answered 2020-07-10 04:05:04 -0600

ahcorde gravatar image

Hello,

the following error said that you don't have defined the RMW_IMPLEMENTATION enviroment variable. Try to setup this variable to rmw_fastrtps_cpp or rmw_cyclonedds_cpp.

C:\Users\Testing>ros2 node list Unable to get rmw_implementation_identifier, try specifying the implementation to use via the 'RMW_IMPLEMENTATION' environment variable

I think in Windows is something like:

set RMW_IMPLEMENTATION rmw_fastrtps_cpp

edit flag offensive delete link more

Comments

Setting the variable to rmw_fastrtps_cpp creates the following error:

C:\Users\Testing>ros2 node list
[ERROR] [1594380578.894136200] [rcl]: Error getting RMW implementation identifier / RMW implementation not installed (expected identifier of 'rmw_fastrtps_cpp'), with error message 'failed to load shared library of rmw implementation: C:\dev\ros2_foxy\bin/rmw_fastrtps_cpp.dll Exception: LoadLibrary error: 126, at C:\ci\ws\src\ros2\rcutils\src\shared_library.c:72, at C:\ci\ws\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:64', exiting with 1.

The directory C:\ci does not appear to exist when I try to locate it in the filesystem. Is this a directory that should have been created sometime in the install process? Did I miss a step in the install process, or are the instructions missing something?

jhassold gravatar image jhassold  ( 2020-07-10 06:37:52 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-07-09 10:39:10 -0600

Seen: 511 times

Last updated: Jul 10 '20