ros 2 update 2016...rti connext eprosima fast rtps prismtech opensplice connext dynamic 25 default...

74
ROS 2 Update Deanna Hood, William Woodall October 8, 2016 ROSCon 2016 Seoul https://goo.gl/oCHR7H

Upload: others

Post on 16-Jul-2020

27 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

ROS 2 Update

Deanna Hood, William WoodallOctober 8, 2016ROSCon 2016 Seoul

https://goo.gl/oCHR7H

Page 2: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Contents

https://goo.gl/oCHR7H

ROS 2 overview

Overview of changes in the last year

Details of select features

Experience porting Turtlebot

Roadmap

2

Page 3: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

ROS as we know it

3

Page 4: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

4

● Research applications● High-volume sensors● Complex kinematics● Lots of computation power● Ideal network connectivity

Page 5: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

5

● Multi-robot system● Small processors● Battery power● Unreliable network

connectivity

Page 6: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Goals of ROS 2

6

Page 7: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

ROS 2

7

Page 8: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

ROS 2

8

+ ROS usability

less time spent here

means more time to spend here

Page 9: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Architectural overview

User code

ROS client library API

9

Page 10: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Architectural overview

User code

ROS client library API

DDS implementation

= discovery + serialization + transport

10

Page 11: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

ROSCon 2015 demos

Quality of Service demo for lossy networks using ROS 2

Efficient intra-process communication using ROS 2

Bridge communication between ROS 1 and ROS 2

ROS 2 on “bare-metal” microcontrollers

Real-time safe code using ROS 2

11

https://github.com/ros2/ros2/wiki/Tutorials

Page 12: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

What’s new this year

12

Page 13: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Changes since ROSCon 2015: user-facing

13

Windows feature parity (alpha 2)

Partial port of tf2 including the core libraries (alpha 3)

Python client library (alpha 4)

32-bit and 64-bit ARM added as experimentally supported

platforms (alpha 5)

Node “wait for service” functionality (alpha 6)

Fast RTPS added as a supported middleware

(alpha 3)

Turtlebot demo using ported code from ROS 1 (alpha 7)

Page 14: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

● Support for C messages (as opposed to C++) (alphas 4, 5, 7)

● Improved support for large messages (images) in both Connext and Fast-RTPS (alpha 6, alpha 7)

● ROS Client Library implementation (rcl) (from alpha 3, services from alpha 5)

● Refactored rclcpp to use rcl (alpha 6)

● Graph events (alpha 7?)

Changes since ROSCon 2015

14

Windows feature parity (alpha 2)

Python client library (alpha 4)

32- and 64-bit ARM experimentally supported

platforms (alpha 5)

Node “wait for service” functionality (alpha 6)

Turtlebot demo using ported code from ROS 1 (alpha 7)

Partial port of core tf2 libraries (alpha 3)

Fast RTPS supported as middleware (alpha 3)

Page 15: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

● Support for C messages (as opposed to C++) (alphas 4, 5, 7)

● Improved support for large messages (images) in both Connext and Fast-RTPS (alpha 6, alpha 7)

● ROS Client Library implementation (rcl) (from alpha 3, services from alpha 5)

● Refactored rclcpp to use rcl (alpha 6)

● Graph events (alpha 7?)

Changes since ROSCon 2015

15

Support for C messages (as opposed to C++) (alphas 4, 5, 7)

Improved support for large messages (images) with Connext and Fast RTPS (alpha 6, alpha 7)

ROS graph events (alpha 6)

Refactored C++ client library to use rcl (alpha 6)

ROS Client Library implementation (rcl) (from alpha 3, services alpha 5)

Windows feature parity (alpha 2)

Python client library (alpha 4)

32- and 64-bit ARM experimentally supported

platforms (alpha 5)

Node “wait for service” functionality (alpha 6)

Turtlebot demo using ported code from ROS 1 (alpha 7)

Partial port of core tf2 libraries (alpha 3)

Fast RTPS supported as middleware (alpha 3)

Page 16: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

● Support for C messages (as opposed to C++) (alphas 4, 5, 7)

● Improved support for large messages (images) in both Connext and Fast-RTPS (alpha 6, alpha 7)

