98
Motion Planning & Robot Planning Prof.: S. Shiry Mohsen gandomkar M.Sc Artificial Intelligence Department of Computer Eng. and IT Amirkabir Univ. of Technology (Tehran Polytechnic)

Motion Planning & Robot Planning

  • Upload
    essien

  • View
    46

  • Download
    0

Embed Size (px)

DESCRIPTION

Motion Planning & Robot Planning. Prof.: S. Shiry Mohsen gandomkar M.Sc Artificial Intelligence Department of Computer Eng. and IT Amirkabir Univ. of Technology (Tehran Polytechnic). What is Motion Planning?. - PowerPoint PPT Presentation

Citation preview

Page 1: Motion Planning & Robot Planning

Motion Planning & Robot Planning

Prof.: S. ShiryMohsen gandomkar

M.Sc Artificial IntelligenceDepartment of Computer Eng. and IT

Amirkabir Univ. of Technology(Tehran Polytechnic)

Page 2: Motion Planning & Robot Planning

What is Motion Planning?

• Motion planning is aimed at providing robots with the capability of deciding automatically which motions to execute in order to achieve their tasks without colliding with other objects in their work space

Page 3: Motion Planning & Robot Planning

Basic Definition

• Obstacles• Already occupied spaces of the world• In other words, robots can’t go there

• Free Space• Unoccupied space within the world• Robots “might” be able to go here• To determine where a robot can go, we need to

discuss what a Configuration Space is

Page 4: Motion Planning & Robot Planning

For a point robot moving in 2-D plane, C-space is

Configuration Space of A is the space (C) of all possible configurations of A.

C Cfree

Cobs

2R

The Configuration Space

qstart

qgoal

Page 5: Motion Planning & Robot Planning

For a point robot moving in 3-D, the C-space is

x

y

qstart

qgoal

C

Cfree

Cobs

3R

What is the difference between Euclidean space and C-space?

The Configuration Space

Page 6: Motion Planning & Robot Planning

The Configuration Space

• How to create it• First abstract the robot as a point object.

Then, enlarge the obstacles to account for the robot’s footprint and degrees of freedom

• In our example, the robot was circular, so we simply enlarged our obstacles by the robot’s radius (note the curved vertices)

Page 7: Motion Planning & Robot Planning

Example of a World (and Robot)

Obstacles

Free Space

Robot

x,y

Page 8: Motion Planning & Robot Planning

Configuration Space: Accommodate Robot Size

Obstacles

Free Space

Robot(treat as point object)x,y

Page 9: Motion Planning & Robot Planning

Motion Planning

• Basic problem: Collision-free path planning for one rigid or articulated object (the “robot”) among static obstacles.

• Inputs• geometric descriptions of the obstacles and the robot• kinematic and dynamic properties of the robot• initial and goal positions (configurations) of the robot

• Output• Continuous sequence of collision-free configurations

connecting the initial and goal configurations.

Page 10: Motion Planning & Robot Planning

• Complete Algorithms• Probabilistic Algorithms• Heuristic Algorithms

Algorithmic Approaches

Page 11: Motion Planning & Robot Planning

• Guaranteed to find a free path between two give configurations when exists and report failure otherwise

• Deal with connectivity of free space by capturing it on a graph.• Cell Decomposition - partition of free space• Roadmap Technique - network of curves

Complete Algorithms

Page 12: Motion Planning & Robot Planning

• Trade-off exactness against running time• Don’t guarantee a solution but if exists very likely

to find it relatively quickly• Example: Probabilistic Roadmap Algorithm

• Experimental results show that computation takes less than a second

Probabilistic Algorithms

Page 13: Motion Planning & Robot Planning

Heuristic Algorithms

• Many work well in practice but offer no performance guarantee

• Deal with a grid on configuration space• Example 1 : Potential Field• Example 2 : Approximate Cell Decomposition

Page 14: Motion Planning & Robot Planning

Previous Approaches

Page 15: Motion Planning & Robot Planning

Visibility Graphs

Page 16: Motion Planning & Robot Planning

Voronoi Diagrams

