Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

 

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.

Understanding ROS2 Layer

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.

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

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

This package provides a set of simple math utilities to work with angles.

ros-humble-behaviortree-cpp-v3

3.8.5-1

This package provides 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

A package containing message and service definitions for types defined in the OMG IDL Platform Specific Model.

ros-humble-camera-calibration-parsers

3.1.7-1

camera_calibration_parsers contains routines for reading and writing camera calibration parameters.

ros-humble-camera-info-manager

3.1.7-1

his package provides a C++ interface for camera calibration information.

ros-humble-cartographer*

2.0.9002-2

Cartographer is a system that provides 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

The class_loader package is 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

A package containing 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

ontrol_msgs contains 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

This contains CvBridge, which converts between ROS2 Image messages and OpenCV images.

ros-humble-cyclonedds

0.10.3-1

Eclipse Cyclone DDS is a very 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

A package containing some diagnostics related message and service definitions.

ros-humble-diagnostic-updater

3.1.2-1

diagnostic_updater contains 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_IDs across multiple processes

ros-humble-dwb*

1.1.12-1

DWB controller

A suite of packages.

ros-humble-dynamixel-sdk

3.7.60-1

This package is wrapping version of ROBOTIS Dynamixel SDK for ROS 2.

ros-humble-eigen-stl-containers

1.0.0-4

This package provides 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

Contains 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

Provide 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

This package contains generic definitions of geometric shapes and bodies.

ros-humble-geometry-msgs

4.2.3-1

A package containing some geometry related message definitions.

ros-humble-geometry2

0.25.5-1

A metapackage 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

This package provides the Ignition CMake 2.x library.

ros-humble-ignition-math6-vendor

0.0.2-2

This package provides the 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

The 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, it provides a fixed CMake module and an ExternalProject build of it.

ros-humble-libg2o

2020.5.29-4

The libg2o library from http://openslam.org/g2o.html

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

A package containing some lifecycle related message and service definitions.

ros-humble-map-msgs

2.1.0-3

This package defines 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

This package provides messages and serializations / conversion for the OctoMap library.

ros-humble-ompl

1.6.0-1

OMPL is a 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

The pluginlib package provides tools for writing and dynamically loading plugins using the ROS build infrastructure.

ros-humble-python-cmake-module

0.10.0-2

Provide CMake module with extra functionality for Python.

ros-humble-python-qt-binding

1.1.2-1

This stack provides Python bindings for Qt.

ros-humble-qt-gui

2.2.2-12.2.2-1

qt_gui provides the infrastructure for an integrated graphical user interface based on Qt.

ros-humble-qt-gui-cpp

2.2.2-1

qt_gui_cpp provides the foundation for C++-bindings for qt_gui and creates bindings for every generator available.

ros-humble-random-numbers

2.0.1-3

This library contains 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

Implementation of 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

Contains the ROS middleware API.

ros-humble-rmw-cyclonedds-cpp

1.3.4-1

Implement the ROS middleware interface using Eclipse CycloneDDS in C++.

ros-humble-rmw-dds-common

1.6.0-2

Define a common interface between DDS implementations of ROS middleware.

ros-humble-rmw-fastrtps-cpp*

6.2.5-1

Implement the 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 which can 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

The package provides the environment variables ROS_VERSION and ROS_DISTRO.

ros-humble-ros-workspace

1.0.2-2

Provides the prefix level environment files for ROS 2 packages.

ros-humble-ros2cli*

0.18.7-1

Framework for ROS 2 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

A package containing some sensor data related message and service definitions.

ros-humble-shape-msgs

4.2.3-1

A package containing some 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

A package containing some standard message definitions.

ros-humble-stereo-msgs

4.2.3-1

A package containing some stereo camera related message definitions

ros-humble-tango-icons-vendor

0.1.1-3

tango_icons_vendor provides the 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 ROS 2.

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.

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

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.

