Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10CA3C433F5 for ; Mon, 8 Nov 2021 14:39:17 +0000 (UTC) Subject: Cross-compile custom ROS2 package for Yocto #bitbake To: yocto@lists.yoctoproject.org From: "bojankoce" X-Originating-Location: =?utf-8?b?QXJwYWpvbiwgw45sZS1kZS1GcmFuY2UsIEZSICg5?= =?utf-8?b?MS4xNzQuMjM1LjIwMSk=?= X-Originating-Platform: Windows Firefox 94 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Mon, 08 Nov 2021 06:39:16 -0800 Message-ID: Content-Type: multipart/alternative; boundary="ROFMTJO69E8grOXOAUTr" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 08 Nov 2021 14:39:17 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/55270 --ROFMTJO69E8grOXOAUTr Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Dear Sirs, I have a hard time to cross-compile and to properly include the custom ROS2= foxy package into the Yocto image. I properly added meta-ros layer and ROS= 2 foxy distro to our Yocto build by following instructions from here ( http= s://github.com/ros/meta-ros/wiki/OpenEmbedded-Build-Instructions#add-meta-r= os-to-an-existing-openembedded-project ) ( Sanity Tests ( https://github.co= m/ros/meta-ros/wiki/OpenEmbedded-Build-Instructions#ros-2-sanity-test ) pas= s successfully). I wanted to use a devtool and build a simple custom ROS2 package containing= publisher and subscriber nodes. The source code of the package is on the g= it - link ( https://github.com/bojankoce/ros2pkg ). I used tips and tricks from here ( https://wiki.yoctoproject.org/wiki/TipsA= ndTricks/Creating_Recipes_for_ROS_modules ) to create ROS2 recipes with the= devtool. My custom bitbake recipe for the simple ROS2 package looks like t= his ( my-first-yocto-pkg_git.bb file): DESCRIPTION =3D "Example of minimal publisher/subscriber using rclcpp." LICENSE =3D "Apache-2.0" LIC_FILES_CHKSUM =3D "file://package.xml;beginline=3D8;endline=3D8;md5=3D3a= 75fd635766e2f76c3d90ee6495f310" SRC_URI =3D "git://github.com/bojankoce/ros2pkg;protocol=3Dhttps" # Modify these as desired PV =3D "0.1.0" SRCREV =3D "1312445de2e6861d9561c0f89f4827b94c2ff6b1" DEPENDS =3D "rclcpp std-msgs" S =3D "${WORKDIR}/git" # NOTE: unable to map the following CMake package dependencies: rclcpp amen= t_lint_auto std_msgs ros_ament_cmake inherit ros_ament_cmake However, when I tried to build the package with the devtool build my-first-= yocto-pkg command, I get the following error: CMake Error at CMakeLists. txt : 19 ( find_package ): By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "ament_cmake" , but CMake did not find one. Could not find a package configuration file provided by "ament_cmake" with any of the following names : ament_cmakeConfig. cmake ament_cmake - config. cmake Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set "ament_cmake_DIR" to a directory containing one of the above files. If "ament_cmake" provides a separate development package or SDK , be sure it has been installed. The issue is around ament_cmake. I included the inherit ros_ament_cmake lin= e into the recipe but this does not help. Do you have any idea about what I= am missing here? Is there any better way to cross-compile and include a cu= stom ROS2 foxy package into the Yocto image? Thanks in advance for your time and efforts. Cheers, Bojan. --ROFMTJO69E8grOXOAUTr Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

Dear Sirs,

I have a hard time to cross-compile and to properly include the custom R= OS2 foxy package into the Yocto image. I properly added meta-ros layer and = ROS2 foxy distro to our Yocto build by following instructions from here (Sanity Tests pass successfully).

I wanted to use a devtool and build a simple custom ROS2 pa= ckage containing publisher and subscriber nodes. The source code of the pac= kage is on the git - link<= /a>.

I used tips and tricks from here to create ROS2 r= ecipes with the devtool. My custom bitbake recipe for the simp= le ROS2 package looks like this (my-first-yocto-pkg_git.bb fil= e):

DESCRIPTION =3D =
"Example of minimal publisher/subscriber using rclcpp."
LICENSE =3D "Apache-2.0"
LIC_FILES_CHKSUM =3D =
"file://package.xml;beginline=3D8;endline=3D8;md=
5=3D3a75fd635766e2f76c3d90ee6495f310"

SRC_URI =3D "git://github.com/bojankoce/ros2pkg;protocol=3Dhttps"

# Modify these as desired
PV =3D "0.1.0"
SRCREV =3D "1312445de2e6861d9561c0f89f4827b94c2ff6b1"

DEPENDS =3D "rclcpp std-msgs"

S =3D "${WORKDIR}/git"

# NOTE: unable to map the following CMake packag=
e dependencies: rclcpp ament_lint_auto std_msgs ros_ament_cmake
inherit ros_ament_cmake

However, when I tried to build the package with the devtool build = my-first-yocto-pkg command, I get the following error:

CMake Error at <=
/span>CMakeLists.txt:1=
9 (find_package):
  By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to =
find a package config=
uration file provided by
  "ament_cmake", but CMake did not f=
ind one.

  Could not find a package configuration file provided <=
span class=3D"kwd">by "ament_cmake" with
  any of the following names:

    ament_cmakeConfig.cmake
    ament_cmake-confi=
g.cmake

  Add the installatio=
n prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
  "ament_cmake_DIR" t=
o a directory containing one of the above files.=
  If
  "ament_cmake" provi=
des a separate development package or SDK<=
/span>, be sure it
  has been installed.

The issue is around ament_cmake. I included the inher= it ros_ament_cmake line into the recipe but this does not help. Do y= ou have any idea about what I am missing here? Is there any better way to c= ross-compile and include a custom ROS2 foxy package into the Yocto image?

Thanks in advance for your time and efforts.

Cheers,
Bojan.

--ROFMTJO69E8grOXOAUTr--