49
1 © 2015 The MathWorks, Inc. Automated Driving Development with MATLAB® and Simulink® Avinash Nehemiah Product Manager Deep Learning, Computer Vision and Automated Driving

with MATLAB® and Simulink®

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: with MATLAB® and Simulink®

1© 2015 The MathWorks, Inc.

Automated Driving Developmentwith MATLAB® and Simulink®

Avinash Nehemiah

Product Manager – Deep Learning, Computer Vision

and Automated Driving

Page 2: with MATLAB® and Simulink®

2

Perception Control

Planning

What is in the vehicle environment ?

What is the unobstructed path between two waypoints ?

How to adjust steering, braking and acceleration to execute maneuver ?

Page 3: with MATLAB® and Simulink®

3

Perception Control

Planning

Examples of how you can use MATLAB and Simulink to develop

automated driving algorithms

Control

Planning

Perception

Path planning

Lane keeping assist (LKA)

Sensor fusion

Lidar processing

Page 4: with MATLAB® and Simulink®

4

Perception Control

Planning

Examples of how you can use MATLAB and Simulink to develop

automated driving algorithms

Control

Planning

Perception

Lidar processing

Page 5: with MATLAB® and Simulink®

5

Why use Lidar for autonomous driving ?

Account for limitations of vision and radar sensors

Cameras perform poorly in bad weather or

limited visibility.

Radar not efficient at detecting object classes.

Page 6: with MATLAB® and Simulink®

6

Demo: Segment Obstacles in Drivable Path

Page 7: with MATLAB® and Simulink®

7

Import common Lidar data file formats

Polygon File Format (PLY)

Point Cloud Data (PCD)

Computer Vision System ToolboxTM.PLY

.BAG

.PCAP

ROS log files (rosbag)

Robotics System ToolboxTM

Velodyne PCAP

(VLP-16, VLP-32C, HDL-32E, HDL-64E)

Automated Driving System ToolboxTM

Page 8: with MATLAB® and Simulink®

8

Read point cloud from Velodyne log file

% Read Velodyne log data