Verifying ROS2 Layer

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:

    <terminal 2>$ ssh user@<evk IP>
  4. Verify that the chatter topic is present:

    <terminal 2>$ ros2 topic list
    /chatter
    /parameter_events
    /rosout
  5. Run the listener demo application:

    <terminal 2>$ ros2 run demo_nodes_cpp listener

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

    [INFO] [1701963856.530959402] [listener]: I heard: [Hello World: 7]
    [INFO] [1701963857.530830236] [listener]: I heard: [Hello World: 8]
    ...

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.

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:

    <terminal 1>$ ssh user@<evk IP>
  2. Connect the PMD ToF Flexx2 camera to the EVK USB interface.

  3. Run the ROS2 camera node wrapper:

    <terminal 1>$ ros2 launch pmd_camera_ros pmd_camera.launch.py
    

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

    [INFO] [launch]: All log files can be found below /home/user/.ros/log/2023-12-07-15-45-20-816215-rzv2hevkalpha-2133
    [INFO] [launch]: Default logging verbosity is set to INFO
    [INFO] [component_container-1]: process started with pid [2145]
    [component_container-1] [INFO] [1701963921.917451308] [pmd_camera_container]: Load Library: /opt/ros/humble/lib/libpmd_camera_ros.so
    [component_container-1] [INFO] [1701963921.995811892] [pmd_camera_container]: Found class: rclcpp_components::NodeFactoryTemplate<pmd_camera_ros::CameraNode>
    [component_container-1] [INFO] [1701963921.996060558] [pmd_camera_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<pmd_camera_ros::CameraNode>
    [component_container-1] [INFO] [1701963922.265678142] [pmd_camera_node]: created camera Flexx2
    [component_container-1] [INFO] [1701963922.486626934] [pmd_camera_node]: current use case: Mode_9_5fps
    [component_container-1] [INFO] [1701963922.486869434] [pmd_camera_node]: current frame rate: 5
    [component_container-1] [INFO] [1701963922.486935517] [pmd_camera_node]: set auto expo mode
    [component_container-1] [INFO] [1701963922.486992184] [pmd_camera_node]: start capturing
    [INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/pmd_camera_node' in container '/pmd_camera_container'
    [component_container-1] [INFO] [1701963922.514789934] [pmd_camera_container]: Load Library: /opt/ros/humble/lib/libstatic_transform_broadcaster_node.so
    [component_container-1] [INFO] [1701963922.520449475] [pmd_camera_container]: Found class: rclcpp_components::NodeFactoryTemplate<tf2_ros::StaticTransformBroadcasterNode>
    [component_container-1] [INFO] [1701963922.520667517] [pmd_camera_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<tf2_ros::StaticTransformBroadcasterNode>
    [INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/pmd_camera_transform' in container '/pmd_camera_container'
  4. Open another terminal window and login onto the EVK:

    <terminal 2>$ ssh user@<evk IP>
  5. Verify that the camera related topics are present:

    <terminal 2>$ ros2 topic list
    /parameter_events
    /pmd_camera/cloud
    /pmd_camera/info
    /pmd_camera/state
    /rosout
    /tf_static
  6. Capture the camera information via the pmd_camera/info topic:

    <terminal 2>$ ros2 topic echo /pmd_camera/info

    The application will start receiving camera info message:

    id: 8A30-9411-1AC8-3634
    name: Flexx2
    use_cases:
    - Mode_5_15fps
    - Mode_5_30fps
    - Mode_5_45fps
    - Mode_5_60fps
    - Mode_9_10fps
    - Mode_9_15fps
    - Mode_9_20fps
    - Mode_9_30fps
    - Mode_9_5fps
    info:
    - UVC_FIRMWARE_VERSION:arctic_v0.17.2
    - ARCTIC_FIRMWARE_VERSION:arctic_v0.17.2
    - ARCTIC_FIRMWARE_TYPE:Amundsen
    - BRIDGE_TYPE:Amundsen
    - USB_SPEED:super (standard USB3 speed)
    - MODULE_IDENTIFIER:03000000000000000000000000000094
    - MODULE_IDENTIFIER_HASH:840018170
    - MODULE_SERIAL:8A30-9411-1AC8-3634
    - MODULE_SUFFIX:PMDTOF__________
    - IMAGER:IRS2381C_B11
    - IMAGER_AS_BRIDGE_TYPE:M2453_SPI
    - PROCESSING_NAME:Spectre
    - PROCESSING_VERSION:6.6.0.3511
    - CALIBRATION_SENSOR_SERIAL:8A30-9411-1AC8-3634
    width: 224
    height: 172
    ---

    Press Ctrl-C to exit the capturing.

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

    <terminal 2>$ ros2 topic echo /pmd_camera/cloud

    The application will start receiving camera info message:

    header:
      stamp:
        sec: 1701963958
        nanosec: 309768000
      frame_id: pmd_optical_frame
    height: 1
    width: 12099
    fields:
    - name: x
      offset: 0
      datatype: 7
      count: 1
    - name: y
      offset: 4
      datatype: 7
      count: 1
    - name: z
      offset: 8
      datatype: 7
      count: 1
    is_bigendian: false
    point_step: 16
    row_step: 193584
    data:
    - 191
    - 104
    ...
    - '...'
    is_dense: true
    ---

    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.

  • No labels