● ROS Client Library implementation (rcl) (from alpha 3, services from alpha 5)

● Refactored rclcpp to use rcl (alpha 6)

● Graph events (alpha 7?)

Changes since ROSCon 2015

16

Windows feature parity (alpha 2)

Python client library (alpha 4)

32- and 64-bit ARM experimentally supported

platforms (alpha 5)

Node “wait for service” functionality (alpha 6)

Turtlebot demo using ported code from ROS 1 (alpha 7)

Support for C messages (as opposed to C++) (alphas 4, 5, 7)

Improved support for large messages (images) with Connext and Fast RTPS (alpha 6, alpha 7)

ROS graph events (alpha 6)

Refactored C++ client library to use rcl (alpha 6)

ROS Client Library implementation (rcl) (from alpha 3, services alpha 5)

Fast RTPS supported as middleware (alpha 3)

Partial port of core tf2 libraries (alpha 3)

Page 17: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

● Support for C messages (as opposed to C++) (alphas 4, 5, 7)

● Improved support for large messages (images) in both Connext and Fast-RTPS (alpha 6, alpha 7)

● ROS Client Library implementation (rcl) (from alpha 3, services from alpha 5)

● Refactored rclcpp to use rcl (alpha 6)

● Graph events (alpha 7?)

Changes since ROSCon 2015

17

Windows feature parity (alpha 2)

Python client library (alpha 4)

32- and 64-bit ARM experimentally supported

platforms (alpha 5)

Node “wait for service” functionality (alpha 6)

Turtlebot demo using ported code from ROS 1 (alpha 7)

Partial port of core tf2 libraries (alpha 3)

Support for C messages (as opposed to C++) (alphas 4, 5, 7)

Improved support for large messages (images) with Connext and Fast RTPS (alpha 6, alpha 7)

ROS graph events (alpha 6)

Refactored C++ client library to use rcl (alpha 6)

ROS Client Library implementation (rcl) (from alpha 3, services alpha 5)

Fast RTPS supported as middleware (alpha 3)

Page 18: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

● Support for C messages (as opposed to C++) (alphas 4, 5, 7)

● Improved support for large messages (images) in both Connext and Fast-RTPS (alpha 6, alpha 7)

● ROS Client Library implementation (rcl) (from alpha 3, services from alpha 5)

● Refactored rclcpp to use rcl (alpha 6)

● Graph events (alpha 7?)

Changes since ROSCon 2015

18

Windows feature parity (alpha 2)

Python client library (alpha 4)

32- and 64-bit ARM experimentally supported

platforms (alpha 5)

Node “wait for service” functionality (alpha 6)

Turtlebot demo using ported code from ROS 1 (alpha 7)

Partial port of core tf2 libraries (alpha 3)

Support for C messages (as opposed to C++) (alphas 4, 5, 7)

Improved support for large messages (images) with Connext and Fast RTPS (alpha 6, alpha 7)

ROS graph events (alpha 6)

Refactored C++ client library to use rcl (alpha 6)

ROS Client Library implementation (rcl) (from alpha 3, services alpha 5)

Fast RTPS supported as middleware

(alpha 3)

Page 19: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Architectural overview

User code

ROS client library API

DDS impl A DDS impl B . . .

19

or or

Page 20: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Architectural overview

User code

ROS client library API

DDS impl A DDS impl B . . .

20

or or

DDS agnostic

ROS agnostic

ROS middleware API

Page 21: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Architectural overview

User code

ROS client library API

21

DDS agnostic

ROS agnostic

ROS middleware API

. . .or orDDS impl A DDS impl B

Page 22: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Architectural overview

User code

ROS client library API

. . .

22

or or

ROS middleware API

DDS impl A DDS impl B

RMW impl BRMW impl A . . .

DDS agnostic

ROS agnostic

Page 23: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Architectural overview

User code

ROS client library API

. . .

23

or or

ROS middleware API

Fast RTPS DDS impl B

RMW impl BFast RTPS RMW impl . . .

DDS agnostic

ROS agnostic

Page 24: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Supported vendors until October 2016

User code

ROS client library API

ROS middleware API

RTI Connext

eProsima Fast RTPS

PrismTechOpenSplice

Connext Dynamic

24

