Using ROS2 Layer and APIs

 

1. Overview

This application note explains how to use the ROS2 APIs, and the ROS2 layer in general, in the Emcraft software distribution for the Renesas RZ/V2H SoC.

2. Understanding ROS2 Layer

2.1. High-level Overview

While the Renesas “pristine” distribution provides the meta-rzv2-ros Yocto meta-layer, which makes a subset of the ROS2 packages available for building and integration into the target software image, the Emcraft software distribution provides the Ubuntu compatibility layer (meta-renesas-desktop). The Ubuntu compatibility layer provides the ability to install the pre-built ROS2 packages from the official ROS2 repository into the target software image.

In addition to the official ROS2 packages, Emcraft has developed a number of custom ROS2 packages, which are used to provide a ROS2 API to various software components developed by Emcraft and Emcraft’s partners. One example of such a custom ROS2 package is the ROS2 interface to the PMD ToF (3D) Camera “Royale” stack.

2.2. Ubuntu ROS2 Packages

The Emcraft software distribution installs to the target image the following standard ROS2 packages from the Ubuntu distribution:

ROS2 Package

Version

Summary

Notes

ROS2 Package

Version

Summary

Notes

ros-humble-action-msgs

1.2.1-1

Messages and service definitions common among all ROS actions

 

ros-humble-ament-cmake*

1.3.6-1

The ament buildsystem in CMake

A suite of packages.

ros-humble-ament-cmake-ros

0.10.0-3

The ROS specific CMake bits in the ament buildsystem

 

ros-humble-ament-index-cpp

1.4.0-2

C++ API to access the ament resource index

 

ros-humble-ament-index-python

1.4.0-2

Python API to access the ament resource index

 

ros-humble-ament-lint

0.12.9-1

Common API for the ament linter packages

 

ros-humble-ament-package

0.14.0-4

The parser for the manifest files in the ament buildsystem

 

ros-humble-angles

1.15.0-1

A set of simple math utilities to work with angles

 

ros-humble-behaviortree-cpp-v3

3.8.5-1

The Behavior Trees core library

 

ros-humble-bond*

3.0.2-3

A bond allows two processes, A and B, to know when the other has terminated, either cleanly or by crashing

A suite of packages

ros-humble-builtin-interfaces

1.2.1-1

Message and service definitions for types defined in the OMG IDL Platform Specific Model

 

ros-humble-camera-calibration-parsers

3.1.7-1

Routines for reading and writing camera calibration parameters

 

ros-humble-camera-info-manager

3.1.7-1

A C++ interface for camera calibration information

 

ros-humble-cartographer*

2.0.9002-2

Real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations

A suite of packages

ros-humble-class-loader

2.2.0-3

A ROS-independent package for loading plugins during runtime and the foundation of the higher level ROS pluginlib library.

 

ros-humble-composition-interfaces

1.2.1-1

Message and service definitions for managing composable nodes in a container process

 

ros-humble-console-bridge-vendor

1.4.1-1

Wrapper around console_bridge, providing nothing but a dependency on console_bridge, on some systems

 

ros-humble-control-msgs

4.4.0-1

Base messages and actions useful for controlling robots

 

ros-humble-costmap-queue

1.1.12-1

The costmap_queue package

 

ros-humble-cv-bridge

3.2.1-1

CvBridge, which converts between ROS2 Image messages and OpenCV images

 

ros-humble-cyclonedds

0.10.3-1

Performant and robust open-source DDS implementation

 

ros-humble-demo-nodes-cpp

0.20.3-1

C++ nodes which were previously in the ros2/examples repository but are now just used for demo purposes

 

ros-humble-diagnostic-msgs

4.2.3-1

Some diagnostics related message and service definitions

 

ros-humble-diagnostic-updater

3.1.2-1

Tools for easily updating diagnostics

 

ros-humble-domain-bridge

0.5.0-1

ROS 2 Domain Bridge

 

ros-humble-domain-coordinator

0.10.0-3

