Robotics StackExchange | Archived questions

Error while loading shared libraries: libtf2_ros.so

Could anyone please give me any clues to solve this?

/home/ariccspstk/catkinws/devel/lib/youbotdriverrosinterface/youbotdriverrosinterface: error while loading shared libraries: libtf2ros.so: cannot open shared object file: No such file or directory

[youbotdriver-2] process has died [pid 11656, exit code 127, cmd /home/ariccspstk/catkinws/devel/lib/youbotdriverrosinterface/youbotdriverrosinterface arm1/jointstates:=jointstates _name:=youbotdriver _log:=/home/ariccspstk/.ros/log/f583f8bc-27ad-11eb-8f01-54b203936f79/youbotdriver-2.log]. log file: /home/ariccspstk/.ros/log/f583f8bc-27ad-11eb-8f01-54b203936f79/youbotdriver-2*.log

This happens when I try to launch my bringup.launch file, I have tried sudo apt-get install libtf2-ros-dev but another issue appears:

The following packages have unmet dependencies: libtf2-ros-dev : Depends: python-tf2 but it is not going to be installed E: Unable to correct problems, you have held broken packages

then I tried to sudo apt-get install python-tf2, same thing happens for python-rospy python-roslib catkin python-catkin-pkg. But when I sudo install python-catkin-pkg, it shows:

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Asked by ariccspstk on 2020-11-15 21:05:28 UTC

Comments

Just about all the package name you mention are actually not part of ROS proper, but of the UpstreamPackages.

You may want to verify you actually have ROS Melodic installed.

Asked by gvdhoorn on 2020-11-16 12:45:13 UTC

@gvdhoorn Oh sorry for late reply, I've checked opt/ros/melodic and rosversion and they both exists.

I've also found out if I move libtf2_ros.so (I found it already downloaded in opt/ros/melodic/lib) to usr/lib, a new library error pops out. Could that be a path issue?

Asked by ariccspstk on 2020-11-17 21:42:41 UTC

There are no ROS libraries ever installed in /usr/lib.

And libtf2-ros-dev is not a ROS package, but an upstream package.

I'd really recommend you review what you have installed, as it would seem you've mixed and matched things, which may lead to some very strange problems.

Asked by gvdhoorn on 2020-11-18 10:16:33 UTC

Answers

I got the same error message (although in Noetic), and in my case the problem was caused by the system being unable to find the shared library, despite it being installed. I suspect it could be the same for you. I solved it by running sudo ldconfig /opt/ros/noetic/lib/. The problem is listed in a troubleshooting page of the Youbot Wiki, but unfortunately it doesn't easily come up on Google.

Asked by vbs on 2022-11-22 09:28:06 UTC

Comments