veloReader = velodyneFileReader(...

'lidarData_ConstructionRoad.pcap',...

'HDL32E’);

ptCloud = readFrame(veloReader);

% Plot the results

player = pcplayer(...

xlimits,ylimits,zlimits);

view(player,...

ptCloud.Location,...

ptCloud.Intensity);

Page 9: with MATLAB® and Simulink®

9

Remove ground plane from point cloud

% Find ground points

groundPtsIdx = ...

segmentGroundFromLidarData(ptCloud);

% Plot ground = green, nonground = red

colorLabels( groundPtsIdx(:)) = greenIdx;

colorLabels(~groundPtsIdx(:)) = redIdx;

view(player,ptCloud.Location,colorLabels)

% Select detections above ground

nonGroundPtCloud = ...

select(ptCloud,~groundPtsIdx);

Page 10: with MATLAB® and Simulink®

10

Cluster point cloud detections

% Segment point clouds into clusters

distThreshold = 0.5;

colorLabels = segmentLidarData(...

nonGroundPtCloud, distThreshold);

% Plot segmented clusters

view(player,...

nonGroundPtCloud.Location,...

colorLabels)

Page 11: with MATLAB® and Simulink®

11

Learn about developing lidar applicationwith these examples

Ground plane segmentation

and removal

Computer Vision

System ToolboxTM

Read Velodyne

log files

Computer Vision

System ToolboxTM

Segment organized

point cloud

Computer Vision

System ToolboxTM

Page 12: with MATLAB® and Simulink®

12

Perception Control

Planning

Examples of how you can use MATLAB and Simulink to develop

automated driving algorithms

Control

Planning

Perception

Sensor fusion

Page 13: with MATLAB® and Simulink®

13

Demo: Sensor Fusion of Camera and Radar

Vision detectionRadar detection

Can we fuse detections

to better track the

vehicle?

Page 14: with MATLAB® and Simulink®

14

Track multiple object detections

Detections

Multi-Object Tracker

TracksTracking

Filter

Track

Manager

Time

Measurement

Measurement Noise

Time

State

State Covariance

Track ID

Age

Is Confirmed

Is Coasted

• Assigns detections to tracks

• Creates new tracks

• Updates existing tracks

• Removes old tracks

• Predicts and updates state of track

• Supports linear, extended, and

unscented Kalman filters

Automated Driving

System ToolboxTM

Page 15: with MATLAB® and Simulink®

15

Learn how to fuse and track detections from different sensors

Automated Driving System

ToolboxTM

Page 16: with MATLAB® and Simulink®

16

How to adjust algorithm if sensors change ?

Page 17: with MATLAB® and Simulink®

17

Synthesize scenarios to test sensor fusion algorithms

Automated Driving System

ToolboxTM

Page 18: with MATLAB® and Simulink®

18

% Create driving scenario

s = drivingScenario('SampleTime', 0.05);

% Add road

roadCenters = [0 0; 10 0; 40 20; 50 20]; % (m)

roadWidth = 5; % (m)

road(s,roadCenters,roadWidth)

plot(s)

Programmatically specify driving scenarios

Automated Driving System ToolboxTM

Page 19: with MATLAB® and Simulink®

19

% Create driving scenario

s = drivingScenario('SampleTime', 0.05);

% Add road

roadCenters = [0 0; 10 0; 40 20; 50 20]; % (m)

roadWidth = 5; % (m)

road(s,roadCenters,roadWidth)

plot(s)

% Add vehicle

egoCar = vehicle(s);

waypoints = roadCenters; % (m)

speed = 13.89; % (m/s) = 50 km/hr

trajectory(egoCar, waypoints, speed);

Programmatically specify driving scenarios

% Play scenario

while advance(s)

pause(s.SampleTime);

end

Page 20: with MATLAB® and Simulink®

20

Graphically author scenarios with Driving Scenario Designer

▪ Specify scenes

– Roads

– Lane markings

– Actor trajectories

– Actor size

– Actor radar cross-

section (RCS)

▪ Export scenes to

MATLAB code

Automated Driving

System ToolboxTM

Page 21: with MATLAB® and Simulink®

21

Azimuthal resolution (deg) 2 4 4 4

Total field of view (deg) 40 40 20 20

Add noise to measurements False False False True

Birds-Eye Plot (t=17.5 sec)

Explore effects of some radar detection generator parameters

Page 22: with MATLAB® and Simulink®

22

Synthesize detections from radar transceiver

Phased Array System ToolboxTM

Automated Driving System

ToolboxTM

Page 23: with MATLAB® and Simulink®

23

How to explore different tracking algorithms ?

Page 24: with MATLAB® and Simulink®

24

Explore functionality of point multi-object object tracker

Page 25: with MATLAB® and Simulink®

25

Some characteristics of multi-object point tracker

False track due to

imperfect clustering

Track back of

leading vehicle

Track front of

preceding vehicle

Page 26: with MATLAB® and Simulink®

26

Overview: Sensor Fusion and Tracking Toolbox

Visualization and Metrics Code Generation

Tracking and Localization AlgorithmsScenarios and Sensors Simulation

Page 27: with MATLAB® and Simulink®

27

Explore functionality of prototype extended object tracker

Page 28: with MATLAB® and Simulink®

28

Some characteristics of prototype extended object tracker

No false

track

Track rear axel of

leading vehicle

Track rear axel of

preceding vehicle

▪ No clustering needed

▪ Additional info: shape, orientation

▪ Consistent tracks

▪ Reduced false positives

▪ Computationally more expensive

Page 29: with MATLAB® and Simulink®

29

Learn about developing lidar applicationwith these examples

Design algorithm with multi-

object tracker and recorded

vehicle data

Automated Driving

System ToolboxTM

Synthesize sensor data

and driving scenarios

Automated Driving

System ToolboxTM

Extended object tracking

Automated Driving System ToolboxTM

Sensor Fusion and Tracking ToolboxTM

Page 30: with MATLAB® and Simulink®

30

Perception Control

Planning

Examples of how you can use MATLAB and Simulink to develop

automated driving algorithms

Control

Planning

Perception

Path planning

Page 31: with MATLAB® and Simulink®

31

Workflow for design and simulation of path planning for

automobiles

Rapidly-exploring Random Tree (RRT*)

Page 32: with MATLAB® and Simulink®

32

Learn about developing path planning algorithms

with these examples

▪ Plot map tiles using

World Street Map (Esri)

Automated Driving

System ToolboxTM

▪ Plan path for automobile

given pre-defined map

Automated Driving

System ToolboxTM

Page 33: with MATLAB® and Simulink®

33

Perception Control

Planning

Examples of how you can use MATLAB and Simulink to develop

automated driving algorithms

Control

Planning

Perception

Lane keeping assist (LKA)

Page 34: with MATLAB® and Simulink®

34

Demo: Lane keeping assist (LKA) for distracted driver

Page 35: with MATLAB® and Simulink®

35

Create highway double curve with drivingScenario

▪ Driver waypoints simulate distraction at curvature changes

Page 36: with MATLAB® and Simulink®

36

Reference example for LKA

Model Predictive

Control

Vehicle and Environment

Page 37: with MATLAB® and Simulink®

37

Simulate distracted driver

Page 38: with MATLAB® and Simulink®

38

Simulate lane keep assist at distraction events

Page 39: with MATLAB® and Simulink®

39

Compare distracted and assisted results

▪ Detect lane departure

and maintain lane

during distraction

Page 40: with MATLAB® and Simulink®

40

Simulate lane following by increasing minimum safe distance

Page 41: with MATLAB® and Simulink®

41

Graphically edit scenarios with Driving Scenario Designer

Page 42: with MATLAB® and Simulink®

42

Explore what is required to follow high curvature paths

Page 43: with MATLAB® and Simulink®

43

Explore what is required to follow high curvature paths

Page 44: with MATLAB® and Simulink®

44

How can I design with virtual scenarios?

Scenes Driving Scenarios (cuboid)

Testing Controls

Controls + sensor fusion

Authoring Driving Scenario Designer App

drivingScenario programmatic API

Sensing Probabilistic radar detections

Probabilistic vision detections

Probabilistic lane detections

Page 45: with MATLAB® and Simulink®

45

How can I design with virtual scenarios?

Scenes Driving Scenarios (cuboid) Unreal Engine

Testing Controls

Controls + sensor fusion

Controls

Controls + vision

Authoring Driving Scenario Designer App

drivingScenario programmatic API

Unreal Editor

Sensing Probabilistic radar detections

Probabilistic vision detections

Probabilistic lane detections

Ideal camera (viewer)

Page 46: with MATLAB® and Simulink®

46

Learn about synthesizing sensor detections to develop

control algorithms with these examples

▪ Edit roads, cuboid actors,

and sensors with

Driving Scenario Designer App drivingScenarioDesigner

▪ Simulate and

generate C++ for

model-predictive control

with lane detections

▪ Simulate and

generate C++ for

model-predictive control and

sensor fusion algorithms

Page 47: with MATLAB® and Simulink®

47

Learn about modeling vehicle dynamics to develop control

algorithms with these examples

▪ Simulate vehicle

dynamics for closed

loop design

Vehicle Dynamics BlocksetTM

▪ Co-simulate with Unreal

Engine to set actor positions

and get camera image

Vehicle Dynamics BlocksetTM

Page 48: with MATLAB® and Simulink®

48

MathWorks can help you customize MATLAB and Simulink for

your automated driving application

▪ Web based ground

truth labeling▪ Consulting project with Caterpillar

▪ 2017 MathWorks Automotive

Conference

▪ Lidar ground truth

labeling▪ Joint presentation with Autoliv

▪ SAE Paper 2018-01-0043

▪ 2018 MathWorks Automotive

Conference

▪ Lidar sensor model for

Unreal Engine▪ Joint paper with Ford

▪ SAE Paper 2017-01-0107

Page 49: with MATLAB® and Simulink®

49

Perception Control

Planning

Examples of how you can use MATLAB and Simulink to develop

automated driving algorithms

Control

Planning

Perception

Path planning

Sensor models &

model predictive control

Sensor fusion

Lidar processing