A tool to coordinate unique ROS_DOMAIN_ID's across multiple processes

 

ros-humble-dwb*

1.1.12-1

DWB controller

A suite of packages

ros-humble-dynamixel-sdk

3.7.60-1

Wrapping version of the ROBOTIS Dynamixel SDK for ROS 2

 

ros-humble-eigen-stl-containers

1.0.0-4

A set of typedef's that allow using Eigen datatypes in STL containers

 

ros-humble-eigen3-cmake-module

0.1.1-4

Exports a custom CMake module to find Eigen3

 

ros-humble-example-interfaces

0.9.3-2

Message and service definitions used by the examples

 

ros-humble-fastcdr

1.0.24-2

CDR serialization implementation

 

ros-humble-fastrtps

2.6.6-1

eprosima Fast DDS (formerly Fast RTPS)

 

ros-humble-fastrtps-cmake-module

2.2.2-2

CMake module to find eProsima FastRTPS

 

ros-humble-foonathan-memory-vendor

1.2.0-3

Foonathan/memory vendor package for Fast-RTPS

 

ros-humble-geometric-shapes

2.1.3-2

Generic definitions of geometric shapes and bodies

 

ros-humble-geometry-msgs

4.2.3-1

Some geometry related message definitions

 

ros-humble-geometry2

0.25.5-1

A meta-package to bring in the default packages second generation Transform Library in ros, tf2

 

ros-humble-gmock-vendor

1.10.9004-4

The package provides GoogleMock

 

ros-humble-gtest-vendor

1.10.9004-4

The package provides GoogleTest

 

ros-humble-hardware-interface

2.35.0-1

ros2_control hardware interface

 

ros-humble-hls-lfcd-lds-driver

2.0.4-3

ROS package for LDS (HLS-LFCD2)

 

ros-humble-iceoryx*

2.0.3-1

Eclipse iceoryx inter-process-communication (IPC) middleware

A suite of packages.

ros-humble-ignition-cmake2-vendor

0.0.2-2

Ignition CMake 2.x library

 

ros-humble-ignition-math6-vendor

0.0.2-2

Ignition Math 6.x library

 

ros-humble-image-geometry

3.2.1-1

image_geometry contains C++ and Python libraries for interpreting images geometrically.

 

ros-humble-image-transport

3.1.7-1

image_transport should always be used to subscribe to and publish images

 

ros-humble-imu-filter-madgwick

2.1.3-1

Filter which fuses angular velocities, accelerations, and (optionally) magnetic readings from a generic IMU device into an orientation

 

ros-humble-interactive-markers

2.3.2-2

3D interactive marker communication library for RViz and similar tools.

 

ros-humble-kdl-parser

2.6.4-1

The Kinematics and Dynamics Library (KDL) defines a tree structure to represent the kinematic and dynamic parameters of a robot mechanism

 

ros-humble-laser-geometry

2.4.0-2

This package contains a class for converting from a 2D laser scan as defined by sensor_msgs/LaserScan into a point cloud as defined by sensor_msgs/PointCloud or sensor_msgs/PointCloud2

 

ros-humble-launch*

1.0.4-1

ROS launch tool

A suite of packages

ros-humble-launch-ros

0.19.6-1

ROS specific extensions to the launch tool

 

ros-humble-libcurl-vendor

3.1.1-1

Wrapper around libcurl, provides a fixed CMake module and an ExternalProject build of it

 

ros-humble-libg2o

2020.5.29-4

The libg2o library from OpenSLAM.org

 

ros-humble-libnabo

1.0.7-3

libnabo is a fast K Nearest Neighbour library for low-dimensional spaces

 

ros-humble-libpointmatcher

1.3.1-3

libpointmatcher is a modular ICP library, useful for robotics and computer vision

 

ros-humble-librealsense2

2.54.1-1

Library for controlling and capturing data from the Intel(R) RealSense(TM) D400 devices

 

ros-humble-libstatistics-collector

1.3.1-1

Lightweight aggregation utilities to collect statistics and measure message metrics

 

