0
$\begingroup$

Rosanswers logo

Hi,

I am trying to install ROS 2 on my Mac with this tutorial: https://docs.ros.org/en/foxy/Installation/macOS-Install-Binary.html

MacOS: Big Sur 11.5.2 ROS2 Foxy Patch Release 4

When I execute:

ros2 run demo_nodes_cpp talker

I get this RCL error:

libc++abi: terminating with uncaught exception of type rclcpp::exceptions::RCLError: failed to initialize rcl init options: failed to load shared library of rmw implementation: /Users/nayanpradhan/ros2_foxy/ros2-osx/lib/librmw_fastrtps_cpp.dylib Exception: LoadLibrary error: dlopen(/Users/nayanpradhan/ros2_foxy/ros2-osx/lib/librmw_fastrtps_cpp.dylib, 1): Library not loaded: /usr/local/opt/tinyxml2/lib/libtinyxml2.8.dylib
Referenced from: /Users/nayanpradhan/ros2_foxy/ros2-osx/lib/librmw_fastrtps_cpp.dylib Reason: image not found, at /Users/osrf/jenkins-agent/workspace/ci_packaging_osx/ws/src/ros2/rcutils/src/shared_library.c:84, at /Users/osrf/jenkins-agent/workspace/ci_packaging_osx/ws/src/ros2/rmw_implementation/rmw_implementation/src/functions.cpp:64, at /Users/osrf/jenkins-agent/workspace/ci_packaging_osx/ws/src/ros2/rcl/rcl/src/rcl/init_options.c:61

In general, sourcing also gives the warning:

[connext_cmake_module] Warning: The location at which Connext was found when the workspace was built [[/Applications/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.

How can I fix these errors/warning???

Thanks!


Originally posted by nayan on ROS Answers with karma: 26 on 2021-08-21

Post score: 1


Original comments

Comment by victra on 2021-10-05:
Hey Nayan, did you manage to solve this problem? I have the same problem myself

Comment by Sensenzhl on 2021-12-10:
I meet this problem too. Is there any available solution right now?

Comment by wgrand on 2021-12-23:
@Sensenzhl, were you able to get ROS2 working on macOS?

Comment by Sensenzhl on 2022-01-01:
I have installed ROS2 working, but still leave this problem unsolved

Comment by wgrand on 2022-01-04:
My conclusion is to run Ubuntu on a USB stick and call it a day. At the time of this writing, ROS supports macOS Mojave, which was released in 2018. Now it is 2022. So, it is not worth forcing ROS to run on macOS.

Comment by Sensenzhl on 2022-01-04:
Thanks for your reply. I've tried the method you mentioned that downgrading tinyxml2 to 2.8. The version I use now is tinyxml2 version 2.9. But it seems that tinyxml2.8 is not compatible with macOS Big Sur, it can only be used on macOS Catalina. Is there any method to deal with this?

Comment by wgrand on 2022-01-05:
My conclusion is that it is too tedious on macOS to ensure that all packages are the proper versions. I suggest using Ubuntu instead.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

did you try . ~/ros2_foxy/ros2-osx/setup.bash before you test that one?

If so, try to re-install and be sure you are on foxy

Updated (1/18/22): Answered by @chrisfromsoftware

Answer: Same problem for me as well, on macOS Mojave. I resolved my problem by following this example and downgrading my tinyxml2 to 2.8: https://gist.github.com/talal/1b8d0c11338dc9ab79b2386309828894

The git hash I used for the formula was: 1592a31d0be73d01943e729d98aab4e494ca4351


Originally posted by kak13 with karma: 113 on 2021-08-23

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by wgrand on 2021-12-23:
I have the same issue as @nayan. And yes, I ran . ~/ros2_foxy/ros2-osx/setup.bash. If you look carefully at the error, you see that it is trying to load tinyxml2 version 2.8, which does not install when you follow the steps specified on https://docs.ros.org/en/foxy/Installation/macOS-Install-Binary.html. If you look in that directory, as of December 2021, you will see that tinyxml2 version 2.9 is installed. (I am on macOS 12.1 Monterrey.)

Comment by chrisfromsoftware on 2021-12-23:
Same problem for me as well, on macOS Mojave. I resolved my problem by following this example and downgrading my tinyxml2 to 2.8: https://gist.github.com/talal/1b8d0c11338dc9ab79b2386309828894

The git hash I used for the formula was: 1592a31d0be73d01943e729d98aab4e494ca4351

Comment by wgrand on 2021-12-25:
I see in the ROS documentation that they are supporting macOS Mojave. But Mojave is just over 3 years old. What is the motivation to keep legacy OS?

Comment by wgrand on 2021-12-28:
Thanks @chrisfromsoftware. Downgrading tinyxml2 to 2.8 worked. Maybe you should post this as an answer!

Comment by Karax on 2022-01-18:
@chrisfromsoftware tip did the trick for me too. Currently running on macOS Monterey 12.1 (Intel).

Comment by Zeitgeist on 2022-04-05:
@Karax Can you please help with this? I have the same hardware. But i steel not understand how we need change this https://gist.github.com/talal/1b8d0c11338dc9ab79b2386309828894 to downgrading tinyxml2 to 2.8. Can you please describe it in details. Thanks.

Comment by märve on 2022-04-15:
@Zeitgeist here the steps to downgrade to 2.8

cd "$(brew --repo homebrew/core)"
git checkout -b tinyxml2-2.8 1592a31d0be73d01943e729d98aab4e494ca4351
brew unlink tinyxml2
HOMEBREW_NO_AUTO_UPDATE=1 brew install tinyxml2
brew pin tinyxml2
git checkout master
git branch -d tinyxml2-2.8
brew cleanup && brew prune

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.