Beruflich Dokumente
Kultur Dokumente
Jackie Kay
jackie@osrfoundation.org
A motivating example
Real-time computing
Requirements and best practices
ROS 2 design
Comparison with ROS 1 and ros_control
Demo and results
2
A motivating example
3
A motivating example
4
A motivating example
5
A motivating example
6
A motivating example
7
A motivating example
8
A motivating example
9
A motivating example
10
Table of Contents
A motivating example
Real-time computing
Requirements and best practices
ROS 2 design
Comparison with ROS 1 and ros_control
Demo and results
11
Real-time computing
12
Real-time computing
13
Real-time computing
14
Real-time computing
15
Real-time computing
16
Real-time computing
17
Real-time computing
18
Real-time computing
Why do we care?
– Event response
e.g. parts inspection
– Closed-loop control
e.g. manipulator control
– Added benefit: Reliability, extended uptime
Downtime is unacceptable or too expensive
19
Goal of ROS 2
Real-time compatibility, from day one
20
Table of Contents
A motivating example
Real-time computing
Requirements and best practices
ROS 2 design
Comparison with ROS 1 and ros_control
Demo and results
21
Requirements and best practices
22
Requirements and best practices
23
Requirements and best practices
24
Requirements and best practices
25
Requirements and best practices
26
Table of Contents
A motivating example
Real-time computing
Requirements and best practices
ROS 2 design
Comparison with ROS 1 and ros_control
Demo and results
27
ROS2 design - architecture comparison
28
ROS2 design - real-time architecture
29
ROS2 design – Modularity
30
ROS 2 - current implementation
Executor
initialization non real-time
preallocate memory
...
spin real-time
rmw_wait(timeout)
{
pass conditions to waitset
loop until interrupted
wait (in DDS)
wake-up if timed-out
}
do work if it came in
32
ROS2 design – Node lifecycle
33
ROS2 design – Node lifecycle
34
ROS2 design – Node lifecycle
35
ROS2 design – Node lifecycle
36
ROS2 design – Node composition
37
ROS2 design – Node composition
38
ROS2 design – Communications
– Inter-process
DDS can deliver soft real-time comms
Customizable QoS, can be tuned for real-time use-case
– Intra-process
Efficient (zero-copy) shared pointer transport
– Same-thread
No need for synchronization primitives. Simple, fast
39
ROS 2 – alpha release
40
ROS2 – progress overview
In progress
– Component lifecycle
– Composable components
– Complete intra-process pipeline
Future work
– Pre-allocate dynamic messages
– CI for verifying real-time constraints
– Lock-free multi-threaded executor
41
Table of Contents
A motivating example
Real-time computing
Requirements and best practices
ROS 2 design
Comparison with ROS 1 + ros_control
Demo and results
42
Comparison with ROS1 + ros_control
43
Comparison with ROS1 + ros_control
44
Comparison with ROS1 + ros_control
ROS1 + ros_control:
ROS2 equivalent:
− drop non-standard lifecycle / interfaces → gentler learning curve
− smaller codebase → easier to maintain
45
Table of Contents
A motivating example
Real-time computing
Requirements and best practices
ROS 2 design
Comparison with ROS 1 and ros_control
Demo and results
46
ROS 2 Real-time Benchmarking: Setup
real-time process
motor command
controller simulator
sensor feedback
teleop logger
47
ROS 2 Real-time Benchmarking: Setup
Configuration
﹣ RT_PREEMPT kernel
﹣ Round robin scheduler (SCHED_RR), thread priority: 98
﹣ malloc_hook: control malloc calls
﹣ getrusage: count pagefaults
Goal
﹣ 1 kHz update loop (1 ms period)
﹣ Less than 3% jitter (30 μs)
Code
﹣ ros2/demos - pendulum_control
48
ROS 2 Real-time Benchmarking: Memory
49
ROS 2 Real-time Benchmarking: Results
Latency (ns) % of update rate
No stress
Min 1620 0.16%
50
ROS 2 Real-time Benchmarking: Results
Latency (ns) % of update rate
Stress applied:
Min 1398 0.14%
stress --cpu 2 --io 2
Max 258064 25.8%
51
Closing remarks
– Systems subject to real-time constraints are very
relevant in robotics
– ROS2 will allow user to implement such systems
− with a proper RTOS, and carefully written user code
– Initial results based on ROS2 alpha are encouraging
− inverted pendulum demo
– Design discussions and development are ongoing!
− ROS SIG Next-Generation ROS
− ros2 Github organization
52
Selected references
– [Biggs, G.] ROS2 design article on node lifecycle (under review)
53