ROS 2 for Consumer Robotics
The iRobot use-case
ROSCON
November 1st, 2019
Soragna, Alberto
Oxoby, Juan
Dhiraj, GoeliRobot Confidential 2019 | 1

ROS 2 for Consumer Robotics
Agenda01 iRobot’s use-case02

ROS 2 Performance
Framework03

Performance Evaluation

04

New Intra-Process Manager

05

Scalability

iRobot Confidential 2019 | 2

Our Portfolio

iRobot Confidential 2019 | 3

ROS 2 to rule them all?

desktop✓Linux-based
low-cost
embeddedµC??

✓(µROS)Is ROS 2 suitable for Linux-based low-cost embedded platforms?
iRobot Confidential 2019 | 4

01

iRobot’s use-caseiRobot Confidential 2019 | 5

ROS 2 for Consumer Robotics§ Low-cost Linux-based embedded hardware§ Single process application§ ~1000 robots in the same network (dev stage)iRobot Confidential 2019 | 6

Defining a target platform
The goal is to run our entire
navigation system on aRPi2Raspberry Pi 2 Model B specs:§ 900MHz quad-core ARM Cortex-A7 CPU§ 1GB RAM

iRobot Confidential 2019 | 7

Defining our performance requirements
Adding a ROS 2 layer to ourexisting system should add asmall overhead:§ less than 20% CPU§ less than 20MB RAM§ have acceptable latency§ zero lost messages

iRobot Confidential 2019 | 8

02

ROS 2 PerformanceFramework

iRobot Confidential 2019 | 9The iRobot ROS 2 Performance Framework§ Arbitrary user-defined ROS 2 topologies§ Simple to use but highly configurable§ Human-readable results§ Open-source

https://github.com/irobot-ros/ros2-performanceiRobot Confidential 2019 | 10

The iRobot ROS 2 Performance Framework
OUTPUT:INPUT:
topology
file(s)(run …)

RAMCPU%latency
eventsiRobot Confidential 2019 | 11

INPUT - Topology .json file{"nodes": [{"node_name": ”node_A","publishers": [{"topic_name": ”topic_A", "msg_type": ”1Kb", "period_ms": 10,”qos":”reliable"}]},/node_A/topic_A{"node_name": ”node_B","subscribers": [{"topic_name": ”topic_A", "msg_type": ”1Kb", ”qos":”best-effort"}]/node_B},]}

iRobot Confidential 2019 | 12

OUTPUT – Resourcestime[ms]
0500
1000
1500
2000
2500
3000
3500
4000
4500
5000
5500
6000

cpu[%] arena[KB]002761080
51167860
50202844
43202860
39202876
36202900
34202928
33202936
31202948
31202968
30202992
29203012

in_use[KB] mmap[KB]006071201675390202753020276902027860202801
020282202028370202853020286802028930202909
0

rss[KB]
024948
47060
55496
55496
55496
55496
55496
55496
55496
55496
55496
55496

vsz[KB]
0305212544012660724660724660724660724660724660724660724660724660724660724iRobot Confidential 2019 | 13

OUTPUT – Events
Time[ms]
90151
156
156
250
250
338
338
339
2314
2314
3614
3615
3644
3645

CallerCodeSYSTEM
0SYSTEM0amazon->lyon
1danube->mandalay 1
danube->ponce1
danube->geneva
1arkansas->arequipa 2arkansas->arequipa 2arkansas->arequipa 1
parana->geneva
1parana->osaka
1parana->osaka
1parana->geneva
1nile->hamburg
1tigris->hamburg
1

Description[discovery] PDP completed[discovery] EDP completed
msg 0 late. 4300us > 2000us
msg 0 late. 4082us > 2000usmsg 10 late. 2303us > 2000us
msg 10 late. 2617us > 2000us
msg 0 too late. 184382us > 50000us
msg 1 too late. 136936us > 50000usmsg 2 late. 37064us > 5000usmsg 216 late. 2097us > 2000usmsg 216 late. 2131us > 2000us
msg 346 late. 2044us > 2000us
msg 346 late. 2682us > 2000us
msg 349 late. 2234us > 2000us
msg 349 late. 2081us > 2000us
iRobot Confidential 2019 | 14

