ROS distributed architecture

29
Pablo Iñigo Blasco Grupo de Investigación RTCAR Robotica y Tecnología de Computadores Universidad de Sevilla Distributed Architecture, Deployment and Introspection

description

Author: Pablo Iñigo Blasco Grupo de Investigación RTCAR Robotica y Tecnología de Computadores Universidad de Sevilla

Transcript of ROS distributed architecture

Page 1: ROS  distributed architecture

Pablo Iñigo BlascoGrupo de Investigación RTCAR

Robotica y Tecnología de ComputadoresUniversidad de Sevilla

Distributed Architecture, Deployment and Introspection

Page 2: ROS  distributed architecture
Page 3: ROS  distributed architecture

Contents

● Distributed Architecture● ROS Architecture● Nodes● Communication mechanisms● Introspection Tools

Page 4: ROS  distributed architecture

Complex Robotic Software Architectures

● Non-Functional requirements● Ubiquity● High computation power● Real Time● Fault Tolerance and Robustness

● Problems● Integration Problems● Deployment and Debugging Problems → Need of

complex and powerful tools

Page 5: ROS  distributed architecture

Problems

● Deployment Problems● Multiple cpus, multiple cores● Multiple computers distributed in a network● Software Engienering related (scalability, reusability, etc.)

● Integration of huge sets of software technologies● Need of Package reutilization (impossible reinvent the wheel)● Libraries● Programming languages

Page 6: ROS  distributed architecture

ROS Distributed Architecture

● Hybrid P2P Architecture● Distributed Components● Severals Node communication

mechanisms (message passing based)● Focused on node communication

mechanisms● Free internal node design

Page 7: ROS  distributed architecture

Nodes (I)

● Minimal building block

● Own control flow

● Operative system process

● Reactive and/or proactive

● Any supported language

● Communication mechanisms

● Services● Topics● Parameters

NODE

Topics

Services

Parameters(*)

Startup configuration

.yaml

Page 8: ROS  distributed architecture

Nodes (II) Example

Dyxinamel Servo

current_pose

Services

Parameters

goal

goHome

shutdown

P 1.0I 1.0D 1.0

P 1.0I 1.0D 1.0

Startup_config.yaml

Page 9: ROS  distributed architecture

ROS Distributed Architecture (II) - Example

NodeNode

NodeNode

topic

topic

Computer A Computer B

Actuators

Central NodeNode

RPC services

RPC services

Page 10: ROS  distributed architecture

ROS Distributed Architecture: Pros & Cons

● Advantages:

● Paralelism● Ubiquity● Fault Tolerance● Modularity – low coupling● Language Abstraction

● Disadvantages:

● Real Time applications● Heavier Robotic Systems

● Additional requirements:

● Deployment tools for distributed architecture ● Distributed logging System● Remote Introspection Tools

Page 11: ROS  distributed architecture

Message

● Data Structure● Message Interface Description

File● Code generation● Specific language proxy code

generation● C++, Python..

● Conveys● Message packages

● geometry_msgs● sensor_msgs● navigation_msgs

string field1int8 field2bool field3other_pkg_msg/custom_msg field4

my_package/msg/example.msg

.h.h .py .java

Page 12: ROS  distributed architecture

