openEuler 安装 ROS2 Humble
1 介绍
micro-ROS: Developing ROS 2 professional applications based on MCUs
2 安装【openEuler 24.03】【待测】
2.1 Installing ros-humble
(1)Install ros-humble software package
yum install openeuler-ros
yum install ros-humble-*
- 内存占用大小
[root@Euler ~]# cd /opt/ros/
[root@Euler ros]# du -h --max-depth=1
1.7G ./humble
1.7G .
Welcome to 6.6.0-34.0.0.41.oe2403.x86_64
System information as of time: 2024年 07月 25日 星期四 07:07:28 CST
System load: 1.58
Memory used: 28.1% 【没安装前是 26.9%】
Swap used: 0%
Usage On: 64% 【没安装前是 19%】
IP address: 192.168.11.133
IP address: 192.168.122.1
Users online: 1
(2)Run the following command to check whether the installation is successful
rpm -q ros-humble
[root@Euler ~]# rpm -q ros-humble
未安装软件包 ros-humble
2.2 Test ros-humble【python 版本冲突,未解决】
(1)Run turtlesim
source /opt/ros/humble/setup.bash
ros2 run turtlesim turtlesim_node
[root@Euler ros]# source /opt/ros/humble/setup.bash
[root@Euler ros]# ros2 run turtlesim turtlesim_node
/opt/ros/humble/lib/turtlesim/turtlesim_node: error while loading shared libraries: libpython3.9.so.1.0: cannot open shared object file: No such file or directory
[ros2run]: Process exited with failure 127
[root@Euler ros]# python3 --version
Python 3.11.6
[root@Euler ros]# python2 --version
bash: python2: 未找到命令
(2)Open turtlesim terminal
source /opt/ros/humble/setup.bash
ros2 run turtlesim turtle_teleop_key
(3)Use the arrow keys to control the movement of the turtle
2 安装【openEuler 22.03】
2.1 Installing ros-humble
(1)Install ros-humble software package
yum install openeuler-ros
yum install ros-humble-*
(2)Run the following command to check whether the installation is successful
rpm -q ros-humble
[root@Euler ~]# rpm -q ros-humble
未安装软件包 ros-humble
2.2 Test ros-humble
(1)Run turtlesim
source /opt/ros/humble/setup.bash
ros2 run turtlesim turtlesim_node
(2)Open turtlesim terminal
source /opt/ros/humble/setup.bash
ros2 run turtlesim turtle_teleop_key
(3)Use the arrow keys to control the movement of the turtle
2.3 安装编译系统
官方文档
Humble–Using colcon to build packages
发音
catkin 发音 ‘cat + kin’
colcon 发音 ‘call + con’
编译+链接 图示
发展
对于 ROS 1,有多种不同的工具支持此功能,即catkin_make、catkin_make_isolated和catkin_tools。
对于 ROS 2,直到 Ardent 版本,提供此功能的构建工具称为ament_tools。
ROS 编译系统从初期使用的 rosbuild,到 groovy 版本之后的 catkin ,再到 ROS2 中的 Colcon。
colcon,catkin_make是 ROS 构建工具、catkin_make_isolated和catkin_tools的迭代ament_tools。
catkin
colcon
colcon(collective construction)= ament + catkin
- ament: build for ROS 2 pkgs $ ament build --isolated
- catkin: build for ROS 1 pkgs $ catkin_make_isolated --install
ROS2 默认是没有安装 colcon 的;
colcon 是一系列 python 脚本,是对 cmake 等编译工具的封装。
colcon 工具支持构建 ament_cmake、ament_python 以及纯 cmake 软件包;
与 catkin 相比,没有devel目录。
ros2
- ROS2 中功能包根据编译方式的不同分为三种类型。
(1)ament_python,适用于python程序
(2)cmake,适用于C++
(3)ament_cmake,适用于C++程序,是cmake的增强版
安装 colcon
- 安装
# ubuntu 等系统,如下命令安装
sudo apt install python3-colcon-common-extensions
# Using pip on any platform
# 普通用户权限安装,避障权限问题
pip install -U colcon-common-extensions
[euler@Euler ~]$ pip list
Package Version
----------------------------- --------
alabaster 0.7.12
argcomplete 2.0.0
asn1crypto 1.5.1
attrs 22.1.0
Babel 2.9.1
babeltrace 1.5.8
catkin-pkg 0.5.2
cffi 1.15.0
chardet 5.0.0
charset-normalizer 2.0.12
colcon-argcomplete 0.3.3
colcon-bash 0.5.0
colcon-cd 0.1.1
colcon-cmake 0.2.28
colcon-core 0.17.1
colcon-defaults 0.2.8
colcon-devtools 0.3.0
colcon-library-path 0.2.1
colcon-metadata 0.2.5
colcon-notification 0.3.0
colcon-output 0.2.13
colcon-package-information 0.4.0
colcon-package-selection 0.2.10
colcon-parallel-executor 0.3.0
colcon-pkg-config 0.1.0
colcon-powershell 0.4.0
colcon-python-setup-py 0.2.8
colcon-recursive-crawl 0.2.3
colcon-ros 0.5.0
colcon-test-result 0.3.8
colcon-zsh 0.5.0
...
ament-cmake 和 ament-cmake-ros 对比
-
ament-cmake
定义:ament-cmake 是 ROS 2 的基础构建系统,提供了一系列 CMake 宏和函数,帮助开发者构建和安装 ROS 2 软件包。
用途:ament-cmake 主要用于一般的 C++ 和 Python 软件包的构建,不限于 ROS 2 应用。
功能:提供基础构建功能,如编译、测试、安装等,并支持添加自定义的构建步骤。
依赖:ament-cmake 是 ROS 2 构建系统 ament 的核心部分,不依赖于 ROS 特定的功能。 -
ament-cmake-ros
定义:ament-cmake-ros 是 ament-cmake 的扩展,专门为构建 ROS 2 软件包提供额外的功能和支持。
用途:主要用于构建特定于 ROS 2 的软件包,提供了针对 ROS 2 的额外工具和宏。
功能:包括一些 ROS 2 特定的构建功能,如消息和服务生成、ROS 2 包配置等。
依赖:ament-cmake-ros 依赖于 ament-cmake,并在其基础上提供额外的 ROS 2 功能。
ament_cmake (humble) - 1.3.10-1
ament_cmake (humble) - 1.3.10-1
These packages were released:
- ament_cmake
- ament_cmake_auto
- ament_cmake_core
- ament_cmake_export_definitions
- ament_cmake_export_dependencies
- ament_cmake_export_include_directories
- ament_cmake_export_interfaces
- ament_cmake_export_libraries
- ament_cmake_export_link_flags
- ament_cmake_export_targets
- ament_cmake_gen_version_h
- ament_cmake_gmock
- ament_cmake_google_benchmark
- ament_cmake_gtest
- ament_cmake_include_directories
- ament_cmake_libraries
- ament_cmake_nose
- ament_cmake_pytest
- ament_cmake_python
- ament_cmake_target_dependencies
- ament_cmake_test
- ament_cmake_vendor_package
- ament_cmake_version
Version of package(s) in repository ament_cmake:
- upstream repository: https://github.com/ament/ament_cmake.git
- release repository: https://github.com/ros2-gbp/ament_cmake-release.git
- rosdistro version: 1.3.9-1
- old version: 1.3.9-1
- new version: 1.3.10-1
Versions of tools used:
- bloom version: 0.12.0
- catkin_pkg version: 1.0.0
- rosdep version: 0.24.0
- rosdistro version: 0.9.1
- vcstools version: 0.1.42
3 Python 版本问题【pyenv】
Python核心团队已经于2020年1月停止对Python 2的维护。从openEuler 22.03-LTS版本开始,停止支持和维护Python 2,仅支持Python 3,请您切换并使用Python 3。
openEuler 22.03 版本系统自带的python环境为3.9。
openEuler 24.03 版本系统自带的python环境为3.11。
【注意】建议通过 Conda 来使用,因为操作系统有很多配置跟 Python3.9 做了绑定,比如最基础的 dnf, yum 这些命令,如果只是简单升级 Python3.10.6,可能会遇到很多问题。/usr/bin/dnf 的解释器声明为 #!/usr/bin/python3,安装 python3.x 后, python3 被替换为 python3.x,dnf 运行所需的 libdnf 等 python 库无法找到,导致功能不可用。
关于 platform-python 功能支持
系统默认的python版本改动后,会产生其他影响。
参考
1、openeuler.org–ROS install
2、【openEuler】openEuler上python2.7.x编译安装
3、linux 系统环境下 python 多版本间切换的方法有哪些?【pyenv】
4、openEuler编译安装Python3.11
5、[rpm -qa |grep python3-devel](安装步骤(openEuler 20.03 LTS))
6、欧拉操作系统安装python环境
7、版本:22.03 LTS–发行说明–用户须知
8、openEuler升级Python
9、华为openEuler (欧拉),安装宝塔面板
10、关于 platform-python 功能支持
11、openEuler 22.03 Installation and Deployment ROS
12、colcon–Installation
13、嵌入式ROS运行时支持
14、openEuler Embedded–当前所支持的软件包
15、ament_cmake (humble) - 1.3.10-1
16、ROS2探索总结-4.ament编译系统
17、Using colcon to build packages
18、ROS 2 Documentation humble
19、Humble–Using colcon to build packages
20、京都大学–Robot Operating System
21、Tutorial 2: Development Tools
22、micro-ROS: Developing ROS 2 professional applications based on MCUs
23、Intel–Robot Operating System Software
24、micro-ROS: Developing ROS 2 professional applications based on MCUs