Efficient data recording
and replaying in ROS 2Speaker:● Raúl Sánchez-Mateos, Project Manager @ eProsima

raul@eprosima.com

October 20th, 2023

Agenda01

Motivation

02

ROS 2 Recorder

03● The importance of record and replay data
in robotics applications development● Fast DDS Dynamic Types● Overview & Usage● Main configuration options● Settings for resource optimization

04

ROS 2 Replayer

05

Visualize Data●●
●Overview & Usage
Main configuration options
Settings for resource optimization● ROS 2 Spy● Foxglove Studio

ROS 2 Recorder Controller● Overview & Usage● How to configure the remote controller● Creating your own controller

2Motivation
Why ROS 2 Record & Replay?

Analyseany potential
issuesSW & HWimprovements
based on data

Collect data from the execution ofthe robots in order to detect
possible errors in further data
analysis.

Following data analysis anddetection of possible faults, thedeveloped systems are updatedand improved.

3

Fast DDS Dynamic Types
Importance of Fast DDS Dynamic Types for ROS 2 debugging tools

4

ROS 2Recorder
CLI application to save ROS 2
published messages in a MCAP
database.ROS 2 Recorder
ROS 2 Recorder overview

6

ROS 2 Recorder
How to use ROS 2 Recorder● Installation○ Windows & Linux distribution (compiled with Colcon)○ Docker image○ Vulcanexus Humble & Vulcanexus Iron

● Configuration via yaml file● Command-Line Interface (CLI) application$ ddsrecorder --config-file recorder.yml ...
7

ROS 2 Recorder
Main configuration options●1DDS○ ROS 2 Domain ID# recorder.yml
dds:
domain: 08

ROS 2 Recorder
Main configuration options●1DDS○ ROS 2 Domain ID○ Topic allowlist & blocklist# recorder.yml
dds:
allowlist:- name: "*"type: "topic_type"
blocklist:- name: "/secret"9

ROS 2 Recorder
Main configuration options●12DDS○ ROS 2 Domain ID○ Topic allowlist & blocklist○ Topic QoS settings# recorder.yml
dds:
builtin-topics:- name: "/chatter"qos:reliability: true
durability: true
keyed: false
partitions: true
ownership: false
downsampling: 4
max-reception-rate: 10

10

ROS 2 Recorder
Main configuration options●1DDS○ ROS 2 Domain ID○ Topic allowlist & blocklist○ Topic QoS settings○ Transport configuration# recorder.yml
dds:
ignore-participant-flags:
filter_different_hosttransport: shm
whitelist-interfaces:- "127.0.0.1"

11

ROS 2 Recorder
Main configuration options●1●2DDS○ ROS 2 Domain ID○ Topic allowlist & blocklist○ Topic QoS settings○ Transport configuration# recorder.yml
recorder:Recorder

12

ROS 2 Recorder
Main configuration options

●1

●2DDS
○ ROS 2 Domain ID○ Topic allowlist & blocklist○ Topic QoS settings○ Transport configuration
Recorder○ Output file
○ Downsampling /Max reception rate
○ Compression○ Save only if type discovered○ Record discovered types# recorder.yml
recorder:output:filename: "output"
path: "."
timestamp-format: "%Y_%H%M%S_%Z"
local-timestamp: false
downsampling: 3
max-reception-rate: 20
only-with-type: false
compression:algorithm: lz4
level: slowest
record-types: true

13

ROS 2 Recorder
Settings for resource optimization# recorder.yml
recorder:buffer-size: 50●

Internal buffer size●

Number of threads●Max. pending samples●

Clean-up period

specs:threads: 8
max-pending-samples: 10
cleanup-period: 90

14

ROS 2 Recorder
Remote Controller
DDS Recorder internal module
to remote control the DDS
Recorder execution.

ROS 2 Recorder Remote Controller
Overview of the ROS 2 Recorder remote control system

16

ROS 2 Recorder Remote ControllerState diagram of ROS 2 Recorder remote control system

17

ROS 2Replayer
CLIapplication

toreplayrecorder ROS 2 messages saved
in a MCAP database.

ROS 2 Replayer
ROS 2 Replayer overview

19

ROS 2 Replayer
How to use ROS 2 Replayer● Installation○ Windows & Linux distribution (compiled with Colcon)○ Docker image○ Vulcanexus Tools (Humble & Iron)● Configuration via yaml file● Command-Line Interface (CLI) application$ ddsreplayer --input-file output.mcap --config-file replayer.yml ...
20

ROS 2 Replayer
Main configuration options●1●2●3DDS○ ROS 2 Domain ID○ Topic allowlist & blocklist○ Topic QoS settings○ Transport configuration
Replayer○ Input file
○ Begin / end time
○ Start replay time
○ Replay sample rate
○ Replay types
Specs○ Number of threads○ Wait for all messages “ACKed”# recorder.ymldds: ...
replayer:
input-file: output.mcap
begin-time: ...
end-time: ...
start-replay-time: ...
rate: 2
replay-types: true
specs:
threads: 8
wait-all-acked-timeout: 10

21

Data
Visualization
Visualize recorded data withROS 2 Replayer and inspect
ROS 2 Replayer execution withROS 2 Spy.

Foxglove Studio
Visualize recorded data with Foxglove Studio

23

ROS 2 Record & Replay
ROS 2 Record & Replay documentation and GitHub repository

Documentation

GitHub Repository24

www.eProsima.com

Linkedin.com/company/eProsima

Twitter.com/EProsima