OUTPUT – Latency
nodetopic
size[b] received[#] late[#] lost[#] mean[us] sd[us] min[us] max[us]lyonamazon 36
12001
110602145 3454300
hamburg danube 812001
150796233 3625722
hamburg ganges 16
12001
100557
119 3024729
hamburg nile16
12001
180658206 300
5258
hamburg tigris
16
12000
170736225 3105994
osaka
parana 1212001
320636236 3464343
mandalay danube 812001
160791
189 4186991
mandalay salween 48
12001
10663
297 3916911
ponce
danube 812001150882203 437
7270

received[#] mean[us] late[#] late[%] too_late[#] too_late[%] lost[#] lost[%]126496744
2040.161
20.001600

iRobot Confidential 2019 | 15

OUTPUT – Latency
Message classification by their latency
+++
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+--------------------------------------------------------------+<-------> <---------------------> <--------------------------------------->
on_timelate
too_late<------------------------------->
periodiRobot Confidential 2019 | 16

03

ROS 2 PerformanceEvaluation

iRobot Confidential 2019 | 17

ROS 2 Performance – Benchmark Topology

iRobot Confidential 2019 | 18

ROS 2 Performance – Fast-RTPS

Remember that this system is just doing message passing (no extra computation)iRobot Confidential 2019 | 19

ROS 2 Performance – CycloneDDS

iRobot Confidential 2019 | 20

Reducing the ROS 2 RAM usage
The DDS specification requires that nodes create proxy objects for EACH
entity they discover.
What if we know in advance that some entities don’t need to know aboutsome others?

BLACK-LISTING??
Considering our system, the RAM usage decreased to 45% of the original!

iRobot Confidential 2019 | 21

04

New Intra-ProcessManager

iRobot Confidential 2019 | 22

ROS 2 Intra-Process Communication
Dashing Intra-Process Manager• Sends meta-messages through the RMW layer!
• Latency and CPU improvement only noticeable for big messages

New Intra-Process Manager (now on master!)• The communication is performed exclusively inside the RCLCPP layer• Reduces CPU usage and latency for any message size

iRobot Confidential 2019 | 23

New Intra-Process Manager

iRobot Confidential 2019 | 24

ROS 2 Performance – Fast-RTPS + new IPC

45% CPU% decrease!
iRobot Confidential 2019 | 25

05

Scaling ROS 2

iRobot Confidential 2019 | 26

Problem Statement~1000 robots in the same network~35 topics from each robot~5 different subnetworks across the globe
We want to be able to individually access any robot's
messages from a remote debugging machine

iRobot Confidential 2019 | 27

Addressing Scalability
Proposed solution 1:
Use default DDS configuration and a different namespace foreach robot
Problems:
ALL robots discover each other!
Slow/unreliable discovery, network saturation, multicast requires
forwarding between subnets

iRobot Confidential 2019 | 28

Addressing Scalability
Proposed solution 2:
Solution 1 + ROS_DOMAIN_ID
Problems:
Limited numbers of domain IDs. What about assignment?
Still considerable network usage and multicast limitations

iRobot Confidential 2019 | 29

Addressing Scalability
Proposed solution 3:
Disable multicast discovery.
When a remote machine wants to connect to a robot, add therobot’s IP to the initial peers list (unicast)
Problems:
The user needs direct access to the DDS configuration. This canbe solved by new APIs.

✓iRobot Confidential 2019 | 30

Solution 3 with CycloneDDS

ROBOT_IP=10.22.22.90 ros2 topic list
iRobot Confidential 2019 | 31

ros_to_dds ?

iRobot Confidential 2019 | 32

irobot.com/careersiRobot Confidential 2019 | 33