Hi, I am setting up ROS2 Bouncy on Windows10 and already encountered the following problem while compiling from source: ROS2 fails to build many packages on Windows 10, which I solved.
EDIT: I found this question to be the same issue.
Now, my code compiles and I want to test the examples. But when I run the talker example node, it gives me this output:
cd \dev\ros2
call install\local_setup.bat
ros2 run demo_nodes_py talker
>>> [rcutils|error_handling.c:155] rcutils_set_error_state()
This error state is being overwritten:
'failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135'
with this new error message:
'failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135'
rcutils_reset_error() should be called after error handling to avoid this.
<<<
With the error message above repeating many times...
>>> [rcutils|error_handling.c:155] rcutils_set_error_state()
This error state is being overwritten:
'failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135'
with this new error message:
'failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135'
rcutils_reset_error() should be called after error handling to avoid this.
<<<
Traceback (most recent call last):
File "C:\dev\ros2\install\lib\demo_nodes_py\talker-script.py", line 11, in <module>
load_entry_point('demo-nodes-py==0.5.1', 'console_scripts', 'talker')()
File "C:\dev\ros2\install\Lib\site-packages\demo_nodes_py\topics\talker.py", line 39, in main
rclpy.init(args=args)
File "C:\dev\ros2\install\Lib\site-packages\rclpy\__init__.py", line 27, in init
args if args is not None else sys.argv)
RuntimeError: Failed to init: failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135, at c:\dev\ros2\src\ros2\rcl\rcl\src\rcl\rcl.c:92
EDIT: The exact same output is generated when I use demo_nodes_cpp
. Also, when writing my own simple publisher in python, I get this error as well.
My rmw_implementation as well as all other packages (except for connext-related ones) compiled without error. Also, I find the rmw_fastrtps_cpp.dll
in the given path (C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll
). (It bugs me, that the path has mixed forward and backslashes.)
Maybe, I missed something in my setup? EDIT: Does this have to do with environment variables? If so, is there a list of variables which should be set?
EDIT: I managed to isolate the error to the ros init call:
def main(args=None):
rclpy.init(args=args) # error produced by this line of code
...
So somehow, when calling rlcpy.init()
, the rmw_fastrtps_cpp
dll fails to load. But why? Is there a connection to using OpenSplice
?
EDIT: Even when calling
ros2 topic pub /chatter std_msgs/String "data: Hello world"
from command line, the following (similar) error occurs:
...
>>> [rcutils|error_handling.c:155] rcutils_set_error_state()
This error state is being overwritten:
'failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135'
with this new error message:
'failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135'
rcutils_reset_error() should be called after error handling to avoid this.
<<<
Failed to init: failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2\install\bin/rmw_fastrtps_cpp.dll, at c:\dev\ros2\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:135, at c:\dev\ros2\src\ros2\rcl\rcl\src\rcl\rcl.c:92
I use OpenSplice 6.7, MS Visual Studio 2017 (v15.7.6), Python 3.7, Qt5 5.10.0 (but I have also installed 5.10.1, 5.11.0, 5.11.1) colcon:
colcon-cmake 0.2.3: up-to-date
colcon-core 0.3.9: up-to-date
colcon-defaults 0.2.0: up-to-date
colcon-devtools 0.2.1: up-to-date
colcon-library-path 0.2.0: up-to-date
colcon-metadata 0.2.0: up-to-date
colcon-notification 0.2.5: up-to-date
colcon-output 0.2.2: up-to-date
colcon-package-information 0.2.1: up-to-date
colcon-package-selection 0.2.0: up-to-date
colcon-parallel-executor 0.2.2: up-to-date
colcon-pkg-config 0.1.0: up-to-date
colcon-powershell 0.3.3: up-to-date
colcon-python-setup-py 0.2.0: up-to-date
colcon-recursive-crawl 0.2.0: up-to-date
colcon-ros 0.3.3: up-to-date
colcon-test-result 0.3.0: up-to-date
Originally posted by Marcel Usai on ROS Answers with karma: 200 on 2018-08-31
Post score: 0