ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

sdk from meta-ros

asked 2021-08-05 03:04:31 -0600

Tobias Neumann gravatar image

Hi,

I'm trying to get a minimal setup of ROS 2 working for my companies eco system, which requires an OpenEmbedded toolchain. meta-ros has been integrated into our project and an image with ros-base could be build and seems to work.

The setup is based on OpenEmbedded dunfell with ROS 2 foxy. The branch dunfell from the meta-ros-repo is used. A newer ROS 2 version (also rolling) could be used, however dunfell can not be changed.

The next step would be to extent our toolchain/sdk with the requirements to build ROS nodes.

However not much could be found regarding this. And some other answers suggest to create a recipeto build custom-ros-nodes. This would not be suitable for us. In https://github.com/ros/meta-ros/wiki/... it is mentioned that nativesdk will be included for ROS_SUPERFLORE_GENERATION_SCHEME 3 however I could not find what 3 means and I assume based on the surrounding documentation that the current version is 2, but I could not find a clear statement regarding that or a planned timetable for the implementation of generation 3.

So after a long intro to my question. Is there a working way to create an OpenEmbedded SDK for ROS 2 and where could I find it?

What I did till now is to extent ament-cmake and its depending packages by BBCLASSEXTEND = "native nativesdk" and included these nativesdk-ament-* packages within the dependencies of the SDK. ament seems to be found when the toolchain is used to corsscompile, and I'm currently stopped by cmake not finding middlewares with the following error:

CMake Error at /home/ilocalstorage-ssd/tneumann/sdk/17.266f5bc31/sysroots/core2-64-oe-linux/usr/share/rmw_implementation/cmake/rmw_implementation-extras.cmake:54 (message):
  The RMW implementation has been specified as 'rmw_fastrtps_cpp' via
  environment variable 'RMW_IMPLEMENTATION', but it is not available at this
  time.



  Currently available middlewares:

  ''

Help regarding this specific problem would be nice, but the main focus of the question should be "is that the correct path I'm following, or should I look into a different direction?".

it's quite a complex questions, but I tried to describe the general problem as good as I could so that it would also be helpful for the next persons running into the same problems.

best regards Tobias

edit retag flag offensive close merge delete

Comments

The problem regarding the not found RMW_IMPLEMENTATION where caused by the ament_index not been set up correctly. I could bypass this by setting export AMENT_PREFIX_PATH=<path-to-my-sdk>/sysroots/core2-64-oe-linux/usr/

Tobias Neumann gravatar image Tobias Neumann  ( 2021-08-05 10:45:14 -0600 )edit

After that, it seems like only foonathan-memory-staticdev where missing for a first minimal working version. However the main question, if that is the correct way to generate and sdk, would still stand.

Tobias Neumann gravatar image Tobias Neumann  ( 2021-08-06 10:53:11 -0600 )edit

Building single ROS dependent cmake projekts seems to works now, with the above described steps (only tested with a very small Hello-World like example). Next step will be to include colcon in the toolchain and support an overlay-workspace (during compilation with the toolchain and in the resulting img)

Tobias Neumann gravatar image Tobias Neumann  ( 2021-08-12 09:41:46 -0600 )edit

can you please share your findings about what exactly steps need to be done to build sdk (by the way you using standard or extensible variant?) and how to create recipe whit all dependencies for builinding ros2-nodes?

Endag gravatar image Endag  ( 2021-11-03 00:40:04 -0600 )edit

Hi, sry for my late reply. I missed your request. I've added a description of the steps I took till now.

