Developing Autonomous Robots Using MATLAB and Simulink

32
1 © 2015 The MathWorks, Inc. Developing Autonomous Robots with MATLAB and Simulink Veer Alakshendra

Transcript of Developing Autonomous Robots Using MATLAB and Simulink

Page 1: Developing Autonomous Robots Using MATLAB and Simulink

1© 2015 The MathWorks, Inc.

Developing Autonomous Robots with

MATLAB and Simulink

Veer Alakshendra

Page 2: Developing Autonomous Robots Using MATLAB and Simulink

2

Page 3: Developing Autonomous Robots Using MATLAB and Simulink

3

Page 4: Developing Autonomous Robots Using MATLAB and Simulink

4

Challenges with Autonomous Robotics Systems

End-to-End workflows

Complexity of Algorithms

Applying Multidomain Expertise

Page 5: Developing Autonomous Robots Using MATLAB and Simulink

5

Sense

Perceive

Plan &

Decide

Control

Platform

Page 6: Developing Autonomous Robots Using MATLAB and Simulink

6

Today: Design Pick and Place Application

Sense

Perceive

Plan &

Decide

Control

Platform

Page 7: Developing Autonomous Robots Using MATLAB and Simulink

7

Demo at the Booth

Page 8: Developing Autonomous Robots Using MATLAB and Simulink

8

Today: Design Pick and Place Application

Sense

Perceive

Plan &

Decide

Control

Platform

Page 9: Developing Autonomous Robots Using MATLAB and Simulink

9

Platform DesignHow to create a model of my system that suits my needs?

ActuatorsMechanics Environment

Page 10: Developing Autonomous Robots Using MATLAB and Simulink

10

SolidWorks Model

Simscape Multibody Model

Mechanics

Import models from common CAD Tools

Page 11: Developing Autonomous Robots Using MATLAB and Simulink

11

Mechanics: One line import from URDF

%% Import robot from URDF

smimport('j2n6s300_standalone_stl.urdf');

Demo

Page 12: Developing Autonomous Robots Using MATLAB and Simulink

12

Page 13: Developing Autonomous Robots Using MATLAB and Simulink

13

Actuators: Model other domains

Page 14: Developing Autonomous Robots Using MATLAB and Simulink

14

Modeling Actuators

Actuators

Page 15: Developing Autonomous Robots Using MATLAB and Simulink

15

Environment: Connect MATLAB and Simulink with ROS

MATLAB Code

SM Models

Built-in

algorithms

Robot

ROS node

Simulation

environment

Networking

Code Generation

ROS Bag import

Page 16: Developing Autonomous Robots Using MATLAB and Simulink

17

Design Pick and Place Application

Sense

Perceive

Plan &

Decide

Control

Platform

Demo

Page 17: Developing Autonomous Robots Using MATLAB and Simulink

18

Design Pick and Place Application

• Support for Common Sensors

• Image analysis

• Apps

• Image enhancement

• Visualizing Point Clouds

Sense

Perceive

Plan &

Decide

Control

Platform

Page 18: Developing Autonomous Robots Using MATLAB and Simulink

19

Today: Design Pick and Place Application

Sense

Perceive

Plan &

Decide

Control

Platform

Page 19: Developing Autonomous Robots Using MATLAB and Simulink

20

Object Classifier and Pose Estimator

Pose Estimator

Images Labels and Poses

Object 1 Object 2

Object 3 Object 4

Page 20: Developing Autonomous Robots Using MATLAB and Simulink

21

MATLAB makes machine learning easy and accessible

Traditional Machine Learning approach

Machine

Learning

ClassificationTraditional Feature Extraction

Boy

Dog ✓

Bicycle

Deep Learning approach

𝟗𝟓%𝟑%⚫

𝟐%

Boy

Dog ✓

Bicycle

Convolutional Neural Network (CNN)

Learned features

End-to-end learning

Feature learning + Classification

Demo

Page 21: Developing Autonomous Robots Using MATLAB and Simulink

22

Complex workflows made easy with MATLAB

obj1

obj3

obj2

obj4

Training data Preprocessing Feature Extraction Training

Classifier

% Detect regions

BW = createMask(videoFrame);

% Fill image regions

BW = imfill(BW,'holes');

% Get bounding boxes

stats = regionprops('table',BW,'BoundingBox','Area');

% Filter based on area size

targetIndex = stats.Area > 500;

% Get bounding boxes from detected regions

testFeatures(k,:) = extractHOGFeatures(Icr);

Page 22: Developing Autonomous Robots Using MATLAB and Simulink

23

Page 23: Developing Autonomous Robots Using MATLAB and Simulink

24

Design Pick and Place Application

Sense

Perceive

Plan &

Decide

Control

Platform

Page 24: Developing Autonomous Robots Using MATLAB and Simulink

25

Planning: Find a path

[𝑥𝑏 𝑦𝑏 𝜃𝑏]

Path Planner

MapInitial PoseFinal Pose

Path

[𝑥𝑎 𝑦𝑎 𝜃𝑎]

Page 25: Developing Autonomous Robots Using MATLAB and Simulink

26

Plan with

Stateflow Gripper

Control

Joint

Control

Inverse

Kinematics

Control

Waypoint Control

Page 26: Developing Autonomous Robots Using MATLAB and Simulink

27

Design Pick and Place Application

Sense

Perceive

Plan &

Decide

Control

Platform

Page 27: Developing Autonomous Robots Using MATLAB and Simulink

28

Control: Explore Built In Functions: Inverse Kinematics

% Create ik solver object

ik=robotics.InverseKinematics('RigidBodyTree’,

jaco)

% Disable random restarts

ik.SolverParameters.AllowRandomRestart = false;

% Parameters to pass to the solver

weights = [1, 1, 1, 1, 1, 1];

q_init = 0.1*ones(numel(q_home),1);

Demo

Page 28: Developing Autonomous Robots Using MATLAB and Simulink

30

Demo at the Booth

Page 29: Developing Autonomous Robots Using MATLAB and Simulink

31

Key Takeaway of this Talk

Success in developing an autonomous robotics system requires:

– Multi-domain simulation

– Trusted tools which make complex workflows easy and

integrate with other tools

– Model-based design

Page 30: Developing Autonomous Robots Using MATLAB and Simulink

32

Clearpath Robotics Accelerates Algorithm Development

for Industrial Robots

Challenge

Shorten development times for laser-based

perception, computer vision, fleet management, and

control algorithms used in industrial robots

SolutionUse MATLAB to analyze and visualize ROS data,

prototype algorithms, and apply the latest advances

in robotics research

Results

▪ Data analysis time cut by up to 50%

▪ Customer communication improved

▪ Cutting-edge SDV algorithms quickly

incorporated

“ROS is good for robotics research and development, but not for

data analysis. MATLAB, on the other hand, is not only a data

analysis tool, it’s a data visualization and hardware interface tool

as well, so it’s an excellent complement to ROS in many ways.”

- Ilia Baranov, Clearpath Robotics

Link to user story

An OTTO self-driving vehicle from Clearpath Robotics.

Page 31: Developing Autonomous Robots Using MATLAB and Simulink

33

Deep Learning with MATLAB

This two-day course provides a comprehensive introduction to practical deep learning

using MATLAB®.

Topics include:

▪ Importing image and sequence data

▪ Using convolutional neural networks for image classification, regression, and object

detection

▪ Using long short-term memory networks for sequence classification and forecasting

▪ Modifying common network architectures to solve custom problems

▪ Improving the performance of a network by modifying training options

Page 32: Developing Autonomous Robots Using MATLAB and Simulink

34

% Thank you