「MacOSとROS 2のインストール」で方法を詳しく書いてくれているので、簡単に動くかと思ったけど、こちらもハマる。
色々調べてなんとか、talkerデモノード、listenerデモノードの起動までできた。
問題1: talkerデモノード起動で、libPocoFoundation.60.dylibがロードできないと言われる。
Failed to load entry point 'test': dlopen(/Users/sato/ros2_install/ros2-osx/lib/python3.7/site-packages/rclpy/_rclpy.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/poco/lib/libPocoFoundation.60.dylib Referenced from: /Users/sato/ros2_install/ros2-osx/lib/librosidl_typesupport_c.dylib Reason: image not found
シンボリックリンクを設定して、暫定解決。(pecoのバージョンを見直したほうがいい?)
ln -s /usr/local/opt/poco/lib/libPocoFoundation.62.dylib /usr/local/opt/poco/lib/libPocoFoundation.60.dylib
問題2: talkerデモノード起動で、libtinyxml2.6.dylibがロードできないと言われる。
Failed to load entry point 'test': dlopen(/Users/sato/ros2_install/ros2-osx/lib/python3.7/site-packages/rclpy/_rclpy.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/opt/tinyxml2@6.2.0/lib/libtinyxml2.6.dylib Referenced from: /Users/sato/ros2_install/ros2-osx/lib/libbuiltin_interfaces__rosidl_typesupport_fastrtps_c.dylib Reason: image not found
どこか忘れたけど、海外の記事を参考に次の内容で解決
brew remove tinyxml2 brew install osrf/simulation/tinyxml2@6.2.0 brew link --force tinyxml2@6.2.0
問題3: colconコマンドがないと言われる
手順を見落としてたかな?pipでインストールして解決。(-Uはアップグレードオプション)
pip3 install -U colcon-common-extensions
問題4: colcon build実行時にcmakeが見つからないと言われる
cmakeを入れて解決
brew install cmake
問題5: colcon build実行時にconsole_bridge関連のパッケージが見つからないと言われる
--- stderr: examples_rclcpp_minimal_composition CMake Error at /Users/sato/ros2_install/ros2-osx/share/class_loader/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package): By not providing "Findconsole_bridge.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "console_bridge", but CMake did not find one. Could not find a package configuration file provided by "console_bridge" with any of the following names: console_bridgeConfig.cmake console_bridge-config.cmake Add the installation prefix of "console_bridge" to CMAKE_PREFIX_PATH or set "console_bridge_DIR" to a directory containing one of the above files. If "console_bridge" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): /Users/sato/ros2_install/ros2-osx/share/class_loader/cmake/class_loaderConfig.cmake:38 (include) CMakeLists.txt:14 (find_package)
console_bridgeを入れたら解決
brew install console_bridge
ここまでやって、やっと動いた。。。
環境:
macOS Mojave(10.14.5)