Tobias Neumann gravatar image Tobias Neumann  ( 2021-11-16 10:15:27 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-11-16 10:12:55 -0600

Tobias Neumann gravatar image

I've never build a ROS 2 only ROOTFS/toolchain, it was always included in the company internal project. And it is also not really finished or reviewed, so there might be clutter or better solutions to get stuff done. With this it is possible to link against packages within the toolchain, to create an full overlay workspace with several packages depending on each other isn't yet finished (but this might work for you as well, it is just currently incompatible with out company internal crosscompile workflow) Feel free to improve this.

The following description is taken from my git history, so this might not be the optimal step for everything, but here it goes.

  • Created a new packagegroup for the ROS related stuff.
  • Add the following to the RDEPENDS_${PN} of this packagegroup: ros-base, ros-workspace-implicitworkspace, foonathan-memory-staticdev.
  • Added this packagegroup to the SDK_RDEPENDS (this might be called differently, we use an alias in our yocto project)
  • Added nativesdk-ament-package, nativesdk-ament-cmake, nativesdk-rosidl-default-generators, nativesdk-rosidl-typesupport-fastrtps-c, nativesdk-rosidl-typesupport-fastrtps-cpp and nativesdk-colcon-ros to the RDEPENDS_${PN} of the nativesdk- of this packagegroup
  • Added the following files

ament-cmake_%.bbappend

RDEPENDS_${PN}_append = " \
    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-libraries \
    ament-cmake-python \
    ament-cmake-target-dependencies \
    ament-cmake-test \
    ament-cmake-version \
    ament-cmake-include-directories \
"

spdlog_%.bbappend

BUILDSDK_CXXFLAGS_append = " -fuse-ld=gold"

BBCLASSEXTEND = " nativesdk "

spdlog-vendor_%.bbappend (I'm not sure if everything is required from that, spdlog was driving me crazy)

ROS_BUILD_DEPENDS_remove = "spdlog"
ROS_EXPORT_DEPENDS_remove = "spdlog"
DEPENDS_append_class-target = " spdlog "
DEPENDS_append_class-nativesdk = " spdlog "
#DEPENDS_append = "spdlog"
# spdlog is header only library and PN is empty, so it wasn't created
RDEPENDS_${PN}_remove = "spdlog"
RDEPENDS_${PN}_remove = "nativesdk-spdlog"

rcl-logging-spdlog_%.bbappend

# spdlog is header only library and PN is empty, so it wasn't created
ROS_BUILD_DEPENDS_remove = "spdlog"
DEPENDS_append_class-target = " spdlog "
RDEPENDS_${PN}_remove = "spdlog"
RDEPENDS_${PN}_remove = "nativesdk-spdlog"

foonathan-memory_%.bbappend

BUILDSDK_CXXFLAGS_append = " -fPIC "

python3-pytest-cov_%.bbappend

RDEPENDS_${PN}_append = " \
    ${PYTHON_PN}-pytest \
    ${PYTHON_PN}-coverage \
"

python3-coverage_5.2.1.bb

SUMMARY = "Code coverage measurement for Python"
HOMEPAGE = "https://coverage.readthedocs.io"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2ee41112a44fe7014dce33e26468ba93"

SRC_URI[md5sum] = "9e6165146b9bda60a779953c79e8ca54"
SRC_URI[sha256sum] = "a34cb28e0747ea15e82d13e14de606747e9e484fb28d63c999483f5d5188e89b"

inherit pypi setuptools3

python3-pytest-rerunfailures_10.2.bb

inherit setuptools3

SUMMARY = "pytest-rerunfailures is a plugin for pytest that re-runs tests to eliminate intermittent failures."
HOMEPAGE = "https://github.com/pytest-dev/pytest-rerunfailures"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=06238b648baf0545473491607f3093c5"

RDEPENDS_${PN}_append = " \
    ${PYTHON_PN}-pytest \
    ${PYTHON_PN}-setuptools \
"

SRC_URI = "git://github.com/pytest-dev/pytest-rerunfailures.git;tag=${PV};protocol=https"
S="${WORKDIR}/git"

BBCLASSEXTEND = "nativesdk"

python3-pytest-repeat_0.9.1.bb

inherit setuptools3

SUMMARY = "pytest-repeat is a plugin for pytest that makes it easy to repeat a single test, or multiple tests, a specific number of times."
HOMEPAGE = "https://github.com/pytest-dev/pytest-repeat"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=2a0bb0f2949a8babbc1df9a81a569b25"

DEPENDS_append = " \
    ${PYTHON_PN}-setuptools-scm-native \
"

RDEPENDS_${PN}_append = " \
    ${PYTHON_PN}-pytest \
    ${PYTHON_PN}-setuptools-scm \
"

SRC_URI = " git://github.com/pytest-dev/pytest-repeat.git;tag=v${PV};protocol=https; "
S="${WORKDIR}/git"

BBCLASSEXTEND = "nativesdk"

python3-distlib_0.3.2.bb

inherit setuptools3

SUMMARY = "Distlib is a library which implements low-level functions that relate to packaging and distribution of Python software. It is intended to be used as the basis for third-party packaging tools. The documentation is available at."
HOMEPAGE = "https://github ...
(more)
edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2021-08-05 03:04:31 -0600

Seen: 671 times

Last updated: Nov 16 '21