ros2-for-unity icon indicating copy to clipboard operation
ros2-for-unity copied to clipboard

How to solve 'UnsatisfiedLinkError: librcl.so'?

Open phs4530 opened this issue 1 year ago • 3 comments

  • Ubuntu 22.04 - Humble
  • Unity 2020.3.6f1

Hello! Thank you for reading my question. I am planning to use ros2 using the strongalone version. However, the following error occurs. Is there a solution? Thank you for your reply in advance

-- image

image

phs4530 avatar Jun 07 '24 08:06 phs4530

This is really a show stopper for us, if anyone can help solve this, please update

omerts avatar Jun 20 '24 13:06 omerts

It looks like your ROS distro is not visible. In case of standalone version, ROS libraries should be shipped with the Unity package. Are you building from source, or using a release package?

adamdbrw avatar Jul 01 '24 12:07 adamdbrw

@adamdbrw I used: Ros2ForUnity_humble_standalone_ubuntu22.zip

omerts avatar Jul 04 '24 20:07 omerts

Unfortunately, our support for the project is very limited at the moment, as it just works for one project we use it for and all the other projects are on Open 3D Engine, much recommended as free Unity3D alternative

adamdbrw avatar Jul 06 '24 18:07 adamdbrw

Perhaps @pijaro could help you as he prepared the build

adamdbrw avatar Jul 06 '24 18:07 adamdbrw

The second error may be connected to the issue (calling get_data from non-main thread).

Can you confirm, that running everything from the main thread still throws the ROS 2 error?

pijaro avatar Jul 15 '24 09:07 pijaro

@omerts I found it resolved in the latest branch of ros2cs.

  • https://github.com/RobotecAI/ros2-for-unity/issues/78

However, the distribution version has not been updated yet.

phs4530 avatar Jul 25 '24 01:07 phs4530

I will also add a note regarding any (standalone or overlay) install that this may occur if ROS 2 isn't sourced properly. For one of our setups this happened even though ROS was installed and sourced in the rc.

A good approach in that case is to overload your unityhub.desktop file to source ROS 2 before launching unityhub. Or, launching unityhub manually through your terminal. I use ZSH as my shell, so this is how it looks for me:

[Desktop Entry]
Name=Unity Hub
Exec=zsh -c "source /opt/ros/humble/setup.zsh && /opt/unityhub/unityhub"
Terminal=false
Type=Application
Icon=unityhub
StartupWMClass=unityhub
Comment=The Official Unity Hub
Categories=Development;
TryExec=unityhub
MimeType=x-scheme-handler/unityhub;

robotasun avatar Jul 31 '25 09:07 robotasun