Page 25: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Supported vendors since October 2016

User code

ROS client library API

ROS middleware API

RTI Connext

eProsima Fast RTPS

PrismTechOpenSplice

Connext Dynamic

25

Development pausedDefault

Page 26: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Why eProsima’s Fast RTPS?

● Changed the license June 2016:

○ LGPL -> Apache 2.0

● Code on GitHub

○ https://github.com/eProsima/Fast-RTPS

● Responsive to issues and pull requests

● Added features needed to support ROS 2

○ Fragmentation of large messages

○ Graph change notifications

● CMake buildsystem

26

Page 27: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

● Support for C messages (as opposed to C++) (alphas 4, 5, 7)

● Improved support for large messages (images) in both Connext and Fast-RTPS (alpha 6, alpha 7)

● ROS Client Library implementation (rcl) (from alpha 3, services from alpha 5)

● Refactored rclcpp to use rcl (alpha 6)

● Graph events (alpha 7?)

Changes since ROSCon 2015

27

Windows feature parity (alpha 2)

Python client library (alpha 4)

32- and 64-bit ARM experimentally supported

platforms (alpha 5)

Node “wait for service” functionality (alpha 6)

Turtlebot demo using ported code from ROS 1 (alpha 7)

Partial port of core tf2 libraries (alpha 3)

Support for C messages (as opposed to C++) (alphas 4, 5, 7)

Improved support for large messages (images) with Connext and Fast RTPS (alpha 6, alpha 7)

ROS graph events (alpha 6)

Refactored C++ client library to use rcl (alpha 6)

ROS Client Library implementation (rcl) (from alpha 3, services alpha 5)

Fast RTPS supported as middleware (alpha 3)

Page 28: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

ROS client libraries

28

talker.py listener.cpp

Page 29: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

ROS client libraries

29

talker.py listener.cpp

C++ ROS client library

Python ROS client library

Page 30: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

ROS client libraries

User Code

ROS middleware interface(rmw)

DDS vendor

30

rclcpp rclpy

Page 31: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

ROS client libraries

User Code

ROS middleware interface(rmw)

DDS vendor

Consolelogging

Names & namespaces

Time

Threading model

Parameters

Intra-process communication

31

rclcpp rclpy

Page 32: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

ROS client libraries

User Code

ROS middleware interface(rmw)

DDS vendor

Consolelogging

Names & namespaces

Time

Threading model

Parameters

Intra-process communication

32

rclcpp rclpy

Page 33: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

ROS client libraries

User Code

rclcpp

Consolelogging

Names & namespaces Time

Threading model

Parameters

Intra-process communication

33

rclpy

ROS middleware interface(rmw)

DDS vendor

ROS client library (rcl)

Page 34: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

ROS client libraries

node.py

rclpy

node.cpp

rclcpp

node.cs

rclcs . . .

rmw

DDS vendor

rcl

34

node.java

rcljava

https://github.com/firesurfer/rclcs

https://github.com/esteve/ros2_java

Page 35: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

35

publish subscribe/chatter listener.cpptalker.py

Consider this talker-listener example:

Page 36: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

36

publish subscribe listener.cpptalker.py /chatter

rclpy.init()

node = rclpy.create_node('talker')

chatter_pub = node.create_publisher(

std_msgs.msg.String, 'chatter')

msg = std_msgs.msg.String()

i = 1

while True:

msg.data = 'Hello World: {0}'.format(i)

i += 1

print('Publishing: "{0}"'.format(msg.data))

chatter_pub.publish(msg)

Page 37: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

37

publish subscribe listener.cpp/chatter

rclpy.init()

node = rclpy.create_node('talker')

chatter_pub = node.create_publisher(

std_msgs.msg.String, 'chatter')

msg = std_msgs.msg.String()

i = 1

while True:

msg.data = 'Hello World: {0}'.format(i)

i += 1

print('Publishing: "{0}"'.format(msg.data))

chatter_pub.publish(msg)

rclpy

talker.py

Page 38: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

38

publish subscribe/chatter listener.cppstatic PyObject *

