-
Notifications
You must be signed in to change notification settings - Fork 0
Manual Setup Process
The following instructions are detailed steps, all done manually. All terminal instructions are prefixed by $
.
It's assumed you will be starting in a fresh workspace at ~/yocto_ws/
, but this location does not matter as long as it's the same for the whole tutorial.
-
Read the yocto project quick build
- This tutorial will be used as a reference, and you can always try it first without issue. Just make sure to use the
kirkstone
branch. - Don't add the
meta-altera
, we will add other layers for ROS instead.
- This tutorial will be used as a reference, and you can always try it first without issue. Just make sure to use the
-
Instead of cloning meta-ros directly with
git
and creating our own branch, we will usevcs
, which is commonly used in the ROS community for managing cloning multiple repositories.- In your yocto workspace, create
ros-image-core.repos
file with the following:$ cd ~/yocto_ws
$ touch ros-image-core.repos
repositories: poky: type: git url: git://git.yoctoproject.org/poky version: kirkstone meta-openembedded: type: git url: https://git.openembedded.org/meta-openembedded version: kirkstone meta-ros: type: git url: https://github.com/ros/meta-ros.git # TODO switch to kirkstone once kirkstone-next is merged version: kirkstone-next
- Import the sources with vcs:
If you already followed the poky quick-build, vcs will just skip cloning poky automatically.
$ vcs import --input ros-image-core.repos
- You can now see all repos are cloned:
$ ls >>> meta-openembedded meta-ros poky ros-image-core.repos
- In your yocto workspace, create
-
While the poky tutorial clones
meta-ros
inside thepoky
directory, the above repos file clonespoky
next tometa-ros
at the same level. This is called an "out of tree" build, which separates the repositories better. -
In building for specific hardware, we can now source the open-embedded build environment initialization script and add layers. Again, since the sources are cloned, the paths to the layers are slightly different than in the tutorial.
# Add all the layers bitbake-layers add-layer ../../meta-openembedded/meta-oe/ bitbake-layers add-layer ../../meta-openembedded/meta-python/ bitbake-layers add-layer ../../meta-ros/meta-ros-common/ bitbake-layers add-layer ../../meta-ros/meta-ros2 bitbake-layers add-layer ../../meta-ros/meta-ros2-humble
-
Finally, you are ready to build! It may take quite a while.
bitbake ros-image-core
Create the ros-image-core.repos
per above, then dump this in terminal.
vcs import --input ros-image-core.repos
cd poky
source oe-init-build-env
bitbake-layers add-layer ../../meta-openembedded/meta-oe/
bitbake-layers add-layer ../../meta-openembedded/meta-python/
bitbake-layers add-layer ../../meta-ros/meta-ros-common/
bitbake-layers add-layer ../../meta-ros/meta-ros2
bitbake-layers add-layer ../../meta-ros/meta-ros2-humble
bitbake ros-image-core
runqemu qemux86-64 ros-image-core-humble
- TODO switch to using MCF: https://gist.github.com/robwoolley/e16f60e6e8483e7ea36f7616197bab11#file-build-ros-image-world-txt-L17
Let's run the image locally to make sure it works and demonstrate it's working.
- First, if it's a new terminal, make sure to source the workspace, and then run the image.
cd yocto_ws/poky source oe-init-build-env runqemu qemux86-64 ros-image-core-humble
- When first running the image, it prompts for sudo. This is expected and only needed once.
>>> runqemu - INFO - Setting up tap interface under sudo
- Next, you are prompted to log into the qemu account. The username is
TBD
and password isTBD
[TODO add reference to docs]