ros-humble-libyaml-vendor

1.2.2-2

Vendored version of libyaml

 

ros-humble-lifecycle-msgs

1.2.1-1

Some lifecycle related message and service definitions

 

ros-humble-map-msgs

2.1.0-3

Messages commonly used in mapping packages

 

ros-humble-message-filters

4.3.3-2

A set of ROS2 message filters which take in messages and may output those messages at a later time, based on the conditions that filter needs met

 

ros-humble-nav2*

ros-humble-navigation2

1.1.12-1

ROS2 Navigation Stack

A suite of packages

ros-humble-octomap

1.9.8-1

The OctoMap library implements a 3D occupancy grid mapping approach, providing data structures and mapping algorithms in C++

 

ros-humble-octomap-msgs

2.0.0-3

Messages and serializations / conversion for the OctoMap library

 

ros-humble-ompl

1.6.0-1

Free sampling-based motion planning library

 

ros-humble-orocos-kdl-vendor

0.2.5-1

Wrapper around orocos_kdl, providing nothing but a dependency on orocos_kdl on some systems

 

ros-humble-osrf-pycommon

2.0.2-2

Commonly needed Python modules, used by Python software developed at OSRF

 

ros-humble-pcl*

2.4.0-4

PCL (Point Cloud Library) ROS interface stack

A suite of packages.

ros-humble-pluginlib

5.1.0-3

Tools for writing and dynamically loading plugins using the ROS build infrastructure

 

ros-humble-python-cmake-module

0.10.0-2

CMake module with extra functionality for Python

 

ros-humble-python-qt-binding

1.1.2-1

Python bindings for Qt

 

ros-humble-qt-gui

2.2.2-12.2.2-1

Infrastructure for an integrated graphical user interface based on Qt

 

ros-humble-qt-gui-cpp

2.2.2-1

Foundation for C++-bindings for qt_gui and creates bindings for every generator available

 

ros-humble-random-numbers

2.0.1-3

Wrappers for generating floating point values, integers, quaternions using boost libraries

 

ros-humble-rcl*

5.3.6-1

The ROS client library common implementation

A suite of packages.

ros-humble-rcl-interfaces

1.2.1-1

The ROS client library common interfaces

 

ros-humble-rcl-logging-interface

2.3.1-1

Interface that rcl_logging backends needs to implement

 

ros-humble-rcl-logging-spdlog

2.3.1-1

rcl_logging API for an spdlog backend.

 

ros-humble-rclcpp*

16.0.7-1

The ROS client library in C++

A suite of packages.

ros-humble-rclpy*

2.4.1-1

Package containing the Python client

A suite of packages.

ros-humble-rcutils

5.1.4-1

Package containing various utility types and functions for C

 

ros-humble-realsense2-camera*

4.54.1-1

RealSense camera package allowing access to Intel SR300 and D400 3D cameras

A suite of packages.

ros-humble-resource-retriever

3.1.1-1

This package retrieves data from url-format files such as http://, ftp://, package:// file://, etc., and loads the data into memory

 

ros-humble-rmw

6.1.1-1

ROS middleware API

 

ros-humble-rmw-cyclonedds-cpp

1.3.4-1

ROS middleware interface using Eclipse CycloneDDS in C++

 

ros-humble-rmw-dds-common

1.6.0-2

Common interface between DDS implementations of ROS middleware

 

ros-humble-rmw-fastrtps-cpp*

6.2.5-1

ROS middleware interface using eProsima FastRTPS static code generation in C++

A suite of packages.

ros-humble-rmw-implementation

2.8.2-1

Proxy implementation of the ROS 2 Middleware Interface

 

ros-humble-rmw-implementation-cmake

6.1.1-1

CMake functions to discover and enumerate available implementations

 

ros-humble-robot-state-publisher

3.0.2-2

This package take the joint angles of a robot as input, and publishes the 3D poses of the robot links to tf2, using a kinematic tree model of the robot

 

ros-humble-ros-environmen