rclpy_publish(PyObject * Py_UNUSED(self), PyObject * args) {

PyObject * pypublisher; // populated from args

PyObject * pymsg; // populated from args

// ...

void * raw_ros_message = convert_from_py(pymsg);

rcl_ret_t ret = rcl_publish(publisher, raw_ros_message);

if (ret != RCL_RET_OK) {

// error handling

}

// ...

}

rclpy

talker.py

Page 39: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

39

publish subscribe/chatter listener.cppstatic PyObject *

rclpy_publish(PyObject * Py_UNUSED(self), PyObject * args) {

PyObject * pypublisher; // populated from args

PyObject * pymsg; // populated from args

// ...

void * raw_ros_message = convert_from_py(pymsg);

rcl_ret_t ret = rcl_publish(publisher, raw_ros_message);

if (ret != RCL_RET_OK) {

// error handling

}

// ...

}

rclpy

talker.py

rcl

Page 40: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

40

publish subscribe/chatter listener.cpprcl_ret_t

rcl_publish(

const rcl_publisher_t * publisher,

const void * ros_message)

{

// ...

ret = rmw_publish(publisher->impl->rmw_handle, ros_message);

if (ret != RMW_RET_OK) {

// error handling

}

return RCL_RET_OK;

}

rclpy

talker.py

rcl

Page 41: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

41

publish subscribe/chatter

rclpy

rcl

rmw

listener.cpprcl_ret_t

rcl_publish(

const rcl_publisher_t * publisher,

const void * ros_message)

{

// ...

ret = rmw_publish(publisher->impl->rmw_handle, ros_message);

if (ret != RMW_RET_OK) {

// error handling

}

return RCL_RET_OK;

}

talker.py

Page 42: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

42

publish subscribe/chatter

rmw_ret_trmw_publish( const rmw_publisher_t * publisher, const void * ros_message);

rclpy

rcl

rmw

listener.cpptalker.py

Page 43: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

43

publish subscribe/chatter

rclpy

rcl

rmw implrmw

listener.cpptalker.py

DDS Vendor DDS VendorIPC

Page 44: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

44

publish subscribe/chatter

rclpy

rcl

Fast RTPS

rmw_fastrtps_cpp

rmw

listener.cpp

Fast RTPSIPC

talker.py

Page 45: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

45

publish subscribe listener.cpp/chatter

rclpy

rcl

Fast RTPSrmw_fastrtps_cpp

rmw

rmw_ret_t

rmw_publish(

const rmw_publisher_t * publisher, const void * ros_message)

{

// ...

eprosima::fastcdr::FastBuffer buffer;

eprosima::fastcdr::Cdr ser(buffer);

PublisherImpl * info = (PublisherImpl *)publisher->data;

if(_serialize_ros_message(ros_message, ser, /* ... */)) {

if(info->publisher_->write(&ser)) // Fast RTPS publisher

return RMW_RET_OK;

else

// ... publish error handling

}

else

// ... serialize error handling

}

talker.py

Page 46: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

46

publish subscribe listener.cpp/chatter

rclpy

rcl

Fast RTPSrmw_fastrtps_cpp

rmw

rmw_ret_t

rmw_publish(

const rmw_publisher_t * publisher, const void * ros_message)

{

// ...

eprosima::fastcdr::FastBuffer buffer;

eprosima::fastcdr::Cdr ser(buffer);

PublisherImpl * info = (PublisherImpl *)publisher->data;

if(_serialize_ros_message(ros_message, ser, /* ... */)) {

if(info->publisher_->write(&ser)) // Fast RTPS publisher

return RMW_RET_OK;

else

// ... publish error handling

}

else

// ... serialize error handling

}

talker.py

Page 47: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

47

publish subscribe/chatter

rclpy

rcl

rmw_fastrtps_cpp

rmw“Hello World”

listener.cpptalker.py

Fast RTPS Fast RTPSIPC

Page 48: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

48

rmw_publish()

publish subscribe/chatter listener.cpp

rclpy

talker.py

rcl

Fast RTPSrmw_fastrtps_cpp

Fast RTPS Fast RTPS

rmw“Hello World”

IPC

void

chatter_callback(const std_msgs::msg::String::SharedPtr msg) {

std::cout << "I heard: [" << msg->data << "]" << std::endl;

}

int

