CTIT Introduction Motivation Two trends in robotics Conflicting! - - PowerPoint PPT Presentation

ctit introduction motivation
SMART_READER_LITE
LIVE PREVIEW

CTIT Introduction Motivation Two trends in robotics Conflicting! - - PowerPoint PPT Presentation

Connecting Two Robot-Software Communication Architectures: ROS and LUNA Communicating Process Architectures 2016, Copenhagen, DK W. Mathijs van der Wer ff , Jan F . Broenink University of Twente CTIT institute, Robotics & Mechatronics


slide-1
SLIDE 1

CTIT

Connecting Two Robot-Software Communication Architectures: ROS and LUNA

  • W. Mathijs van der Werff, Jan F

. Broenink

University of Twente CTIT institute, Robotics & Mechatronics Enschede, Netherlands

Communicating Process Architectures 2016, Copenhagen, DK

slide-2
SLIDE 2
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Introduction — Motivation

  • Two trends in robotics — Conflicting!
  • More complex algorithms
  • Computer vision, area mapping, planning
  • More light weight, energy efficiency
  • Mobile robots, unmanned aerial vehicles (drones)
  • Possible Solution
  • Offloading algorithms to base station
  • Development of algorithms easier
  • More resources, like computer power
  • Easier upgradable
  • Connection between two environments needed
  • Algorithms
  • Robotic Operating System – ROS
  • Loop Controllers, i.e. hard-real time code
  • LUNA Universal Network Architecture -- LUNA

2

slide-3
SLIDE 3
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Introduction — Some Background

  • Hard real time
  • Controlling robots, i.e. fast mechanics
  • LUNA run-time framework
  • Hard real-time execution, precompiled
  • Design Flow
  • Graphically designed CSP processes in TERRA, and verified
  • Code generated, linked to LUNA lib
  • ROS – Robot Operating System
  • Open source / large community
  • Publisher - Subscriber pattern: nodes and messages
  • Design Flow
  • Design algorithms and message types
  • Connect nodes via message exchange
  • (re) compile

3

slide-4
SLIDE 4
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Introduction — Prototype, earlier made

  • Prototype ROS-LUNA bridge made
  • Algorithms in ROS and hard real-time controllers in LUNA
  • Problem: ros :: Publisher pub = n. advertise <template T>(”topic”, 10);
  • so source-code level in ROS to be connected to precompiled library in LUNA
  • Bezemer et al. at ETFA 2015
  • Prototype
  • Based on ShapeShifter class
  • Integer LUNA → ROS
  • Limited support messagetypes
  • only basic datatypes

4

raw msgs lib comm mgr luna-bridge node ROS core Algorithm node LUNA app PID comm mgr Actuators Sensors Environment Sensors

Hard Real-Time

parameter topics setpoint topics

TCP/IP Resource-rich Platform Embedded Platform Plant

slide-5
SLIDE 5
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Design and Implementation

  • Essential Requirements
  • Versatile / Reusable
  • Compiled program
  • SRT - HRT connection
  • Asynchronous data connection
  • Overview
  • Communication
  • LUNA
  • ROS

5 ROS

Complex algorithms

LUNA bridge LUNA application

Loop controllers/ CSP

ROS- ChannelManager Actuators Sensors TCP/IP ROS network

(User configured)

ROS-LUNA bridge LUNA application

(User configured)

Robotic setup Base station Embedded system

slide-6
SLIDE 6
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

ROS-LUNA Bridge Architecture

  • Overview
  • Communication
  • LUNA
  • ROS

6

Runtime Bind- ing Publisher ROS network Runtime Binding Helper Service LUNA bridge Topic Listener ROSChannelManager LUNA application Publisher ... Publisher Subscriber ... Subscriber ... ... ROSChannels (CSP) (Wireless) network connection ROS network

(User configured)

ROS-LUNA bridge

ROS-side

Network ROS-LUNA bridge

LUNA-side

LUNA application

(User configured)

Base station Embedded system

slide-7
SLIDE 7
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Implementation — Communication

  • Communication Protocol
  • Serialise, Deserialise
  • to fill up TCP/IP packets
  • use bandwidth effectively
  • tailored solution
  • reduce overhead
  • Extendible
  • ROS channels
  • >>

7

Runtime Bind- ing Publisher ROS network Runtime Binding Helper Service LUNA bridge Topic Listener ROSChannelManager LUNA application Publisher ... Publisher Subscriber ... Subscriber ... ... ROSChannels (CSP) (Wireless) network connection ROS network

(User configured)

ROS-LUNA bridge

ROS-side

Network ROS-LUNA bridge

LUNA-side

LUNA application

(User configured)

Base station Embedded system Runtime Bind- Publisher Runtime Binding Helper Service A bridge Listener ROSChannelManager ... ... ROSChannels (CSP) (Wireless) network connection A bridge