Page 17: Motion Planning & Robot Planning

Exact Cell Decomposition

Page 18: Motion Planning & Robot Planning

Approximate Cell Decomposition

Page 19: Motion Planning & Robot Planning

Potential Fields

Page 20: Motion Planning & Robot Planning

Probabilistic Roadmaps Method

Page 21: Motion Planning & Robot Planning

Problems before PRMs

• Hard to plan for many dof robots• Computation complexity for high-dimensional

configuration spaces would grow exponentially• Potential fields run into local minima• Complete, general purpose algorithms are at best

exponential and have not been implemented

Page 22: Motion Planning & Robot Planning

Difficulty with classic approaches

• Running time increases exponentially with the dimension of the configuration space.• For a d-dimension grid with 10 grid points on

each dimension, how many grid cells are there?

• Several variants of the path planning problem have been proven to be PSPACE-hard.

10d

Page 23: Motion Planning & Robot Planning

Probabilistic Roadmap (PRM): multiple queries

free space

[Kavraki, Svetska, Latombe,Overmars, 96]

local path

milestone

Page 24: Motion Planning & Robot Planning

Probabilistic Roadmap (PRM): single query

Page 25: Motion Planning & Robot Planning

Multiple-Query PRM

Page 26: Motion Planning & Robot Planning

Classic multiple-query PRM

• Probabilistic Roadmaps for Path Planning in High-Dimensional Configuration Spaces, L. Kavraki et al., 1996.

Page 27: Motion Planning & Robot Planning

Assumptions

• Static obstacles• Many queries to be processed in the same

environment• Examples

• Navigation in static virtual environments• Robot manipulator arm in a workcell

Page 28: Motion Planning & Robot Planning

Enter PRMs

• PRMs use fast collision checking techniques• PRMs avoid computing an explicit representation of the

configuration space • Two Phases

• A Learning Phase• A Query Phase

Page 29: Motion Planning & Robot Planning

The Learning Phase

• Construct a probabilistic roadmap by generating random free configurations of the robot and connecting them using a simple, but very fast motion planer, also know as a local planner

• Store as a graph whose nodes are the configurations and whose edges are the paths computed by the local planner

Page 30: Motion Planning & Robot Planning

PRM - Learning Phase

Free space

C-obstacle

Page 31: Motion Planning & Robot Planning

PRM - Learning Phase

Free space

C-obstacle

Page 32: Motion Planning & Robot Planning

Free space

milestones

C-obstacle

PRM - Learning Phase

Page 33: Motion Planning & Robot Planning

PRM - Learning Phase

Free space

milestones

C-obstacle

Page 34: Motion Planning & Robot Planning

The Query Phase

• Find a path from the start and goal configurations to two nodes of the roadmap

• Search the graph to find a sequence of edges connecting those nodes in the roadmap

• Concatenating the successive segments gives a feasible path for the robot

Page 35: Motion Planning & Robot Planning

Two geometric primitives in configuration space

• CLEAR(q)Is configuration q collision free or not?

• LINK(q, q’) Is the straight-line path between q and q’ collision-free?

Page 36: Motion Planning & Robot Planning

Uniform sampling

Input: geometry of the moving object & obstaclesOutput: roadmap G = (V, E)

1: V and E .2: repeat3: q a configuration sampled uniformly at random from C.4: if CLEAR(q)then5: Add q to V.6: Nq a set of nodes in V that are close to q.

6: for each q’ Nq, in order of increasing d(q,q’)7: if LINK(q’,q)then8: Add an edge between q and q’ to E.

Page 37: Motion Planning & Robot Planning

Difficulty

• Many small connected components

Page 38: Motion Planning & Robot Planning

Resampling (expansion)

• Failure rate

• Weight

• Resampling probability

LINK no.