main(int argc, char * argv[]) {

rclcpp::init(argc, argv);

auto node = rclcpp::Node::make_shared("listener");

auto sub = node->create_subscription<std_msgs::msg::String>(

"chatter", chatter_callback, rmw_qos_profile_default);

rclcpp::spin(node);

}

Page 49: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

49

rmw_publish()

publish

Fast RTPS Fast RTPSIPC

subscribe/chatter

“Hello World”

rclpy

talker.py

rcl

Fast RTPSrmw_fastrtps_cpp

listener.cpp

rmw

void

chatter_callback(const std_msgs::msg::String::SharedPtr msg) {

std::cout << "I heard: [" << msg->data << "]" << std::endl;

}

int

main(int argc, char * argv[]) {

rclcpp::init(argc, argv);

auto node = rclcpp::Node::make_shared("listener");

auto sub = node->create_subscription<std_msgs::msg::String>(

"chatter", chatter_callback, rmw_qos_profile_default);

rclcpp::spin(node);

}

rclcpp

Page 50: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

50

rmw_publish()

publish subscribe/chatter

rclpy

talker.py

“Hello World”

IPC

rcl

Fast RTPSrmw_fastrtps_cpp

rmw

Fast RTPS Fast RTPS

listener.cpp

rclcpp

rclcpp::spin()

Does subscription have data?

execute_subscription()Yes

wait for “work”

Page 51: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

51

publish subscribe/chatter

rclpy

rcl

rmw_fastrtps_cpp

rmwSub

scrip

tion h

as da

ta

listener.cpptalker.py

“Hello World”

IPCFast RTPS Fast RTPS

Page 52: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

52

rmw_publish()

publish subscribe/chatter

rclpy

“Hello World”

IPC

talker.py

rcl

Fast RTPSrmw_fastrtps_cpp

rmw

Fast RTPS Fast RTPS

listener.cpp

rclcpp

rclcpp::spin()

Does subscription have data?

execute_subscription()Yes

wait for “work”

Page 53: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

53

rmw_publish()

publish subscribe/chatter

“Hello World”

IPC

rclpy

talker.py

rcl

Fast RTPSrmw_fastrtps_cpp

rmw

Fast RTPS Fast RTPS

listener.cpp

rclcpp

rclcpp::spin()

wait for “work”

Does subscription have data?

execute_subscription()Yes

void execute_subscription(/* ... */ subscription)

{

std::shared_ptr<void> message =

subscription->create_message();

auto ret = rcl_take(

subscription->get_subscription_handle(),

message.get(), /* ... */);

if (ret == RCL_RET_OK) {

subscription->handle_message(message, /* ... */);

} else { /* error handling */ }

}

Page 54: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

54

rmw_publish()

publish subscribe/chatter

rclpy

talker.py

rcl

“Hello World”

IPC

Fast RTPSrmw_fastrtps_cpp

Fast RTPS Fast RTPS

listener.cpp

rmw

rclcpp

rclcpp::spin()

wait for “work”

Does subscription have data?

execute_subscription()Yes

rcl

void execute_subscription(/* ... */ subscription)

{

std::shared_ptr<void> message =

subscription->create_message();

auto ret = rcl_take(

subscription->get_subscription_handle(),

message.get(), /* ... */);

if (ret == RCL_RET_OK) {

subscription->handle_message(message, /* ... */);

} else { /* error handling */ }

}

Page 55: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

“Hello World”

IPC

55

rmw_publish()

publish subscribe/chatter

rclpy

talker.py

rcl

Fast RTPS Fast RTPS

Fast RTPSrmw_fastrtps_cpp

listener.cpp

rmw

rcl_ret_t

rcl_take(

const rcl_subscription_t * subscription,

void * ros_message, /* ... */)

{

// ...

bool taken = false;

rmw_ret_t ret = rmw_take(

subscription->impl->rmw_handle, ros_message, &taken);

if (ret != RMW_RET_OK) {

// ... error handling

}

if (!taken) {

return RCL_RET_SUBSCRIPTION_TAKE_FAILED;

}

return RCL_RET_OK;

}

rclcpp

rcl

Page 56: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

56

rmw_publish()

publish

“Hello World”

IPC

subscribe/chatter

rclpy

talker.py

rcl

Fast RTPS

listener.cpp

