ubuntu中运行ros2节点,共享库libblas.so.3无法加载报错的问题解决

工作中需要调试新的摄像头,安装对应的驱动:

cindy@ubuntu:~/Downloads$ sudo dpkg -i ros-foxy-deptrum-ros-driver-stellar400_0.1.1-0focal_arm64.deb
[sudo] password for cindy:
Selecting previously unselected package ros-foxy-deptrum-ros-driver-stellar400.
(Reading database ... 242016 files and directories currently installed.)
Preparing to unpack ros-foxy-deptrum-ros-driver-stellar400_0.1.1-0focal_arm64.deb ...
Unpacking ros-foxy-deptrum-ros-driver-stellar400 (0.1.1-0focal) ...
Setting up ros-foxy-deptrum-ros-driver-stellar400 (0.1.1-0focal) ...
Setting-up permissions for Deptrum devices
selected_ros_version: foxy
Restarting udev
udev-rules successfully installed
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...

udev-rules successfully installed 驱动安装成功

但是运行ros2节点的时候出现了问题:

cindy@ubuntu:~/Downloads$ ros2 run deptrum-ros-driver node
/opt/ros/foxy/lib/deptrum-ros-driver/node: error while loading shared libraries: libblas.so.3: cannot open shared object file: No such file or directory

error while loading shared libraries: libblas.so.3: cannot open shared object file: No such file or directory

加载共享库libblas.so.3的时候报错,无法找到对应的共享库

在系统中搜索是否有对应的共享库:

cindy@ubuntu:~/Downloads$ sudo find / -name "libblas.so.3"
find: ‘/proc/2547/task/2547/net’: Invalid argument
find: ‘/proc/2547/net’: Invalid argument
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied
find: ‘/run/user/124/gvfs’: Permission denied
/usr/lib/aarch64-linux-gnu/atlas/libblas.so.3
/usr/lib/aarch64-linux-gnu/blas/libblas.so.3

可以看到在/usr/lib下面已经有安装,只是现在ros2节点无法找到

问题解决:

执行:
export LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu/blas:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu/atlas:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu/lapack:$LD_LIBRARY_PATH

export一个全局变量LD_LIBRARY_PATH, 然后运行程序的时候就会去这个目录中找共享库.

LD_LIBRARY_PATH的意思是告诉loader在哪些目录中可以找到共享库.

ps:

以上是针对我自己的系统,如果有其他x86系统的问题,只需要针对自己的环境做一些修改,改为和x86适配的环境即可

先执行:
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/blas:$LD_LIBRARY_PATH
再执行:
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/atlas:$LD_LIBRARY_PATH

你可能感兴趣的:(ROS2,ROS,camera,ubuntu,linux,ros,ros2,人工智能,机器人,camera)