LINK failed no.)( qr

ppr

qrqw

)(

)()(

)()(Pr qwq

Page 39: Motion Planning & Robot Planning

Resampling (expansion)

Page 40: Motion Planning & Robot Planning

Query processing

• Connect qinit and qgoal to the roadmap

• Start at qinit and qgoal, perform a random walk, and try to connect with one of the milestones nearby

• Try multiple times

Page 41: Motion Planning & Robot Planning

Error

• If a path is returned, the answer is always correct.• If no path is found, the answer may or may not be

correct. We hope it is correct with high probability.

Page 42: Motion Planning & Robot Planning

Why does it work? Intuition

• A small number of milestones almost “cover” the entire configuration space.

Page 43: Motion Planning & Robot Planning

Smoothing the path

Page 44: Motion Planning & Robot Planning

Smoothing the path

Page 45: Motion Planning & Robot Planning

Single-Query PRM

Page 46: Motion Planning & Robot Planning

Lazy PRM

• Path Planning Using Lazy PRM, R. Bohlin & L. Kavraki, 2000.

Page 47: Motion Planning & Robot Planning

Precomputation: roadmap construction

• Nodes• Randomly chosen configurations, which may or

may not be collision-free• No call to CLEAR

• Edges• an edge between two nodes if the

corresponding configurations are close according to a suitable metric

• no call to LINK

Page 48: Motion Planning & Robot Planning

Query processing: overview

1. Find a shortest path in the roadmap

2. Check whether the nodes and edges in the path are collision.

3. If yes, then done. Otherwise, remove the nodes or edges in violation. Go to (1).

• We either find a collision-free path, or exhaust all paths in the roadmap and declare failure.

Page 49: Motion Planning & Robot Planning

Query processing: details

• Find the shortest path in the roadmap• A* algorithm• Dijkstra’s algorithm

• Check whether nodes and edges are collisions free• CLEAR(q)• LINK(q0, q1)

Page 50: Motion Planning & Robot Planning

Node enhancement

• Select nodes that close the boundary of F

Page 51: Motion Planning & Robot Planning

Bug algorithms

Page 52: Motion Planning & Robot Planning

Bug algorithms

• Assumptions:• Point robot• Contact sensor (Bug1,Bug2) or finite range sensor

(Tangent Bug)• Bounded environment• Robot position is perfectly known• Robot can measure the distance between two

points

Page 53: Motion Planning & Robot Planning

Bug algorithms

• Algorithm consists of two behaviors:

1. Motion to goal – move toward the goal • Bug1: move along the line that connects an

“initial” point to the goal until you reach the goal or an obstacle (hit point).

• Bug2: move along the line that connects the start point to the goal until you reach the goal or an obstacle (hit point).

Page 54: Motion Planning & Robot Planning

Bug algorithms

2. Boundary following – obstacle handeling • Bug1: circumnavigate the entire perimeter of the

obstacle, find the closest point to the goal on the perimeter (leave point), move to that point .

• Bug2: circumnavigate the obstacle until you reach a new point on the line connecting start and goal, that is closer to the goal (leave point).

Page 55: Motion Planning & Robot Planning

Bug1 - example

qstart

qgoal

q1H

q1L

q2L

q2H

Motion to goal

Boundary following

Shortest path to goal

Page 56: Motion Planning & Robot Planning

Bug2 - example

qstart

qgoal

q1H

Motion to goal

Boundary following

Line connecting start and goal

q1L

q2H

q2L

Page 57: Motion Planning & Robot Planning

head-to-head comparison

What are worlds in which Bug 2 does better than Bug 1 (and vice versa) ?

Bug 2 beats Bug 1 Bug 1 beats Bug 2

Start

Page 58: Motion Planning & Robot Planning

head-to-head comparison

What are worlds in which Bug 2 does better than Bug 1 (and vice versa) ?

Bug 2 beats Bug 1 Bug 1 beats Bug 2 “zipper world”

Start

Page 59: Motion Planning & Robot Planning

Problem

Bug 2 beats Bug 1 Bug 1 beats Bug 2 “zipper world”

Page 60: Motion Planning & Robot Planning

Problem

Adjusted bug algorithm Bug M1 • use Bug2 until the robot finds itself on the S-line farther from the goal than it started• if it does, revert to to Bug1 for that obstacle

Page 61: Motion Planning & Robot Planning

Problem

Adjusted bug algorithm Bug M1 • use Bug2 until the robot finds itself on the S-line farther from the goal than it started• if it does, revert to to Bug1 for that obstacle

Page 62: Motion Planning & Robot Planning

Bug1 vs. Bug2

Bug1 Exhaustive search Optimal leave point

Performs better with complex obstacles

Path length : n = # of obstacles P

i = perimeter of

obstacle i

Bug2 Opportunistic (greedy) search

Performs better with simple obstacles

Path length : n

i = # of times the

start-goal line intersects obstacle i

n

iigoalstartBug pqqdL

11 5.1),(

n

iiigoalstartBug pnqqdL

12 5.0),(

Page 63: Motion Planning & Robot Planning

Finite range sensor

• Intervals of continuity

Page 64: Motion Planning & Robot Planning

Tangent Bug algorithm

• Improvement to the Bug2 algorithm• Assumptions:

• All assumptions of Bug1/Bug2 except for contact sensor.

• Finite range sensor with 360◦ infinite orientation resolution.

Page 65: Motion Planning & Robot Planning

Tangent Bug algorithm

• Like Bug1/Bug2, iterates between two behaviors: • motion to goal – consists of two parts:

• Move in a straight line towards the goal until you sense an obstacle directly between you and the goal

• Move toward an intermediate point* Oj according to some heuristic distance** until you reach the goal or until you reach a local minimum Mi in which case, switch to boundary following

• * Oj‘s are end points of an interval of continuity • ** For example d(x, Oj)+ d(Oj,goal)

Page 66: Motion Planning & Robot Planning

Tangent Bug algorithm

Motion to goal

t = 1 t = 2 t = 3

o1

o2

t = 4

o1

o2

Page 67: Motion Planning & Robot Planning

• Tangent Bug algorithm

• boundary following – define two distances:• dfollowing – The shortest distance between the sensed

boundary and the goal• dreach – The distance between the point on the boundary

that has a line of sight to the goal, and the goal

• continue moving around the obstacle in the same direction until dreach < dfollowing then switch to motion to goal

Page 68: Motion Planning & Robot Planning

Tangent Bug algorithm

Boundary following

goalM

Motion to goal

Page 69: Motion Planning & Robot Planning

Tangent Bug - example

qstart

qgoal

Motion to goal

Boundary following

Page 70: Motion Planning & Robot Planning

Bug algorithms

• Simple and intuitive• Straightforward to implement• Success guaranteed (when possible)• Assumes perfect positioning and sensing • Sensor based planning – has to be incremental and

reactive

Page 71: Motion Planning & Robot Planning

Multi-Robot Planning

Page 72: Motion Planning & Robot Planning

Multi-Robot Planning Examples

Page 73: Motion Planning & Robot Planning

Multi-Robot Planning

• An initial and a goal configuration are given as input for each robot

• Result is a coordinated path between the two configurations

• A coordinated path is one that indicates the configuration of every robot at each instant

• Collisions must be avoided between each pair of robot and obstacles, and between each pair of robots

Page 74: Motion Planning & Robot Planning

Centralized Planning

• Paths for all robots are planned simultaneously by searching the c-space of the multi-arm robot

• Collisions between robots are self-collisions of the multi-arm robot

• For spot-welding example, 6 robots each with 6 dofs, so C will have 36-D

Page 75: Motion Planning & Robot Planning

Centralized Planning

• Advantages• Complete – guaranteed to find a solution if one exists (if the

underlying planner is complete)

• Disadvantages• Potentially expensive – typically requires searching high-

dimensional spaces• Requires knowledge of goals and states of all robots

Page 76: Motion Planning & Robot Planning

Decoupled Planning

• First Phase - a collision-free path ti is generated for each robot considering only obstacles (ignoring other robots) in its space

Page 77: Motion Planning & Robot Planning

Decoupled Planning

• Second Phase (Velocity Tuning) – coordination of the robots’ velocities along their pre-generated paths to prevent collisions between robots. Two coordination methods discussed• Pairwise Coordination• Global Coordination

• Each robot is restricted to motion in its pre-generated path although it may stop, retreat or change velocity to allow coordination with other robots

Page 78: Motion Planning & Robot Planning

Decoupled Planning with Pairwise Coordination

• The paths t1 and t2 of the first two robots are coordinated in their 2-dimensional coordination space• Results in a collision-free coordinated patht1,2

Done by using planning a pathbetween (0,0) and (1,1)

Page 79: Motion Planning & Robot Planning

Decoupled Planning with Pairwise Coordination

• The process is repeated for paths t1,2 and t3 resulting in a coordinated path t1,2,3

• Eventually a collision-free coordinate path t1,2,…,m is generated that defines a valid coordination of all m robots

Page 80: Motion Planning & Robot Planning

Decoupled Planning with Global Coordination

• The paths of all m robots are coordinated in an m-dimensional coordination space• Results in a collision-free path t1,2,….m

Done by planning a path from (0,0,0,…) to (1,1,1,…)

Page 81: Motion Planning & Robot Planning

Decoupled Planning

• Advantages• Less expensive than centralized planning because lower

dimensional spaces are searched

• Disadvantages• Incomplete : Failures usually occur in the second phase as

it might not be possible to coordinate the paths generated in the first phase without collision between robots

Page 82: Motion Planning & Robot Planning

Decoupled Planning Failure Example

• Initial and goal configurations

Page 83: Motion Planning & Robot Planning

Decoupled Planning Failure Example

• Likely path generation in 1st phase

Page 84: Motion Planning & Robot Planning

Decoupled Planning Failure Example

• Path coordination fails in second phase

Page 85: Motion Planning & Robot Planning

Implemented Planners

• C-SBL – Centralized Planning• DG-SBL – Decoupled Planning with Global

Coordination• DP-SBL – Decoupled Planning with Pairwise

Coordination• Experiments conducted with groups of 2, 4 and 6

robots on 3 separate sets of initial/goal configurations

Page 86: Motion Planning & Robot Planning

PRM Path Planner: Sampling Strategy

• SBL Planner• Single-query• Bi-directional• Lazy collision-checking

Page 87: Motion Planning & Robot Planning

Problem I – Initial and goal configurations

Page 88: Motion Planning & Robot Planning

Problem II – Initial and goal configurations

Page 89: Motion Planning & Robot Planning

Problem III – Initial and goal configurations

Page 90: Motion Planning & Robot Planning

Experimental Results

• T = average running time (seconds)• DG-SBL and DP-SBL - 20 runs per experiment• C-SBL – 100 runs per experiment

• F = number of failures• Maximum of 50,000 milestones allowed per call

to SBL

Page 91: Motion Planning & Robot Planning

Experimental Results

• Centralized planning had no failures• At least one failure suffered in each experiment with

decoupled planning• Failure rate increased as problems became more

complex

Page 92: Motion Planning & Robot Planning

Experimental Results

• pairwise coordination more unreliable than global coordination

• Failure always occurred in the 2nd stage during path coordination, a result of wrong path choices made in the 1st stage

Page 93: Motion Planning & Robot Planning

Experimental Results

• Similar running times for both planners in most experiments

• However, centralized planning required a lot more time than decoupled planning in 3rd problem with 6 robots

Page 94: Motion Planning & Robot Planning

Conclusions

• Reliability – Decoupled planning can be quite unreliable particularly in tight robot coordination. Centralized planning appears to have perfect reliability.

• Planning Time – Using SBL, there is not a huge difference between the two methods

Page 95: Motion Planning & Robot Planning

Conclusions Contd.

• Results invalidate the assumptions that loss of incompleteness with decoupled planning is fairly insignificant and can be ignored in practice.

• SBL makes usage of centralized planning for multi-robot systems practical.

• But centralized planning still requires knowledge of all robot states, which may be impossible in some settings.

Page 96: Motion Planning & Robot Planning

Sokoban

• Objective of Robot:

To push boxes into their storage locations without getting himself or boxes stuck.

• Rules: Cannot pull, can push only one box at a time

Page 97: Motion Planning & Robot Planning

Sokoban

Page 98: Motion Planning & Robot Planning

Sample Sokoban Game