rmw_fastrtps_cpp

Fast RTPS Fast RTPS

rmw

rcl_ret_t

rcl_take(

const rcl_subscription_t * subscription,

void * ros_message, /* ... */)

{

// ...

bool taken = false;

rmw_ret_t ret = rmw_take(

subscription->impl->rmw_handle, ros_message, &taken);

if (ret != RMW_RET_OK) {

// ... error handling

}

if (!taken) {

return RCL_RET_SUBSCRIPTION_TAKE_FAILED;

}

return RCL_RET_OK;

}

rclcpp

rcl

rmw

Page 57: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

57

“Hello World”

IPC

publish subscribe/chatter

rclpy

rcl

rmw_fastrtps_cpp

rmw

rmw_ret_t

rmw_take(

const rmw_subscription_t * subscription,

void * ros_message,

bool * taken);

listener.cpptalker.py

rclcpp

rcl

rmw

Fast RTPS Fast RTPS

Page 58: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

58

rmw_publish()

publish subscribe/chatter

rclpy

talker.py

rcl

Fast RTPS“Hello World”

IPC

rmw_fastrtps_cpp

rmw

Fast RTPS Fast RTPS

rclcpp

rcl

listener.cpp

rmw_take()

rmw_ret_t

rmw_take(

const rmw_subscription_t * subscription,

void * ros_message, bool * taken)

{

*taken = false;

SubscriptionImpl * info = (SubscriptionImpl *)subscription->data;

eprosima::fastcdr::FastBuffer buffer;

SampleInfo_t sinfo;

if(info->subscriber_->takeNextData(&buffer, &sinfo)) {

if(sinfo.sampleKind == ALIVE) { // actually contains data

_deserialize_ros_message(&buffer, ros_message, /* ... */);

*taken = true;

}

}

}

rmw_fastrtps_cpp

rmw

Page 59: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

59

rmw_publish()

publish subscribe/chatter

“Hello World”

IPC

rclpy

talker.py

rcl

Fast RTPSrmw_fastrtps_cpp

rmw

rclcpp

rcl

Fast RTPS Fast RTPS

rmw_take()

listener.cpprmw_ret_t

rmw_take(

const rmw_subscription_t * subscription,

void * ros_message, bool * taken)

{

*taken = false;

SubscriptionImpl * info = (SubscriptionImpl *)subscription->data;

eprosima::fastcdr::FastBuffer buffer;

SampleInfo_t sinfo;

if(info->subscriber_->takeNextData(&buffer, &sinfo)) {

if(sinfo.sampleKind == ALIVE) { // actually contains data

_deserialize_ros_message(&buffer, ros_message, /* ... */);

*taken = true;

}

}

}

rmw_fastrtps_cpp

rmw

Page 60: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Tracing talker-listener

60

publish subscribe/chatter

rclpy

talker.py

rcl

rmw_fastrtps_cpp

rmw

rclcpp

rcl

rmw_fastrtps_cpp

rmw

void

chatter_callback(const std_msgs::msg::String::SharedPtr msg) {

std::cout << "I heard: [" << msg->data << "]" << std::endl;

}

listener.cpp

“Hello World”

IPCFast RTPS Fast RTPS

Page 61: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

● Support for C messages (as opposed to C++) (alphas 4, 5, 7)

● Improved support for large messages (images) in both Connext and Fast-RTPS (alpha 6, alpha 7)

● ROS Client Library implementation (rcl) (from alpha 3, services from alpha 5)

● Refactored rclcpp to use rcl (alpha 6)

● Graph events (alpha 7?)

Changes since ROSCon 2015

61

Support for C messages (as opposed to C++) (alphas 4, 5, 7)

Improved support for large messages (images) with Connext and Fast RTPS (alpha 6, alpha 7)

ROS graph events (alpha 6)

Refactored C++ client library to use rcl (alpha 6)

ROS Client Library implementation (rcl) (from alpha 3, services alpha 5)

Windows feature parity (alpha 2)

Python client library (alpha 4)

32- and 64-bit ARM experimentally supported

platforms (alpha 5)

Node “wait for service” functionality (alpha 6)

Turtlebot demo using ported code

from ROS 1 (alpha 7)

