ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

ROS2 Windows - rmw_implementation error when running examples

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

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

3 Answers

Sort by » oldest newest most voted
0

answered 2023-01-07 22:52:09 -0500

Hi,

I found another solution for by By Installation OpenSSL.

  1. Download and Install Win64 OpenSSL v1.1.1. Note: can find the MSI at bottom of the page
  2. setx -m OPENSSL_CONF "C:\Program Files\OpenSSL-Win64\bin\openssl.cfg"

Re-try: ros2 run demo_nodes_py listener

Result:

[INFO] [1673152950.727193900] [talker]: Publishing: "Hello World: 0" 
[INFO] [1673152951.569101000] [talker]: Publishing: "Hello World: 1"
[INFO] [1673152952.570804600] [talker]: Publishing: "Hello World: 2"
edit flag offensive delete link more
0

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

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

1

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 -0500 )edit

same problem around

Pablo Iñigo Blasco gravatar image Pablo Iñigo Blasco  ( 2022-09-26 19:49:55 -0500 )edit

same problem in humble, C:\ci came out of nowhere in the error message. Any luck solving this? @jhassold

smvaraprasad gravatar image smvaraprasad  ( 2023-01-13 23:20:21 -0500 )edit
0

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

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

Question Tools

1 follower

Stats

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

Seen: 3,164 times

Last updated: Jul 10 '20