3.2.2-1

Environment variables ROS_VERSION and ROS_DISTRO

 

ros-humble-ros-workspace

1.0.2-2

Prefix level environment files for ROS 2 packages

 

ros-humble-ros2cli*

0.18.7-1

Framework for ROS2 command line tools

A suite of packages.

ros-humble-rosbag2*

0.15.8-1

C++ ROSBag2 client library

A suite of packages.

ros-humble-rosgraph-msgs

1.2.1-1

Messages relating to the ROS Computation Graph

 

ros-humble-rosidl*

3.1.5-2

API and scripts to parse .msg/.srv/.action files and convert them to .idl

A suite of packages.

ros-humble-rosidl-*-generators

1.2.0-2

A configuration package defining the default ROS interface generators

A suite of packages.

ros-humble-rosidl-typesupport*

2.0.1-1

Generate the type support for C++ messages

A suite of packages.

ros-humble-rpyutils

0.2.1-2

Package containing various utility types and functions for Python

 

ros-humble-rtabmap*

0.21.1-1

RTAB-Map's standalone library

 

ros-humble-rviz*

11.2.9-1

3D visualization tool for ROS

 

ros-humble-sensor-msgs
ros-humble-sensor-msgs-py

4.2.3-1

Some sensor data related message and service definitions

 

ros-humble-shape-msgs

4.2.3-1

Sme message definitions which describe geometric shapes

 

ros-humble-shared-queues-vendor

0.15.8-1

Vendor package for concurrent queues from moodycamel

 

ros-humble-slam-toolbox

2.6.6-1

This package provides a sped up improved slam karto with updated SDK and visualization and modification toolsets

 

ros-humble-smclib

3.0.2-3

The State Machine Compiler (SMC) from http://smc.sourceforge.net/ converts a language-independent description of a state machine into the source code to support that state machine

 

ros-humble-spdlog-vendor

1.3.1-1

Wrapper around spdlog, providing nothing but a dependency on spdlog, on some systems

 

ros-humble-sqlite3-vendor

0.15.8-1

SQLite 3 vendor package

 

ros-humble-srdfdom

2.0.4-1

Parser for Semantic Robot Description Format (SRDF)

 

ros-humble-statistics-msgs

1.2.1-1

Message definitions for reporting statistics for topics and system resources

 

ros-humble-std-msgs

4.2.3-1

Some standard message definitions

 

ros-humble-stereo-msgs

4.2.3-1

Some stereo camera related message definitions

 

ros-humble-tango-icons-vendor

0.1.1-3

Public domain Tango icons for non-linux systems (Tango Icon Library) from the Tango Desktop Project

 

ros-humble-tf2*

0.25.5-1

tf2 is the second generation of the transform library, which lets the user keep track of multiple coordinate frames over time

 

ros-humble-tinyxml-vendor

0.8.3-2

CMake shim over the tinxml library

 

ros-humble-tinyxml2-vendor

0.7.6-1

Wrapper around tinyxml2, providing nothing but a dependency on tinyxml2, on some systems

 

ros-humble-tracetools

4.1.1-1

Tracing wrapper for ROS2

 

ros-humble-trajectory-msgs

4.2.3-1

A package containing some robot trajectory message definitions

 

ros-humble-turtlebot3*

2.1.5-1

ROS 2 packages for TurtleBot3

A suite of packages.

ros-humble-unique-identifier-msgs

2.2.1-3

ROS messages for universally unique identifiers

 

ros-humble-urdf

2.6.0-2

This package contains a C++ parser for the Unified Robot Description Format (URDF), which is an XML format for representing a robot model

 

ros-humble-urdf-parser-plugin

2.6.0-2

This package contains a C++ base class for URDF parsers

 

ros-humble-urdfdom

3.0.2-2

A library to access URDFs using the DOM model

 

ros-humble-urdfdom-headers

1.0.6-2

C++ headers for URDF

 

ros-humble-urdfdom-py

1.2.1-1

Python implementation of the URDF parser.

 

