差别
这里会显示出您选择的修订版和当前版本之间的差别。
| 两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
| digi:arm-embedded:linux:dey:deycustomrootfs:ros2 [2024/03/07 08:15] – robin | digi:arm-embedded:linux:dey:deycustomrootfs:ros2 [2024/03/25 03:36] (当前版本) – robin | ||
|---|---|---|---|
| 行 9: | 行 9: | ||
| < | < | ||
| - | sudo apt update | + | sudo apt -y update |
| - | sudo apt install gawk wget git diffstat unzip gcc-multilib | + | sudo apt -y install gawk wget file git diffstat |
| - | | + | sudo locale-gen en_US.utf8 |
| - | | + | sudo apt -y install python-is-python3 |
| - | | + | |
| - | | + | |
| - | | + | |
| - | sudo locale-gen en_US.utf8 | + | |
| </ | </ | ||
| - | 2.找出环境变量和配置文件备用 | + | 2.安装DEY ALL In One开发环境,本开发环境会把meta-digi和meta-ros都和官方同步,用户只需在配置文件对镜像进行配置。 |
| - | 为了整合meta-ros到dey的镜象中,有两种办法,一种是用meta-ros中的镜像名来编译,另一种是参考dey-image-qt来创建dey-image-ros,并在镜像的recipe里加上关键包的支持。为了调查清楚,首先在一个全新的虚拟机上演练一下官方文档安装过程,并检查其配置文件。 | + | 首先要安装repo,在ubuntu 22.04中可直接用apt install repo来安装,如果您的发行版不支持这种安装方式,请从官方下载安装repo: |
| < | < | ||
| - | mkdir ros2-test | + | sudo -H tmux |
| - | cd ros2-test | + | curl -o /usr/local/bin/repo http:// |
| - | + | chmod a+x /usr/local/bin/repo | |
| - | mkdir conf | + | exit |
| - | ln -snf ../conf build/. | + | |
| - | + | ||
| - | 在build/files/ | + | |
| - | cp build/files/ros2-humble-kirkstone conf/. | + | |
| </ | </ | ||
| - | 上面这个主要是为了研究配置文件,供以后碰到问题时参考,可以不做这第2步,先直接拉meta-ros到源码,请参考下面 | + | 然后设置好git |
| - | + | ||
| - | 3. DEY的镜像bb文件研读 | + | |
| - | 主要的image配置文件在:dey4.0/ | + | |
| - | 其中,core-image-base是在poky的基础镜像文件中添加一些包实现的,所以先研读core-image-base基础镜像,它继承自更基础的core-image(sources/ | + | |
| - | 接下来将拉取meta-ros,并研读相关的bb文件。 | + | |
| - | + | ||
| - | 4. 拉取meta-ros | + | |
| - | 下载meta-ros到dey的源码目录下 | + | |
| < | < | ||
| - | cd dey4.0/sources | + | git config --global user.name “yourname” |
| - | git clone https:// | + | git config --global user.email " |
| + | </ | ||
| + | 接着就可以用repo安装DEY AIO了 | ||
| + | < | ||
| + | cd | ||
| + | mkdir dey-aio | ||
| + | cd dey-aio | ||
| + | repo init -u https:// | ||
| + | repo sync | ||
| </ | </ | ||
| - | 我们还需要把这个layer添加到conf/ | + | 3. 配置ROS支持 |
| + | |||
| + | 我们还需要把这个layer添加到conf/ | ||
| < | < | ||
| / | / | ||
| 行 52: | 行 45: | ||
| / | / | ||
| </ | </ | ||
| + | 并在bblayers.conf的配置文件最后添加这两行变量定义: | ||
| + | < | ||
| + | ROS_DISTRO = " | ||
| + | ROS_DISTRO_TYPE = " | ||
| + | </ | ||
| + | |||
| + | 此时可以尝试编译ros-core | ||
| - | 注意下载下来的目录中,meta-ros-common和meta-ros2-humble是我们需要的。如果要编译ros的镜像,在meta-ros-common中有image相关的recipe,其中: | + | bitbake ros-core |
| + | |||
| + | 5. 检查机器学习相关包 | ||
| + | < | ||
| + | cat ../ | ||
| + | 最新的bb文件应该如下所录,使用tensorflow-lite,如果不是请按下面注释掉原来的一行,并添加这一新行 | ||
| + | # | ||
| + | # Only install tensorflow-lite to save space | ||
| + | ML_PKGS: | ||
| + | </ | ||
| + | 另外,在conf/ | ||
| + | IMAGE_INSTALL: | ||
| + | |||
| + | |||
| + | |||
| + | 6. 创建带ros支持的镜像 | ||
| + | |||
| + | 如果要编译ros的镜像,在meta-ros-common中有image相关的recipe,其中: | ||
| cat ros-image-core可以观察,要定义的东西: | cat ros-image-core可以观察,要定义的东西: | ||
| < | < | ||
| 行 161: | 行 178: | ||
| bitbake core-image-ros | bitbake core-image-ros | ||
| </ | </ | ||
| - | 首先要排除的是,在ros的三个layer中,对yocto版本限制了,只需把conf/ | ||
| - | |||
| - | 继续编译,碰到一个错误: | ||
| - | |||
| - | ERROR: ParseError at / | ||
| - | |||
| - | 看样子,在meta-digi-dey里放ros镜像的bb是不行的,要大改,试着把这个文件拷到meta-ros-common/ | ||
| - | |||
| - | 此时,碰到的错误是ParseError at / | ||
| - | |||
| - | 看来,应该是不能直接复制双方的recipe,而要有技巧。 | ||
| - | |||
| - | 根据文档: | ||
| - | |||
| - | < | ||
| - | nano ros-env | ||
| - | |||
| - | ROS_VERSION=2 | ||
| - | ROS_PYTHON_VERSION=3 | ||
| - | ROS_DISTRO=humble | ||
| - | |||
| - | chmod +x ros-env | ||
| - | source ros-env | ||
| - | </ | ||
| - | 再编译仍有错,检索https:// | ||
| - | |||
| - | 1. 在conf/ | ||
| - | |||
| - | 2. DISTRO ?= " | ||
| - | |||
| - | |||
| - | 发现没有把mcf配置文件用起来,一个可能的方案是,把mcf放在 conf/ | ||
| - | |||
| - | 注意到最核心的文档是:https:// | ||
| - | The initial port of ROS 2 port was undertaken by Erle Robotics. Their work was shared at this repository and integrated upstream into meta-ros.\\ | ||
| - | |||
| - | It has been converted to use recipes generated by superflore. Please see this wiki page for details of what was done and the current development milestones. \\ | ||
| - | wiki地址就是 | ||
| - | |||
| - | https:// | ||
| - | |||
| - | 应该是ros转用recipe的方法, | ||
| - | |||
| - | 为了得到ros-core, | ||
| - | |||
| - | 精简一下conf/ | ||
| - | < | ||
| - | |||
| - | |||
| - | </ | ||
| - | |||
| - | 继续除错,主要还是devtool那个目录,应该是版本问题,考虑到不把cc93当成开发电脑,这些python都可以先禁掉\\ | ||
| - | |||
| - | / | ||
| - | \\ | ||
| - | 一个可能有用参考:https:// | + | 其它可能有用参考:https:// |