27
1 © 2016 MathWorks, Inc. Developing Robotics Applications with MATLAB, Simulink: Introducing the Robotics System Toolbox

Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

Embed Size (px)

Citation preview

Page 1: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

1© 2016 MathWorks, Inc.

Developing Robotics Applications

with MATLAB, Simulink:

Introducing the

Robotics System Toolbox

Page 2: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

2

What Are You Doing with Robotics?

Build

Robots

Page 3: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

3

Using MATLAB and Simulink for “Building Robots”

Plant

Recorded Webinar: How a Differential Equation Becomes a Robot

Controller+

-

Input Output

Festo Bionic Arm DLR Humanoid Robot

Page 4: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

4

Using MATLAB and Simulink for “Building Robots”

High number of DoF

Nonlinearity

Multiple Layers of Control

Multiple States or Modes

Demo

Page 5: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

5

What Are You Doing with Robotics?

Teach/Learn

Robotics

With

Low Cost hardware

Build

Robots

Arduino

Raspberry Pi

Lego

Page 6: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

6

Robotics with Low Cost Hardware:

Hardware Support Package

• No need C/C++/Python

• Drivers Provided

Build Robots with Low-Cost Hardware?

Visit:

www.mathworks.com/hardware

Free LAB workbooks

Page 7: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

7

Robotics with Low Cost Hardware:

Page 8: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

8

What Are You Doing with Robotics?

Teach/Learn

Robotics

With

Low Cost hardware

Build

Robots

Arduino

Raspberry Pi

Lego

Teach/Learn Robotics

With

More powerful hardware

?

Page 9: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

9

What Are You Doing with Robotics?

Teach/Learn

Robotics

With

Low Cost hardware

Build

Robots

Arduino

Raspberry Pi

Lego

Teach/Learn Robotics

With

More powerful hardware

ROS/Gazebo Interface

ROS Node Generation

Comprehensive Algorithms

Use Powerful Robots Running ROS?

Robotics System Toolbox

Page 10: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

10

What do we want to do today?

Page 11: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

11

Agenda

1. MATLAB-ROS Interface

2. Robotics Algorithms

3. Simulink-ROS Interface

Robotics

System

Toolbox

Page 12: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

12

What Can You Do with Robotics System Toolbox?

?

Robot

Page 13: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

13

Topics

Services

ROS Node(s) /topic

Data Exchange Paradigms

ROS Node(s)Publish Subscribe

ROS NodeRequest

Response

ROS Node(s)Service

Server Clients

Page 14: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

14

Ethernet

Main CPU

Developing Robotic Applications with ROS

Kinematics& Control

MATLAB

Image

processing

Localization &

Mapping

Simulink

Map server

Local

Planner

Global

Planner

NODE NODE NODE

NODE NODE NODE

NODE

NODE

Sensors

Robot (CPU 2)

NODE

NODE

NODENODE

Actuators

T6

Page 15: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

15

The essentials: ROS communication

>> rosshutdown( )

>> rosinit( )

>> rosnode( )

>> rostopic( )

>> rosmsg( )

>> rossubscriber( )

– >> receive( )

>> rospublisher( )

– >> rosmessage( )

– >> send( )

>> robotics.ros.Node ( )

Listening

Broadcasting

What’s there ?

What can we communicate about ?

Shutdown or start global MATLAB node

Connect to existing ROS master

Connect to multiple ROS masters

Page 16: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

16

MATLAB ROS connectivity: Demo

1. The MATLAB ROS interface – part 1

– Practice on a MATLAB Robotic simulator

2. The MATLAB ROS interface – part 2

– Practice on a GAZEBO Robotic simulator

(Turtlebot)

– A “teaser” on algorithm development

3. Processing ROS bag files

Page 17: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

17

Agenda

1. MATLAB-ROS Interface

2. Robotics Algorithms

3. Simulink-ROS Interface

Demo

Page 18: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

18

MATLAB Algorithm development : Demo

1. Path planning and Pure pursuit controller – part 1

– Practice on a MATLAB Robotic simulator

2. Path planning and Pure pursuit controller – part 2

– Practice on a GAZEBO Robotic simulator

Page 19: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

19

Overview: Robotics Algorithms

Test it with Gazebo or other Simulator through MATLAB-ROS Interface

Page 20: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

20

Overview: Robotics Algorithms

Test it with a physical ROS-Enabled robot

Turtlebot_IP = ‘XXX.XXX.XXX.XXX'

rosinit(Turtlebot_IP, 'NodeHost', my_laptop_IP, ...

'NodeName', my_name_for_global_MATLAB_node);

Page 21: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

21

Agenda

1. MATLAB-ROS Interface

2. Robotics Algorithms

3. Simulink-ROS Interface

Page 22: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

22

Generate a ROS Node from a Simulink Model

• Connect Simulink Model to a ROS network to simulate a Goal

tracking algorithm

Page 23: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

23

Prototype algorithm

in Simulink

Test algorithm

with a ROS-enabled

Simulator or Robot

Generate a

standalone ROS

node from

Simulink

Simulink Algorithm development and DEPLOYMENT : Demo

Page 24: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

24

DOC

“ How do I create

custom messages ?”

Page 25: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

25

DOC

“ How do I access the tf

Transformation tree in

ROS?”

Page 26: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

26

Key Capabilities Demonstrated

MATLAB-ROS Interface

– Create a ROS nodes, publishers, subscribers, services

– Design and test robotics algorithms on a robot

simulator such as Gazebo

– Test robotics algorithms on a physical robot

– Import rosbag log files

Simulink-ROS Interface

– Publish and Subscribe from Simulink Models

– ROS node generation from Simulink models

Algorithms

– Map representation with Binary Occupancy Grids

– Path Planning with Probabilistic Roadmap

– Path Tracking with Pure Pursuit Controller

– Coordinate System Transformations

Robotics

System

Toolbox

Page 27: Developing Robotics Applications with MATLAB, Simulink ... · 4 Using MATLAB and Simulink for “Building Robots” High number of DoF Nonlinearity Multiple Layers of Control Multiple

27

Thank You