Messages (II) – Example $ rospack find geometry_msgs`/msg

Point32.msg

Polygon.msg

PoseArray.msg

PoseWithCovariance.msg

QuaternionStamped.msg

Twist.msg

TwistWithCovarianceStamped.msg

Wrench.msg

Point.msgPolygonStamped.msg

Pose.msg

PoseWithCovarianceStamped.msg

Transform.msg

TwistStamped.msg

Vector3.msg

WrenchStamped.msg

PointStamped.msg

Pose2D.msg

PoseStamped.msg

Quaternion.msg

TransformStamped.msg

TwistWithCovariance.msg

Vector3Stamped.msg

Page 13: ROS  distributed architecture

Message (III) Examples

geometry_msgs/PoseWithCovariance

geometry_msgs/Pose pose

geometry_msgs/Point position

float64 x

float64 y

float64 z

geometry_msgs/Quaternion orientation

float64 x

float64 y

float64 z

float64 w

float64[36] covariance

sensor_msgs/LaserScan

Header header

uint32 seq

time stamp

string frame_id

float32 angle_min

float32 angle_max

float32 angle_increment

float32 time_increment

float32 scan_time

float32 range_min

float32 range_max

float32[] ranges

float32[] intensities

Page 14: ROS  distributed architecture

Topics

● Publish/Subscribe Models● Proactive nodes (agents)● NxM

● Promotes the instrospection mechanisms

● Asynchronous● Several configurations (buffer,

latching, etc.)

● Underlying Transport Layer:● TCP, UDP, Shared Memory● Others Transport → rosserial,

ethercat

Page 15: ROS  distributed architecture

Services

● RPC● Purely Reactive

● Request/Response

● Stable Functionality Interface

● Specific language proxy code generation● C++, Python..

● Typical in others RSFs

string request_field1int8 request_field2---string response_field1other_pkg_msg/custom_msg response_field2

my_package/srv/example.srv

.h.h .py .java

Page 16: ROS  distributed architecture

ROS MASTER

● Hybrid P2P Distributed Architecture

● Central Information Node

● Capabilities● Parameter Server● Resource Localization (White

Pages)● Service Lookup (Yellow Pages)

Page 17: ROS  distributed architecture

NODE

Nodelets

● Threads● Compatible node

communication mechanisms

● Zero copy communication between nodelets

● Share Machine● Only C++

nl

nl

nl

NODE

Page 18: ROS  distributed architecture

Macro - Components (Components of Components)

Launch Launch

Launch

Ros Master

Robot A Robot B

Robot C Launch

Page 19: ROS  distributed architecture

Parameters

● Client/Server Model● Common Variable Information● Not automatically update inside nodes● Can be seen as node properties thanks to the

ramming convention

Page 20: ROS  distributed architecture

Advanced mode communication mechanisms

● Actions● Dynamic Reconfigure● (Custom) Based on state machines and

workflows (SMACH)

● They are based on basic primitives● Nodes● Parameters● Services

Page 21: ROS  distributed architecture

Actions

● Preemptive tasks● Non immediate tasks● Cancelable tasks● Based on topics● Examples

● Moving the robot to a target location

● Performing a laser scan and returning the resulting point cloud

● Detecting the handle of a door

Page 22: ROS  distributed architecture

Deployment: Launch Files

● Deployment layout of building blocks (nodes)● Naming pushing● Startup configuration (direct or yaml files)● XML syntax● Itself can be seen as an complex component or

building block

Page 23: ROS  distributed architecture

Tools - Remote Introspection

● Topics (rostopic)● Services (rosservice)● Nodes (rosnode)● Parameters (rosparam)● Messages (rosmsg)● Services (rossrv)● General debugging (roswtf)

Page 24: ROS  distributed architecture

Tools - RX-Graph

Page 25: ROS  distributed architecture

DEMO AMCL

Page 26: ROS  distributed architecture

Introspection tools - Rxplot

● Monitor numerical data field at runtime● Example

$ rxplot /odom/pose/pose/position/x /odom/pose/pose/position/y

Page 27: ROS  distributed architecture

Introspection tools - Rviz

● Graphical Representation of message

● Typical messages visualization plugins

Page 29: ROS  distributed architecture

References

(1) Iñigo-Blasco, Pablo, Fernando Diaz-del-Rio, Ma Carmen Romero-Ternero, Daniel Cagigas-Muñiz, and Saturnino Vicente-Diaz. 2012. “Robotics software frameworks for multi-agent robotic systems development” Robotics and

(2) ROS Wiki - http://ros.org

(3) Quigley, Morgan, Brian Gerkey, Ken Conley, Josh Faust, Tully Foote, Jeremy Leibs, Eric Berger, Rob Wheeler, and Andrew Ng. 2009. ROS: an open-source Robot Operating System. In Open-Source Software workshop of the International Conference on Robotics and Automation (ICRA). Autonomous Systems (February).