OS-side

Network ROS-LUNA bridge

LUNA-side

LUN

slide-8
SLIDE 8
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Implementation — specific channels in LUNA

  • LUNA — ROS channels
  • Allows modeling in TERRA
  • Channel modifications
  • non-blocking write to ROS
  • from HRT to SRT
  • 2 data buffers
  • blocking read from ROS
  • synchronisation…
  • Non-blocking read
  • using ALT: ROSread [] SKIP

8

ROSChannelManager LUNA application ... ... ROSChannels (CSP) (Wireless) network connection Network ROS-LUNA bridge

LUNA-side

LUNA application

(User configured)

ROSChannelManager LUNA application Decode structure Decode next field Find callback Call callback Wait new TCP packet Read buffer Block context Callback Copy data Activate next component Received TCP packet ROSChannel’s reader activation Dataleft Dataleft Buffer empty Buffer empty

slide-9
SLIDE 9
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Implementation — ROS topic listeners…

  • ROS — Topic Listeners
  • topic = data to transport
  • run-time topic binding
  • specific Publisher
  • specific configuration
  • through the network
  • Implementation
  • ShapeShifter class
  • publish & subscribe
  • without specifying data type
  • Needs specific
  • serialiser, deserialiser
  • RuntimeBindingPublisher
  • extended TopicListener

9

Runtime Bind- ing Publisher ROS network Runtime Binding Helper Service LUNA bridge Topic Listener ROSChannelManager LUNA application Publisher ... Publisher Subscriber ... Subscriber ... ... ROSChannels (CSP) (Wireless) network connection ROS network

(User configured)

ROS-LUNA bridge

ROS-side

Network ROS-LUNA bridge

LUNA-side

LUNA application

(User configured)

Base station Embedded system Runtime Bind- ing Publisher ROS network Runtime Binding Helper Service LUNA bridge Topic Listener Publisher ... Publisher Subscriber ... Subscriber (Wireless) network connection ROS network

(User configured)

ROS-LUNA bridge

ROS-side

Network ROS-LUN Base station

slide-10
SLIDE 10
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Testing

  • Initial Tests
  • on bandwidth
  • packet loss
  • Verification, Performance
  • RBP - RuntimeBindingPublisher
  • Performance
  • Publishers
  • Subscribers
  • Demonstration
  • timing
  • robotic system

10

slide-11
SLIDE 11
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Initial Tests

  • Packet loss
  • to mimic WiFi
  • Additional traffic
  • network sharing

11

PC Switch PC104 PC Data Additional traffic

10 20 30 40 50 200 400 600 Loss(%) Response time (ms) Average 5 10 5 10 15 20 Additional traffic (MiB) Response time (ms) Average (MiB/s)

slide-12
SLIDE 12
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Verification tests

  • Verify RuntimeBindingPublisher
  • correct serializing / deserializing
  • auto-generated ROS structure of test
  • time stamp test:

12

slide-13
SLIDE 13
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Performance Tests - Publishers

  • Five different implementations of ROS publishers
  • generic ROS Publisher in C++
  • generic ROS Publisher in Python
  • RuntimeBindingPublisher with prior msg info
  • RuntimeBindingPublisher without prior msg info
  • simplified RuntimeBindingPublisher in Python
  • Tests
  • average of 100 tests
  • per test 50 x init and publishing of 100 samples
  • 10 tests in 1 run
  • 100 tests in 1 run makes ROS core crash
  • On intel i5@2.53 GHz, 4 GB RAM, Ubuntu 15.10, ROS Jade

13

slide-14
SLIDE 14
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Publishers

  • Initialisation
  • RBPc++ slowest
  • due to external Python helper node
  • RBPc++2:
  • not needed as used from previous call
  • Python slower than C++
  • RBPPython slower than Python
  • additional fu calls needed
  • Runtime
  • RBPs are comparable
  • only initialisation is different
  • RBP slower than C++
  • due to additional var name look ups
  • Python slowest

14

1 2 3 4

1.58 3.21 1.61 2.45 2.25

Time(ms) Initialization 30 60 90

17.51 29.91 30.47 81.82 83.66

Time(us) Publish

GenericC++ RBPC++ RBPC++,2 RBPP ython GenericP ython

slide-15
SLIDE 15
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Performance Tests - Subscribers

  • Four different implementations of ROS subscribers
  • normal subscribers in C++ / Python
  • extended TopicListener in C++ / simple runtime binding in Python
  • Tests
  • custom type: header and 2 float64
  • average of 100 test, for initialisation
  • 6,000 msg @ 200 Hz:
  • time stamp send as float64
  • published over 4 topics, connected to 2 nodes
  • 1 node C++, 1 node Python
  • both have runtime binding and normal node code
  • received data
  • elapsed time is measured and put in 2nd float64
  • analysed
  • in analysis node
  • delay: publisher + network + subscriber
  • network delay can be subtracted as common factor

