-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add appropriate repos, links into layers, playground, and a readme.
- Loading branch information
1 parent
c6ca05a
commit dffd6b9
Showing
38 changed files
with
1,373 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,6 @@ build*/ | |
*.pyo | ||
.ssh | ||
|
||
artifacts/ | ||
downloads/ | ||
sstate-cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# This dockerfile allows you to build an environment for cross-compiling packages for the Jetson. | ||
# It is based on the SDK generated by yocto. | ||
# To be able to build this dockerfile, you have to run `bitbake mr-nadir-image -c populate_sdk` | ||
# in a yocto environment. This will generate a .sh file in build/tmp/deploy/sdk/ which then | ||
# can be used to build this dockerfile. | ||
# | ||
# THere are several fixes needed to make this work, for example the paths in some cmake files | ||
# need to be fixed. This is done in the dockerfile. | ||
# Additional yocto packages are added to the image in mr-nadir-image.bb (see meta-nadir/recipes-core/images/mr-nadir-image.bb) | ||
# And there is a nadir-image-sdk-support package which adds some additional scripts to the SDK. | ||
# | ||
# To build: | ||
# $ docker build . -t yocto-ros-cross-sdk:latest | ||
# | ||
# To run: | ||
# $ docker run -it --rm -v $(pwd):/workdir yocto-ros-cross-sdk:latest | ||
# | ||
# Whre $(pwd) is the path to the root of the nadir-os repo. | ||
# You can also pass a command to the docker run command. There is a script in the PATH called cross-build which | ||
# allows you to build a single package. For example: | ||
# $ docker run -it --rm -v $(pwd):/workdir yocto-ros-cross-sdk:latest cross-build nadir_commander | ||
|
||
|
||
|
||
FROM ubuntu:22.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt update && \ | ||
apt install -y \ | ||
python3 \ | ||
xz-utils \ | ||
perl \ | ||
findutils \ | ||
file \ | ||
vim \ | ||
nano \ | ||
git \ | ||
less \ | ||
sudo \ | ||
wget \ | ||
curl \ | ||
\ | ||
&& \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# Copy the SDK | ||
RUN mkdir -p /work/sdk | ||
ARG CURRENT_DIR="." | ||
COPY artifacts/tmp/deploy/sdk/ /work/sdk | ||
|
||
# Install the SDK | ||
RUN sh /work/sdk/*-toolchain*.sh \ | ||
-y -d /opt/sdk && \ | ||
rm -rf /opt/sdk/sysroots/*-linux/usr/lib/openssl/ptest/test && \ | ||
rm /work -rf | ||
|
||
# Fix paths in some cmake files | ||
RUN cd /opt/sdk \ | ||
echo "#!/bin/bash" > /tmp/fix_paths.sh && \ | ||
echo "set -x" >> /tmp/fix_paths.sh && \ | ||
echo ". /opt/sdk/environment-setup-*-linux*" >> /tmp/fix_paths.sh && \ | ||
echo 'grep -rl "FIXMESTAGINGDIRHOST" /opt/sdk | xargs sed -i "s#FIXMESTAGINGDIRHOST#${OECORE_NATIVE_SYSROOT}#g"' >> /tmp/fix_paths.sh && \ | ||
echo 'grep -rl "/usr/lib/libpython3.10.so" /opt/sdk | xargs sed -i "s#/.*/.*-linux.*/.*/recipe-sysroot/usr/lib/libpython3.10.so#${SDKTARGETSYSROOT}/usr/lib/libpython3.10.so#g"' >> /tmp/fix_paths.sh && \ | ||
echo "set +x" >> /tmp/fix_paths.sh && \ | ||
chmod +x /tmp/fix_paths.sh && \ | ||
/tmp/fix_paths.sh && \ | ||
rm /tmp/fix_paths.sh | ||
|
||
|
||
# create entrypoint and cross-build script | ||
RUN echo "#!/bin/bash" > /entrypoint.sh && \ | ||
echo "source /opt/sdk/environment-setup-*-linux*" >> /entrypoint.sh && \ | ||
echo "if [ -z \"\$1\" ]" >> /entrypoint.sh && \ | ||
echo "then" >> /entrypoint.sh && \ | ||
echo " . /opt/sdk/sysroots/x86_64-oesdk-linux/etc/profile.d/ros.sh" >> /entrypoint.sh && \ | ||
echo " echo \"Welcome to the SDK build environment, you now can run colcon like normal.\"" >> /entrypoint.sh && \ | ||
echo " echo \"We already called '. /opt/sdk/sysroots/x86_64-oesdk-linux/etc/profile.d/ros.sh' for you.\"" >> /entrypoint.sh && \ | ||
echo " echo \"\"" >> /entrypoint.sh && \ | ||
echo " exec bash" >> /entrypoint.sh && \ | ||
echo " exit 0" >> /entrypoint.sh && \ | ||
echo "fi" >> /entrypoint.sh && \ | ||
echo "exec \"\$@\"" >> /entrypoint.sh && \ | ||
chmod +x /entrypoint.sh | ||
|
||
# add user sdkbuild | ||
RUN useradd -ms /bin/bash sdkbuild | ||
# allow sudo without password | ||
RUN echo "sdkbuild ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
||
# RUN . /opt/sdk/environment-setup-*-linux && \ | ||
# python3 -m ensurepip --upgrade && \ | ||
# python3 -m pip install vcstool | ||
|
||
USER sdkbuild | ||
|
||
WORKDIR /workdir | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# ROS2 SDK Demo Image | ||
|
||
This is an example of yocto ROS2 with a setup that can create an SDK for cross compilation. | ||
It has been developed/tested with `MACHINE=raspberry4` but should be easy to adapt. | ||
|
||
## Building an SDK | ||
|
||
You will need build environment that is [setup to build yocto](https://docs.yoctoproject.org/4.0.13/brief-yoctoprojectqs/index.html#compatible-linux-distribution). | ||
See below for an example using docker. | ||
|
||
git clone <REPO URL> | ||
cd yocto-ros2-sdk-demo | ||
git submodule update --init | ||
. ./layers/oe-init-build-env build | ||
|
||
Now you have a `build` directory, ready to go. | ||
This is based on the `raspberry4` machine. | ||
|
||
## To build the sdk: | ||
|
||
bitbake ros2-demo-image -c do_populate_sdk | ||
|
||
The SDK install files are then available in `<REPO ROOT DIR>/artifacts/tmp/deploy/sdk/`. | ||
This path is important, as the Dockerfile to create a build image is dependend on it. | ||
|
||
## Build a Docker image | ||
|
||
./scripts/create-sdk-docker-latest.sh | ||
|
||
This will create a docker iamge named `yocto-ros-cross-sdk:latest`. | ||
|
||
## Run the build container: | ||
|
||
./scripts/start-build-container.sh . | ||
|
||
This will start the build container with the SDK setup. | ||
The parameter passed to the script `.` is the path that should be made available to `/workdir`. | ||
This path can be outside the current directory. | ||
|
||
## Build the action_tutorials_cpp | ||
|
||
Inside the build container: | ||
|
||
cd /workdir/playground | ||
colcon build | ||
|
||
|
||
## Get your disk space back: | ||
|
||
rm -rf artifacts/tmp | ||
|
||
Get all your disk space back: | ||
|
||
rm -rf artifacts/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This file is required by oe-setup-buildenv script | ||
# but not used in this repository | ||
TEMPLATECONF=${TEMPLATECONF:-meta-ros2-demo-image/conf/template-ros2-demo} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../repos/meta-openembedded/meta-filesystems |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../repos/meta-openembedded/meta-networking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../repos/meta-openembedded/meta-oe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../repos/poky/meta-poky |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../repos/meta-openembedded/meta-python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../repos/meta-raspberypi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TEMPLATECONF=${TEMPLATECONF:-meta-mr-core/conf/template-$DISTRO} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
DISTRO = "mr-core" | ||
DISTRO_NAME = "Mission Robotics Core OE4Tegra Distro" | ||
DISTRO_VERSION_BASE = "1.0.3" | ||
DISTRO_VERSION = "${DISTRO_VERSION_BASE}+snapshot-${DATE}" | ||
DISTRO_CODENAME = "kirkstone-l4t-r32.7" | ||
SDK_VENDOR = "-tdsdk" | ||
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${METADATA_REVISION}','snapshot')}" | ||
SDK_VERSION[vardepvalue] = "${SDK_VERSION}" | ||
|
||
MAINTAINER = "OE4Tegra team <[email protected]>" | ||
|
||
TARGET_VENDOR = "-oe4t" | ||
|
||
# New ${DISTRO}-<version> setting for sanity checks. | ||
# Increment version number (and the corresponding | ||
# setting int the template bblayers.conf.sample file) | ||
# each time the layer settings are changed. | ||
REQUIRED_TD_BBLAYERS_CONF_VERSION = "${DISTRO}-7" | ||
|
||
LOCALCONF_VERSION = "2" | ||
|
||
TD_DEFAULT_DISTRO_FEATURES = "largefile opengl ptest multiarch wayland vulkan systemd pam virtualization" | ||
|
||
DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${TD_DEFAULT_DISTRO_FEATURES}" | ||
|
||
# Jetson platforms do not use linux-yocto, but for QEMU testing | ||
# align with the poky distro. | ||
PREFERRED_VERSION_linux-yocto ?= "5.15%" | ||
PREFERRED_VERSION_linux-yocto-rt ?= "5.15%" | ||
|
||
# Gstreamer libraries are passed through to containers when using | ||
# nvidia-docker, so our version of Gstreamer must match the one in | ||
# the stock L4T/JetPack release. | ||
require conf/include/gstreamer-1.14.conf | ||
|
||
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}" | ||
SDKPATHINSTALL = "/opt/${DISTRO}/${SDK_VERSION}" | ||
|
||
TCLIBCAPPEND = "" | ||
|
||
PACKAGE_CLASSES ?= "package_rpm" | ||
|
||
SANITY_TESTED_DISTROS ?= " \ | ||
ubuntu-18.04 \n \ | ||
ubuntu-20.04 \n \ | ||
ubuntu-22.04 \n \ | ||
" | ||
|
||
# CUDA 10.2 requires gcc 8 | ||
CUDA_GCCVERSION = "8.%" | ||
|
||
# Most NVIDIA-supplied services expect systemd | ||
INIT_MANAGER = "systemd" | ||
|
||
INHERIT += "tegra-support-sanity" | ||
ESDK_CLASS_INHERIT_DISABLE:append = " tegra-support-sanity" | ||
|
||
require conf/distro/include/no-static-libs.inc | ||
require conf/distro/include/yocto-uninative.inc | ||
require conf/distro/include/security_flags.inc | ||
INHERIT += "uninative" | ||
|
||
BB_SIGNATURE_HANDLER ?= "OEEquivHash" | ||
BB_HASHSERVE ??= "auto" | ||
|
||
LICENSE_FLAGS_ACCEPTED += "commercial_faad2" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# We have a conf and classes directory, append to BBPATH | ||
BBPATH .= ":${LAYERDIR}" | ||
|
||
# We have a recipes directory, add to BBFILES | ||
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend ${LAYERDIR}/generated-recipes/*/*.bb" | ||
|
||
BBFILE_COLLECTIONS += "ros2-demo-iamge" | ||
BBFILE_PATTERN_ros2-demo-iamge := "^${LAYERDIR}/" | ||
BBFILE_PRIORITY_ros2-demo-iamge = "12" | ||
|
||
LAYERVERSION_ros2-demo-iamge = "1" | ||
|
||
LAYERDEPENDS_ros2-demo-iamge = " \ | ||
core \ | ||
meta-python \ | ||
openembedded-layer \ | ||
ros-common-layer \ | ||
ros2-layer \ | ||
" | ||
|
||
LAYERSERIES_COMPAT_ros2-demo-iamge = "${ROS_OE_RELEASE_SERIES}" | ||
|
||
require conf/ros-distro/include/iron/ros-distro.inc |
22 changes: 22 additions & 0 deletions
22
layers/meta-ros2-demo-image/conf/template-ros2-demo/bblayers.conf.sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Version of layers configuration, specific to | ||
# each defined distro in the repository. | ||
# Format: ${DISTRO}-<version> | ||
TD_BBLAYERS_CONF_VERSION = "mr-core-7" | ||
|
||
BBPATH = "${TOPDIR}" | ||
BBFILES ?= "" | ||
|
||
BBLAYERS ?= " \ | ||
##OEROOT##/meta \ | ||
##OEROOT##/meta-poky \ | ||
##OEROOT##/meta-yocto-bsp \ | ||
##OEROOT##/meta-oe \ | ||
##OEROOT##/meta-python \ | ||
##OEROOT##/meta-networking \ | ||
##OEROOT##/meta-filesystems \ | ||
##OEROOT##/meta-raspberypi \ | ||
##OEROOT##/meta-ros-common \ | ||
##OEROOT##/meta-ros2 \ | ||
##OEROOT##/meta-ros2-iron \ | ||
##OEROOT##/meta-ros2-demo-image \ | ||
" |
5 changes: 5 additions & 0 deletions
5
layers/meta-ros2-demo-image/conf/template-ros2-demo/conf-notes.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### Shell environment set up for builds. ### | ||
|
||
You can now run 'bitbake <target>' | ||
Targets for building Mission Robotics Tegra images: | ||
ros2-demo-image - basic image with no graphics |
Oops, something went wrong.