LoginSignup
3
0

More than 3 years have passed since last update.

ROS2 Windows版のexample実行時にエラーが出たらOpenSSLのバージョンを疑ってみる

Last updated at Posted at 2020-04-02

はじめに

公式ページのWindows版ROS2のバイナリ版インストール方法のページ(例えばInstalling ROS 2 Eloquent Elusor) を見ながらインストールしたのに、下記のようにexampleのtalkerとlistenerを実行するとrmw_fastrtps_cpp.dll という文字列が含まれたエラーが発生することがあります。

より詳細には、これらを実行すると、

> ros2 run demo_nodes_cpp talker
> ros2 run demo_nodes_py listener

こんなエラーメッセージが出力されまます。

Traceback (most recent call last):
  File "C:\dev\ros2_eloquent\lib\demo_nodes_py\listener-script.py", line 11, in <module>
    load_entry_point('demo-nodes-py==0.8.4', 'console_scripts', 'listener')()
  File "C:\dev\ros2_eloquent\Lib\site-packages\demo_nodes_py\topics\listener.py", line 32, in main
    rclpy.init(args=args)
  File "C:\dev\ros2_eloquent\Lib\site-packages\rclpy\__init__.py", line 73, in init
    return rclpy_implementation.rclpy_init(args if args is not None else sys.argv, context.handle)
RuntimeError: Failed to initialize init_options: failed to load shared library of rmw implementation. Exception: Cannot load library: C:\dev\ros2_eloquent\bin/rmw_fastrtps_cpp.dll, at C:\J\workspace\ci_packaging_windows\ws\src\ros2\rmw_implementation\rmw_implementation\src\functions.cpp:137, at C:\J\workspace\ci_packaging_windows\ws\src\ros2\rcl\rcl\src\rcl\init_options.c:55

確認すべきこと

上記のようなエラーが出たら、もう一度インストール方法のページを注意深く読みます。
そこにはこんな文章があります。

Install OpenSSL
Download an OpenSSL installer from this page. Scroll to the bottom of the page and download Win64 OpenSSL v1.0.2

ここで最も大事なのがOpenSSLのバージョン v1.0.2_ です。
OpenSSLのインストーラにはいくつかのバージョンが存在するのですが、v1.0.2 と書かれていたら、それに忠実に従う必要があります。

再挑戦

既にインストール済みのOpenSSLをアンインストールして、指定されたバージョンをインストールして、ついでに

setx -m OPENSSL_CONF C:\OpenSSL-Win64\bin\openssl.cfg

も念押しで実行して、再度talkerとlistenerを起動してみましょう。
どうでしょうか? 次のようなメッセージが出力されれば成功です。

> ros2 run demo_nodes_cpp talker
[INFO] [talker]: Publishing: 'Hello World: 1'
> ros2 run demo_nodes_py listener
[INFO] [listener]: I heard: [Hello World: 1]
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0