15

slide-16
SLIDE 16
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Subscribers

  • Initialisation
  • C++ slowest
  • due to tasks others do at runtime
  • like registering the callback
  • Python seems to optimize
  • due to repeating of runs
  • Runtime
  • C++ slowest
  • has to iterate over description fields
  • Python faster than RBPc++
  • due to optimizations
  • Overall conclusion
  • C++ faster than Python
  • RBPc++ is in between

16

1 2 3 4 5 6 7 8

6.89 5.82 3.19 3.26

Time(ms) Initialization 100 200 300 400 500

267.88 348.39 300.96 305.03

Time(us) Message delay

NormalC++ RBC++ NormalP ython RBP ython

slide-17
SLIDE 17
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Demonstration Tests

  • Robotic setup: vison in the loop
  • our favorite JIWY test setup
  • pan-tilt gimball, DC-motor driven
  • RaMstix embedded board:
  • Gumstix over fire, Linux 3.2.21, Xenomai HRT patch 2.6.3
  • FPGA for PWM pulse generation and encoder pulse counting
  • Notebook for ROS
  • Tests
  • initialisation
  • timing
  • real action

17

PC / ROS Network Embedded system Image processing

(Soft real-time)

Visualization

(Soft real-time)

Controller

(Hard real-time)

Plant Camera Visualization data Video stream Setpoint data Actuation Sensor data Hard real-time Soft real-time

slide-18
SLIDE 18
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Initialisation JIWY setup

  • Initialisation
  • of ROS nodes and topics
  • via the ROS-LUNA bridge
  • ROS topic / message graphs
  • before, after LUNA app connects
  • Tests
  • as expected

18

slide-19
SLIDE 19
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Timing tests JIWY setup

19

  • Only ROS-LUNA bridge over the network
  • two tasks concurrently
  • transporting images
  • video file and camera images
  • hard-real time task @ higher freq: 500 Hz
  • writing packages to ROS @ 62.5 Hz
  • In LUNA
  • priority via PRI ALT
slide-20
SLIDE 20
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Timing Tests Results

  • Tests
  • timestamps recorded
  • variation (= jitter) calculated
  • Results - Jitter
  • at LUNA side
  • HRT Jitter: 0.265 %
  • SRT Jitter : 0.373 %
  • both timed via timer channel
  • on PC - ROS
  • SRT notify: 18.3 %
  • ROS monitor: 21.7 %
  • Results - delays
  • Round trip 31.5 ms, large variation
  • ROS -> LUNA 15.5
  • inside LUNA 13.4
  • back to ROS 2.6

20

0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 2·10−2 4·10−2 6·10−2 8·10−2 0.1 Time (s) Delay (s) ROS send -> LUNA receive LUNA receive -> LUNA send LUNA send -> ROS receive Total RTT 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0.0001 0.001 0.01 0.1 1 10 100 Time (s) Relative jitter (%) HRT_task SRT_send_buffer SRT_received_notify ROS_image_processing ROS_monitor

slide-21
SLIDE 21
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Complete Robotic system

  • Controlling Robotic Setup
  • controllers @ 100 Hz
  • System
  • overview
  • architecture in TERRA

21 PC / ROS Network Embedded system Image processing

(Soft real-time)

Visualization

(Soft real-time)

Controller

(Hard real-time)

Plant Camera Visualization data Video stream Setpoint data Actuation Sensor data Hard real-time Soft real-time

slide-22
SLIDE 22
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Results, tracking a green blob

22

slide-23
SLIDE 23
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Conclusions and Recommendations

  • ROS - LUNA bridge runs
  • SRT - HRT connection in a natural way
  • Reusable / Flexible
  • at the price of some more delay
  • Demo application suffers from delay
  • Recommendations
  • Complete support in TERRA
  • to avoid modifying generated code to use ROS-channels
  • ROS runtime binding
  • can be used in other HRT systems than LUNA

23

slide-24
SLIDE 24
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA 24

slide-25
SLIDE 25
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Figure 15 Setpoint Receive Blok

  • to read from Im Proc and produce setpoints

25

slide-26
SLIDE 26
  • W. Mathijs van der Werff, Jan F. Broenink

Connecting ROS to LUNA

Figure 17: signals supporting the JIWY movie

  • 26

2 4 6 8 10 −0.6 −0.4 −0.2 0.2 0.4 0.6 Pan (rad) Pan setpoint Pan encoder 2 4 6 8 10 −0.4 −0.2 0.2 0.4 Time Tilt (rad) Tilt setpoint Tilt encoder