bringing the next generation robot operating ... - micro-roskey features of ros 2 data distribution...

18
Bringing the Next Generation Robot Operating System on Deeply Embedded Autonomous Platforms Ralph Lange Robert Bosch GmbH Corporate Sector Research and Advance Engineering Renningen, Germany [email protected] Workshop on Autonomous Systems Design (ASD2019)

Upload: others

Post on 08-Mar-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing the Next Generation Robot Operating System

on Deeply Embedded Autonomous Platforms

Ralph Lange

Robert Bosch GmbH

Corporate Sector Research and Advance Engineering

Renningen, Germany

[email protected]

Workshop on Autonomous Systems Design (ASD2019)

Page 2: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Ralph Lange

Robert Bosch GmbH

Corporate Sector Research and Advance Engineering

Renningen, Germany

[email protected]

Workshop on Autonomous Systems Design (ASD2019)

Bringing ROS 2 on Microcontrollers

Page 3: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.3

What is the Robot Operating System? (ros.org)

Page 4: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.4

Plumbing

- Process management

- Communication

- Device drivers

- Data models

- Language-independence

Tools

- Visualization

- Simulation

- Data recording

- Monitoring

Capabilities

- Control

- Perception

- Planning

- Manipulation

Ecosystem

- Shared development

- Robot models

- Documentation

- Exchange

- Market

Th

e “

RO

S E

quatio

n”

by

the O

SR

F

is lic

ensed

und

er

CC

BY

3.0

The ROS Equation

Page 5: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.5

sensor and actuator drivers

Gazebo simulator MoveItnav stack

task execution

motion planning

SLAM

Gazebo simulator

real-time control

Page 6: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.6

Architectural Principles

Basic entity: Nodes (components) which exchange messages

Can be distributed across machines

Standard communication patterns

‒ Topics: Publish-Subscribe (1 – n, uni-directional, async)

‒ Services: Request-Response (n – 1, bi-directional, sync+async)

‒ Actions: Advanced Request-Response (1-1, multi-state)

Nodes comprised of callables (functions),

which are data- or time-triggered

‒ Implemented in C++, Python, …

‒ Run-to-completion

Further core functionalities: Parameters, coordinate

transformation, diagnostics, …

ROS

Master

Laser

Node

SLAM

NodeVisualization

Node

Robot‘s computer Remote laptop

Registration

Registration

Laser TopicSubscribe

Publish

Laser

Hardware

Serial link

Page 7: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.7

ROS goes for series development

Key features of ROS 2

Data Distribution Service (DDS) as middleware

Run multiple nodes in one process

Node lifecycle

Deterministic launch

ROS core functionality implemented in C

Real-time-ready core algorithms

Support of Windows and MacOS

Backed by Technical Steering Committee with Intel, Amazon,

Microsoft, Bosch, Arm, Apex.AI, Toyota Research, TARDEC,

LG Electronics, eProsima, Acutronic Robotics, …Microprocessor

Linux / Windows / MacOS

DDS MiddlewarePublish/Subscribe + Request/Response

Rich QoS mechanisms

rclpy

Application

component

Application

component

ROS Middleware Interface (rmw)

ROS Client Support Library (rcl)Core concepts like nodes, publisher

subscription, parameters, …

rclcpp

Page 8: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.8

ROS is great for developmenton microprocessors …

… but robots are networks of computing devices!

Page 9: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Why microcontrollers?

Hardware access

GPIOs, PWM generators, …

Buses such as CAN, UART, SPI I²C

Hard, low-latency real-time

Context switching in less than 100 cycles

Power saving

Linux single-board computer requires 10 to

100x more power than an MCU

Safety

Number of safety-certified RTOS available

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.9

Nav

Safety

MCU

Comm

MCU

Wire

Sensor

Wire

Sensor

Image source: Bosch PowerTools GmbH, All rights reserved

Motor

Control

MCU

Page 10: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.10

EU project OFERA (Open Framework for Embedded Robot Applications)

Our mission: Bridge the gap between MCUs

and larger processors by

Seamless integration of MCUs with ROS 2

Ease portability of ROS 2 code to MCUs

Ensure long-term maintenance of micro-ROS stack

The OFERA project is funded by the European