ros-humble-v4l2-camera

0.6.2-1

A ROS 2 camera driver using Video4Linux2

 

ros-humble-velodyne*

2.4.0-1

Basic ROS support for the Velodyne 3D LIDARs

A suite of packages.

ros-humble-vision-opencv

3.2.1-1

Packages for interfacing ROS2 with OpenCV, a library of programming functions for real time computer vision

 

ros-humble-visualization-msgs

4.2.3-1

A package containing some visualization and interaction related message definitions

 

ros-humble-yaml-cpp-vendor

8.0.2-1

Wrapper around yaml-cpp, it provides a fixed CMake module and an ExternalProject build of it

 

ros-humble-zstd-vendor

0.15.8-1

Zstd compression vendor package, providing a dependency for Zstd

 

2.3. Emcraft ROS2 Packages

In addition to the Ubuntu ROS2 packages listed in the previous section, the Emcraft software distribution installs the following custom ROS2 packages. Those packages were developed by Emcraft to facilitate integration of the various custom software packages, developed by Emcraft and Emcraft’s partners, with the ROS2 APIs:

ros-humble-pmd-camera-msgs

0.1.0

PMD camera ROS2 message definitions

 

ros-humble-pmd-camera-ros

0.3.0

PMD camera ROS2 node

 

ros-humble-create3-slam-launch

0.3.0

Bring-up scripts and configuration for the iRobot Create3 navigation

 

2.4. Understanding ROS2 Build Process

Emcraft makes use of a separate build environment to build the custom ROS2 packages integrated into the Emcraft software distribution for the RZ/V2H SoC.

The build environment is based on the https://github.com/ros/meta-ros Yocto meta-layer and is configured to build packages for the ARM64 and AMD64 architectures. The built binary packages are then published via a private Debian package archive. The Emcraft software distribution for the RZ/V2H SoC has the PPA included to the APT source list.

3. Verifying ROS2 Layer

3.1. Running Renesas ROS2 Demo

Step through the following procedure to run the Renesas ROS2 “talker-listener” demo:

  1. Open a terminal window and login onto the RZ/V2H EVK board using ssh:

    <terminal 1>$ ssh user@<evk IP>
  2. Run the talker demo application:

    <terminal 1>$ ros2 run demo_nodes_cpp talker

    The application will start sending ‘hello world’ prints with logging:

    [INFO] [1701963711.614928791] [talker]: Publishing: 'Hello World: 1' [INFO] [1701963712.614826500] [talker]: Publishing: 'Hello World: 2' ...
  3. Open another terminal window and login onto the EVK:

  4. Verify that the chatter topic is present:

  5. Run the listener demo application:

    The application will start receiving ‘hello world’ messages with logging:

NOTE: The steps 4-5 can be done on any host with installed ROS2, not just the EVK itself. The ROS2 uses the DDS (RTPS) protocol for message transmission, which can cross host boundaries and reach other hosts on the LAN.

3.2. Using ROS2 Interface to the PMD ToF (3D) Camera

Step through the following procedure to demonstrate use of the ROS2 interface to the PMC ToF camera:

  1. Open a terminal window and login onto the RZ/V2H EVK board using ssh:

  2. Connect the PMD ToF Flexx2 camera to the EVK USB interface.

  3. Run the ROS2 camera node wrapper:

    The node will start with providing logs and information on the detected PMD camera:

  4. Open another terminal window and login onto the EVK:

  5. Verify that the camera related topics are present:

  6. Capture the camera information via the pmd_camera/info topic:

    The application will start receiving camera info message:

    Press Ctrl-C to exit the capturing.

  7. Capture the point cloud messages from the camera via the pmd_camera/cloud topic:

    The application will start receiving camera info message:

    Press Ctrl-C to exit the capturing.

NOTE: The steps 4-7 can be done on any host with installed ROS2, not just the EVK itself. The ROS2 uses the DDS (RTPS) protocol for message transmission, which can cross host boundaries and reach other hosts on the LAN.