Partial port of core tf2 libraries (alpha 3)

Fast RTPS supported as middleware (alpha 3)

Page 62: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Porting of Turtlebot to ROS 2

62

● Minimum viable demo (https://github.com/ros2/turtlebot2_demo)

○ Kobuki driver

○ Astra driver

○ Joystick driver

○ Follower node

https://orbbec3d.com/ http://kobuki.yujinrobot.com/

Page 63: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Porting of Turtlebot to ROS 2

63

● Kobuki driver

○ Used existing non-ROS dependencies

○ Replaced ROS 1 wrapper with ROS 2 wrapper

● Astra driver

○ Forked and ported existing ROS 1 driver to ROS 2

● Joystick driver

○ Wrote a simple joystick program from scratch (no porting)

● Follower node

○ Forked and ported existing ROS 1 node

● ROS 1 ⇔ ROS 2 bridge for visualization

Page 64: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Porting Experiments

64

● ROS 1 “shim” (https://github.com/codebot/ros1_shim)

○ Some things (like the astra driver) needed some deep

features (e.g. custom serialization)

○ Hard to find the right strata in the interfaces to shim

Page 65: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Porting Experiments

65

● catment (https://github.com/ros2/ros2/wiki/catment)

○ Find ways to modify each to make them more similar

■ In order to minimize conversion effort

○ Mixing catkin (ROS 1) and ament (ROS 2)

■ To avoid converting unless necessary

○ Non-homogeneous workspace

■ Building catkin and ament packages at the same time

○ Ideal: one build tool for both

■ ament vs catkin not unlike catkin vs plain cmake

Page 66: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

● catment continued...

○ Conceptual details to work out:

■ setup.*sh files in root of workspace

● Currently required by catkin

● Optional for ament

■ devel-space

● ament uses “symlink install” instead

■ Avoiding confusion in documentation

○ Make catkin more like ament? (and vice versa?)

Porting Experiments

66

Page 67: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Roadmap

67

● Beta 1 - End of the Year○ Composition

■ may use pluginlib and class_loader from ROS 1 for C++○ QoS benchmarks

■ for example: unreliable comms, illustrated by wifi out-and-back○ Design documents○ Tutorials and examples○ "rostopic list", "rostopic echo", and friends○ Bridging services to/from ROS1 (in addition to topics)

● Nice to have by Beta 1:○ Console logging

■ think “rosconsole”○ Orchestration

■ think “roslaunch + verification & dynamic behavior”

Page 68: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Pointers

68

● ROS 2 wiki: https://github.com/ros2/ros2/wiki○ Installation instructions○ Tutorials○ How to contribute○ Current status○ Roadmap

● Developer docs (work in progress):○ https://github.com/ros2/ros_core_documentation/blob/master/source/developer_overview.rst

○ Architecture overview○ Links to API docs

● Design documents: http://design.ros2.org/○ Articles about various subjects○ On going discussions on the issue tracker:

https://github.com/ros2/design

Page 69: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

Questions

69

https://goo.gl/oCHR7H

Page 70: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

“Hour Glass” Pattern

{client libraries}

rmw

{DDS vendor}

70

API size

LOC

{rmw impl}

rcl impl

rcl

Page 71: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

“Hour Glass” Pattern - C++ with Fast RTPS

rclcpp

rmw

Fast RTPS

71

API size

LOC

rmw_fastrtps_cpp

rcl impl

rcl

Page 72: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

“Hour Glass” Pattern - Python with RTI Connext

rclpy

rmw

RTI Connext

72

API size

LOC

rmw_connext_cpp

rcl impl

rcl

Page 73: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

“Hour Glass” Pattern - Python with RTI Connext

rclpy

rmw

RTI Connext

73

API size

LOC

rmw_connext_cpp

rcl impl

rcl

Common

Page 74: ROS 2 Update 2016...RTI Connext eProsima Fast RTPS PrismTech OpenSplice Connext Dynamic 25 Default Development paused Why eProsima’s Fast RTPS? Changed the license June 2016: LGPL

“Hour Glass” Pattern - Python with RTI Connext

rclpy

rmw

RTI Connext

74

API size

LOC

rmw_connext_cpp

rcl impl

rcl

Vendor Specific