Union‘s Horizon 2020 research and innovation

programme under grant agreement No 780785

Page 11: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.11

New DDS-XRCE Standard

Data Distribution Service

OMG standard since 2004

DDS-XRCE for

eXtremely

Resource

Constrained

Environments

… brings DDS on MCUs

DDS-XRCE standard is advanced

by OFERA partner eProsimaThe OFERA project is funded by the European

Union‘s Horizon 2020 research and innovation

programme under grant agreement No 780785

Open-source at github.com/eProsima/Micro-XRCE-DDS

Page 12: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Two types of APIs:

1. Plain C API based on rcl

for embedded developers

2. C++ API implemented

against rclcpp interfaces

for typical ROS developer

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.12

Architecture

Microcontroller platform

RTOS NuttXAdditional

device drivers

Scheduler

extensions

RTOS abstractions

Micro XRCE-DDS Middleware

ROS Client Support Library (rcl)

ROS

Interop.

FIWARE

Interop.

Be

nchm

ark

ing

micro-ROS client library

Predictable

execution

System

modes

Embedded

transform

Application

component …Application

component

ROS Middleware Interface (rmw)

Spacer

Spacer

Spacer

Spacer

The OFERA project is funded by the European

Union‘s Horizon 2020 research and innovation

programme under grant agreement No 780785

Page 13: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.13

micro-ROS Client Library Features: System Modes

Task Handling: Orchestration of the actual

task, the straight-forward, error-free flow

Contingency Handling: Handling of task-

specific contingencies, e.g., expectable retries

and failure attempts, obstacles, low battery

System Error Handling: Handling of

exceptions, e.g., sensor/actuator failures

The OFERA project is funded by the European

Union‘s Horizon 2020 research and innovation

programme under grant agreement No 780785

Page 14: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.14

micro-ROS Client Library Features: System Modes

The OFERA project is funded by the European

Union‘s Horizon 2020 research and innovation

programme under grant agreement No 780785

Page 15: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.15

micro-ROS Client Library Features: System Modes

Introduces (sub-)systems hierarchy to ROS 2

Abstraction for hierarchical configuration,

called system modes

Mode manager manages consistent, system-wide

configuration

See micro-ros.github.io/system_modes/

inference

observation nodes

(sub-)systems

Mode Manager

model file

.yaml

subsystem 01 subsystem 02

system

lifecycle events

parameters events

mode change

request

The OFERA project is funded by the European

Union‘s Horizon 2020 research and innovation

programme under grant agreement No 780785

Page 16: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.16

micro-ROS Client Library Features: Predictable Execution

First approach enables multiple executors

per operating system process

Executors can be configured individually

using standard scheduling mechanisms

Open-sourced prototype for ROS 2

See micro-ros.github.io/real-time_executor/

ExecutorExecutor Executor

OS Scheduler

Other node

Drive-Base node

onEmergencyStopMsg

onCmdVel

publishWheelTicks

reportDiagnosticsData

The OFERA project is funded by the European

Union‘s Horizon 2020 research and innovation

programme under grant agreement No 780785

Page 17: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.17

Community Use-Case: Kobuki with STM32 F4 Cortex-M4

The OFERA project is funded by the European

Union‘s Horizon 2020 research and innovation

programme under grant agreement No 780785

micro-ROS running

- thin_kobuki_driver

- DDS-XRCE client

at less than 100KB RAM

DDS-XRCE over UDP

ROS 2 (Crystal) running

- Visualization

- Keyboard control

- odometry to TF

- DDS <-> DDS-XRCE agent

Preliminary version at github.com/micro-ROS/micro-ROS_kobuki_demo

Page 18: Bringing the Next Generation Robot Operating ... - micro-ROSKey features of ROS 2 Data Distribution Service (DDS) as middleware Run multiple nodes in one process Node lifecycle Deterministic

Bringing ROS 2 on Microcontrollers

CR/AEE1-Lange | 2019-03-29

© Robert Bosch GmbH 2016. All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.

Further information

18

The OFERA project is funded by the European

Union‘s Horizon 2020 research and innovation

programme under grant agreement No 780785

https://micro-ros.github.io/

+ Join discussion in ROS 2 Embedded SIG

at discourse.ros.org/c/embedded