-
系统软件版本:2.0.0
-
问题涉及的技术领域: 其他
-
问题描述:只有root用户能运行tros和ros2程序,其他用户运行程序会报无法加载"librclcpp.so或librclpy_common.so"
-
复现概率:必现、已进行的排查措施、分析及结果:
-
安装官方额ROS2版本,也存在相同的问题
-
用ldd命令检查库的依赖,没发现问题,如果有问题,root用户应该也不能正常运行
-
发现很多so没有可执行属性,对/lib、/usr/lib、/opt/ros/lib下的库文件增加了可执行属性,问题依旧
-
检查各种PATH的环境变量,灭有发现问题。
-
提供必要的问题日志:
```
root@ubuntu:~# ros2 launch hobot_codec hobot_codec.launch.py
-bash: ros2: command not found
root@ubuntu:~# source /opt/tros/setup.bash
root@ubuntu:~# ros2 launch hobot_codec hobot_codec.launch.py
[INFO] [launch]: All log files can be found below /root/.ros/log/2023-05-31-04-11-24-067690-ubuntu-4397
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [hobot_codec_republish-1]: process started with pid [4399]
[hobot_codec_republish-1] [ERROR] [1685477490.452683457] [HobotCodecNode]: Hobot_Codec has not received image for more than 5 seconds! Please check whether the image publisher still exists by ‘ros2 topic info /image_jpeg’!
[hobot_codec_republish-1] [ERROR] [1685477495.452552293] [HobotCodecNode]: Hobot_Codec has not received image for more than 5 seconds! Please check whether the image publisher still exists by ‘ros2 topic info /image_jpeg’!
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[INFO] [hobot_codec_republish-1]: process has finished cleanly [pid 4399]
root@ubuntu:~# su - sunrise
To run a command as administrator (user “root”), use “sudo ”.
See “man sudo_root” for details.
sunrise@ubuntu:~$ ros2 launch hobot_codec hobot_codec.launch.py
-bash: ros2: command not found
sunrise@ubuntu:~$ source /opt/tros/setup.bash
sunrise@ubuntu:~$ ros2 launch hobot_codec hobot_codec.launch.py
[INFO] [launch]: All log files can be found below /home/sunrise/.ros/log/2023-05-31-04-12-09-819368-ubuntu-4487
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name=‘Task-2’ coro=<LaunchService._process_one_event() done, defined at /opt/tros/lib/python3.8/site-packages/launch/launch_service.py:226> exception=InvalidLaunchFileError(‘py’)>
Traceback (most recent call last):
File “/opt/tros/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py”, line 53, in get_launch_description_from_any_launch_file
return loader(launch_file_path)
File “/opt/tros/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_file_utilities.py”, line 62, in get_launch_description_from_python_launch_file
launch_file_module = load_python_launch_file_as_module(python_launch_file_path)
File “/opt/tros/lib/python3.8/site-packages/launch/launch_description_sources/python_launch_file_utilities.py”, line 37, in load_python_launch_file_as_module
loader.exec_module(mod)
File “<frozen importlib._bootstrap_external>”, line 848, in exec_module
File “<frozen importlib._bootstrap>”, line 219, in _call_with_frames_removed
File “/opt/tros/share/hobot_codec/launch/hobot_codec.launch.py”, line 18, in
from launch_ros.actions import Node
File “/opt/tros/lib/python3.8/site-packages/launch_ros/__init__.py”, line 17, in
from . import actions
File “/opt/tros/lib/python3.8/site-packages/launch_ros/actions/__init__.py”, line 17, in
from .composable_node_container import ComposableNodeContainer
File “/opt/tros/lib/python3.8/site-packages/launch_ros/actions/composable_node_container.py”, line 25, in
from .node import Node
File “/opt/tros/lib/python3.8/site-packages/launch_ros/actions/node.py”, line 57, in
from rclpy.validate_namespace import validate_namespace
File “/opt/tros/lib/python3.8/site-packages/rclpy/validate_namespace.py”, line 16, in
from rclpy.impl.implementation_singleton import rclpy_implementation as _rclpy
File “/opt/tros/lib/python3.8/site-packages/rclpy/impl/implementation_singleton.py”, line 31, in
rclpy_implementation = _import(‘._rclpy’)
File “/opt/tros/lib/python3.8/site-packages/rclpy/impl/__init__.py”, line 28, in _import
return importlib.import_module(name, package=‘rclpy’)
File “/usr/lib/python3.8/importlib/__init__.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: librclpy_common.so: cannot open shared object file: No such file or directory
The C extension ‘/opt/tros/lib/python3.8/site-packages/rclpy/_rclpy.cpython-38-aarch64-linux-gnu.so’ failed to be imported while being present on the system. Please refer to ‘https://index.ros.org/doc/ros2/Troubleshooting/Installation-Troubleshooting/#import-failing-even-with-library-present-on-the-system’ for possible solutions
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/opt/tros/lib/python3.8/site-packages/launch/launch_service.py”, line 228, in _process_one_event
await self.__process_event(next_event)
File “/opt/tros/lib/python3.8/site-packages/launch/launch_service.py”, line 248, in __process_event
visit_all_entities_and_collect_futures(entity, self.__context))
File “/opt/tros/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py”, line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File “/opt/tros/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py”, line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File “/opt/tros/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py”, line 38, in visit_all_entities_and_collect_futures
sub_entities = entity.visit(context)
File “/opt/tros/lib/python3.8/site-packages/launch/action.py”, line 108, in visit
return self.execute(context)
File “/opt/tros/lib/python3.8/site-packages/launch/actions/include_launch_description.py”, line 130, in execute
launch_description = self.__launch_description_source.get_launch_description(context)
File “/opt/tros/lib/python3.8/site-packages/launch/launch_description_source.py”, line 84, in get_launch_description
self._get_launch_description(self.__expanded_location)
File “/opt/tros/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_description_source.py”, line 53, in _get_launch_description
return get_launch_description_from_any_launch_file(location)
File “/opt/tros/lib/python3.8/site-packages/launch/launch_description_sources/any_launch_file_utilities.py”, line 56, in get_launch_description_from_any_launch_file
raise InvalidLaunchFileError(extension, likely_errors=exceptions)
launch.invalid_launch_file_error.InvalidLaunchFileError: Caught exception when trying to load file of format [py]: librclpy_common.so: cannot open shared object file: No such file or directory
The C extension ‘/opt/tros/lib/python3.8/site-packages/rclpy/_rclpy.cpython-38-aarch64-linux-gnu.so’ failed to be imported while being present on the system. Please refer to ‘https://index.ros.org/doc/ros2/Troubleshooting/Installation-Troubleshooting/#import-failing-even-with-library-present-on-the-system’ for possible solutions
sunrise@ubuntu:~$ ros2 run examples_rclcpp_minimal_subscriber subscriber_member_function
/opt/tros/lib/examples_rclcpp_minimal_subscriber/subscriber_member_function: error while loading shared libraries: librclcpp.so: cannot open shared object file: No such file or directory
sunrise@ubuntu:~$
sunrise@ubuntu:~$ env|grep PATH
PKG_CONFIG_PATH=/opt/tros/lib/x86_64-linux-gnu/pkgconfig:/opt/tros/lib/pkgconfig
AMENT_PREFIX_PATH=/opt/tros
CMAKE_PREFIX_PATH=/opt/tros
COLCON_PREFIX_PATH=/opt/tros
PYTHONPATH=/opt/tros/lib/python3.8/site-packages
LD_LIBRARY_PATH=/opt/tros/opt/yaml_cpp_vendor/lib:/opt/tros/lib
PATH=/opt/tros/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
```
- 软件上是否有做自定义修改:地平线2.0.0镜像ubuntu-preinstalled-desktop-arm64.img.xz无修改