Roland Geraerts Seminar Crowd Simulation 2011

Slides:



Advertisements
Similar presentations
AI Pathfinding Representing the Search Space
Advertisements

COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Surface Reconstruction From Unorganized Point Sets
Motion Planning for Point Robots CS 659 Kris Hauser.
NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.
By Lydia E. Kavraki, Petr Svestka, Jean-Claude Latombe, Mark H. Overmars Emre Dirican
The Voronoi Diagram David Johnson. Voronoi Diagram Creates a roadmap that maximizes clearance –Can be difficult to compute –We saw an approximation in.
Computational Geometry The systematic study of algorithms and data structures for geometric objects, with a focus on exact algorithms that are asymptotically.
Roland Geraerts and Mark Overmars ICRA 2007 The Corridor Map Method: Real-Time High-Quality Path Planning.
Way to go: A framework for multi-level planning in games Norman Jaklin Wouter van Toll Roland Geraerts Department of Information and Computing Sciences.
Creating High-quality Roadmaps for Motion Planning in Virtual Environments Roland Geraerts and Mark Overmars IROS 2006.
Raster Based GIS Analysis
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
C ROWD P ATCHES : P OPULATING L ARGE - S CALE V IRTUAL E NVIRONMENTS FOR R EAL -T IME A PPLICATIONS Barbara Yersin, Jonathan Maïm, Julien Pettré, Daniel.
Presenter: Robin van Olst. Avneesh SudRussell Gayle Erik Andersen Stephen GuyMing Lin Dinesh Manocha.
Delaunay Triangulation on the GPU Dan Maljovec. CPU Delaunay Triangulation Randomized Incremental Algorithm 1.Construct Bounding triangle 2.Choose point.
By Dor Lahav. Overview Straight Skeletons Convex Polygons Constrained Voronoi diagrams and Delauney triangulations.
On Improving the Clearance for Robots in High-Dimensional Configuration Spaces Roland Geraerts and Mark Overmars IROS 2005.
CS 326 A: Motion Planning robotics.stanford.edu/~latombe/cs326/2003/index.htm Configuration Space – Basic Path-Planning Methods.
CS 326A: Motion Planning Basic Motion Planning for a Point Robot.
Chapter 5: Path Planning Hadi Moradi. Motivation Need to choose a path for the end effector that avoids collisions and singularities Collisions are easy.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Constraint-Based Motion Planning using Voronoi Diagrams Maxim Garber and Ming C. Lin Department of Computer.
Navigation Meshes for Realistic Multi-Layered Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts Utrecht University, The Netherlands.
1Notes. 2 Time integration for particles  Back to the ODE problem, either  Accuracy, stability, and ease-of- implementation are main issues  Obviously.
Probabilistic Roadmaps for Path Planning in High-Dimensional Configuration Spaces Lydia E. Kavraki Petr Švetka Jean-Claude Latombe Mark H. Overmars Presented.
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
Multi-Layered Navigation Meshes Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts ICT.OPEN 2011.
Ioannis Karamouzas, Roland Geraerts, Mark Overmars Indicative Routes for Path Planning and Crowd Simulation.
A Navigation Mesh for Dynamic Environments Wouter G. van Toll, Atlas F. Cook IV, Roland Geraerts CASA 2012.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Introduction Tracking the corners Camera model and collision detection Keyframes Path Correction Controlling the entire path of a virtual camera In computer.
© Manfred Huber Autonomous Robots Robot Path Planning.
Computational Geometry The systematic study of algorithms and data structures for geometric objects, with a focus on exact algorithms that are asymptotically.
Planning Near-Optimal Corridors amidst Obstacles Ron Wein Jur P. van den Berg (U. Utrecht) Dan Halperin Athens May 2006.
Algorithms for Triangulations of a 3D Point Set Géza Kós Computer and Automation Research Institute Hungarian Academy of Sciences Budapest, Kende u
Using the Corridor Map Method for Path Planning for a Large Number of Characters Roland Geraerts, Arno Kamphuis, Ioannis Karamouzas, Mark Overmars MIG’08.
2D/3D Shape Manipulation, 3D Printing Shape Representations Slides from Olga Sorkine February 20, 2013 CS 6501.
Path Planning for a Point Robot
Motion Planning in Games Mark Overmars Utrecht University.
From Path Planning to Crowd Simulation
Voronoi Diagram (Supplemental)
Mesh Coarsening zhenyu shu Mesh Coarsening Large meshes are commonly used in numerous application area Modern range scanning devices are used.
112/5/ :54 Graphics II Image Based Rendering Session 11.
UNC Chapel Hill M. C. Lin Introduction to Motion Planning Applications Overview of the Problem Basics – Planning for Point Robot –Visibility Graphs –Roadmap.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Wouter G. van Toll Atlas F. Cook IV Roland Geraerts Realistic Crowd Simulation with Density-Based Path Planning ICT.OPEN / ASCI October 22nd, 2012.
Delaunay Triangulation on the GPU
3D Object Representations 2011, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
Autonomous Robots Robot Path Planning (3) © Manfred Huber 2008.
Roland Geraerts and Erik Schager CASA 2010 Stealth-Based Path Planning using Corridor Maps.
CDS 301 Fall, 2008 Domain-Modeling Techniques Chap. 8 November 04, 2008 Jie Zhang Copyright ©
Non-Photorealistic Rendering FORMS. Model dependent Threshold dependent View dependent Outline form of the object Interior form of the object Boundary.
3D Object Representations 2009, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
Bigyan Ankur Mukherjee University of Utah. Given a set of Points P sampled from a surface Σ,  Find a Surface Σ * that “approximates” Σ  Σ * is generally.
Autonomous Robots Robot Path Planning (2) © Manfred Huber 2008.
VORONOI DIAGRAMS FOR PARALLEL HALFLINES IN 3D
Constructing Objects in Computer Graphics By Andries van Dam©
3D Object Representations
Indicative Routes for Path Planning and Crowd Simulation
A Comparative Study of Navigation Meshes . Motion in Games 2016
A Comparative Study of Navigation Meshes . Motion in Games 2016
Crowd Simulation (INFOMCRWS) - Introduction to Crowd Simulation
A Comparative Study of Navigation Meshes
Domain-Modeling Techniques
Roland Geraerts and Mark Overmars CASA’08
Computational Geometry
CSE 554 Lecture 3: Shape Analysis (Part II)
Classic Motion Planning Methods
Presentation transcript:

Roland Geraerts Seminar Crowd Simulation 2011 Path Planning with Explicit Corridor Maps Related work Constructing Explicit Corridor Maps Corridor Map Method Exploiting Explicit Corridors Roland Geraerts Seminar Crowd Simulation 2011 See http://www.cs.uu.nl/docs/vakken/mcrs/index.html for more information about the Seminar Crowd simulation.

Related work: A* Method Advantage Disadvantages Construction phase: create a grid, mark free/blocked cells Query phase: use A* to find the shortest path (in the grid) Advantage Simple Disadvantages Too slow in large scenes Ugly paths Little clearance to obstacles Unnatural motions (sharp turns) Fixed paths Predictable motions Paths resulting from A* algorithms tend to have little clearance to obstacles and can be aesthetically unpleasant, so care must be taken to smooth them. See http://theory.stanford.edu/~amitp/GameProgramming for more information/theory on A*. Major improvements: See e.g.: Field D*: An interpolation-based path planner and replanner (Dave Ferguson and Anthony Stentz)

Related work: Potential Fields Method Goal generates attractive force Obstacles generate repulsive force Follow the direction of steepest descent of the potential toward the goal Advantages Flexibility to avoid local hazards Smooth paths Disadvantages Expensive for multiple goals Local minima

Related work: Probabilistic Roadmap Method Construction phase: build the roadmap Query phase: query the roadmap Advantages Reasonably fast High-dimensional problems Disadvantages Ugly paths Fixed paths Predictable motions Lacks flexibility when environment changes

Related work: Probabilistic Roadmap Method Construction phase: build the roadmap Query phase: query the roadmap Advantages Reasonably fast High-dimensional problems Disadvantages Ugly paths Fixed paths Predictable motions Lacks flexibility when environment changes The 3D puzzle example has only 3 DOF’s but is more difficult for humans compared to the second example. Here, a 6 DOF elbow-shaped object must move through a narrow passage. This one’s more difficult for a computer.

State-of-the-art: Navigation meshes Method Create a representation of the "walkable areas" of an environment Extract the path Advantages General approach Construction is fast due to use of GPU Examples and source code can be found on http://code.google.com/p/recastnavigation Disadvantages Often needs a lot of manual editing Current techniques are imprecise Bad support for non-planar surfaces Obstacles Walkable voxels http://www.navpower.com/technology.html http://www.gamedev.net/community/forums/topic.asp?topic_id=258561 http://aigamedev.com/open/article/halo-ai/ Raycast navigation code: see http://code.google.com/p/recastnavigation Voxel regions Polygonal regions Convex regions A path

State-of-the-art: Navigation meshes Some open problems Automatic annotation of the map Areas: walk, climb, jump, crouch, “avoid” … Special places: hiding and sniper spots, … Handle large (dynamic) changes Efficiently updating the data structure and paths Improve the efficiency of mesh generation (large scenes) Wrong coverage/connectivity due to confusing elements Steep stairs, ramps, hills, curved surfaces, gaps The mesh is only a data structure storing the walkable areas How to create visually convincing paths? Lead AI-programmer halo: (first 3 open problems)

Towards a new methodology: Requirements Fast and flexible path planner Real-time planning for thousands of characters Dealing with local hazards Global path Natural paths Smooth Short Keeps some distance to obstacles Avoids other characters … Titan Quest: Immortal throne

Capturing the free space Requirements of the data structure representing the free (walkable) space Existence of a path Contains all cycles Short global paths, alternative paths Provides high-clearance paths (corridors) Provides maximum local flexibility Small size Fast extraction of paths A good candidate Generalized Voronoi Diagram + annotation First, if a path exists in the free space then a corridor must exist in the map, which leads the character to its goal position. Second, the map includes all cycles that are present in the environment. These cycles provide short global paths and alternative routes which allow for variation in the characters’ routes. Third, corridors extracted from the map have a maximum clearance. Such a corridor provides maximum local flexibility. Fourth, the map is small with respect to the number of vertices and edges. Such a map facilitates low query times. Fifth, the map facilitates efficient extraction of paths. Creating paths efficiently is crucial because we focus on interactive environments.

Some inspiration from natural objects… Voronoi Diagram Some inspiration from natural objects… maple leaf drying mud giraffe bacteria colonies wasps nest

Voronoi Diagram Definitions Voronoi region: set of all points closest to a given point Voronoi diagram: union of all Voronoi regions Voronoi sites: (red) points

Approximation of the Voronoi Diagram Compute a distance mesh for each point Render each mesh in a different color by using the GPU Using the Z-buffer, only pixels with the lowest distance values attribute to a pixel in the Frame buffer A parallel projection of the meshes gives the diagram Perspective view (Z-buffer) Top view (Frame buffer)

Generalized Voronoi Diagram Generalized Voronoi Diagram supports any type of obstacles Point, disk, line, polygon, … Convert concave polygons into convex ones, otherwise edges do not run into all corners

Generalized Voronoi Diagram Generalized Voronoi Diagram supports any type of obstacles Point, disk, line, polygon, … Convert concave polygons into convex ones, otherwise edges do not run into all corners Distance meshes Point: cone Disk: lifted cone Line: tent + 2 cones Polygon: n (point + line meshes) Literature [Hoff et al., 1999] [Geraerts and Overmars, 2010]

Generalized Voronoi Diagram (GVD) From GDV to Medial axis Generalized Voronoi Diagram (GVD) Render distance meshes for each obstacle Boundaries: bisectors between any two closest obstacles Medial axis Yields bisectors between any two distinct closest obstacles Extraction of the medial axis Edge: trace pixels between Voronoi regions; continue tracing when closest points on the obstacles are equal Vertex: end point of an edge GVD Medial axis

Medial axis The good The bad The ugly Existence of a path: full coverage/connectivity Contains all cycles: yes Provides high-clearance paths: yes Small size: yes (linear) Fast extraction of paths: yes The bad Unclear how to extract short(est) paths Moving along 1D-curves limits flexibility The ugly Deal with robustness

Plus: annotated event points on the edges Explicit Corridor Map Basis: Medial Axis Plus: annotated event points on the edges Points where the type of bisector on the edge changes Straight lines versus parabola’s (bisector of point and line) Changes occur at crossing between site normal and edge Annotation: its two closest points on the sites Equals: planar subdivision (or navigation mesh) Memory footprint The storage is linear in the number of obstacle vertices. The bisector of a point and point, or line segment and line segment is a straight line. Note There is no need for storing pixels.

Explicit Corridor Map: closest points Computation of the closest points Look up incident colors at the event point’s position Each color was linked to an unique obstacle Compute the (left and right) closest points to each obstacle using simple linear algebra The most important function computes the closest point on a straight-line: void getNearestPointOnLineSegment(Point &a, Point &b, double px, double py, Point &pt) { // SEE IF a IS THE NEAREST POINT - ANGLE IS OBTUSE double ax = a.x, ay = a.y; double bx = b.x, by = b.y; double dot_ta = (px - ax) * (bx - ax) + (py - ay) * (by - ay); if (dot_ta <= 0) // IT IS OFF THE A VERTEX pt.x = a.x; pt.y = a.y; return; } // SEE IF b IS THE NEAREST POINT - ANGLE IS OBTUSE double dot_tb = (px - bx) * (ax - bx) + (py - by) * (ay - by); if (dot_tb <= 0) pt.x = b.x; pt.y = b.y; // FIND THE REAL NEAREST POINT ON THE LINE SEGMENT - BASED ON RATIO double div = dot_ta / (dot_ta + dot_tb); pt.x = ax + (bx - ax) * div; pt.y = ay + (by - ay) * div;

Explicit Corridor Map: experiments Performance Setup NVIDIA GeForce 8800 GTX graphics card Intel Core2 Quad CPU 2.4 GHz, 1 CPU used Experiments McKenna: 200x200 meter, 1600x1600 pixels, 23 convex polygons

Explicit Corridor Map: experiments Performance Setup NVIDIA GeForce 8800 GTX graphics card Intel Core2 Quad CPU 2.4 GHz, 1 CPU used Experiments McKenna: 200x200 meter, 1600x1600 pixels, 23 convex polygons ECM v3.31 generates an Explicit Corridor Map. (c) Roland Geraerts. Loaded input file [F1]: data/military.pri No output written to an .ecm file. Info Explicit Corridor Map Nr primitives : 27 Nr voronoi vertices : 56 Nr voronoi edges : 70 Nr closest point pairs: 283 Time (ms) : 32.1844 time: 0.03s

Explicit Corridor Map: experiments Performance Setup NVIDIA GeForce 8800 GTX graphics card Intel Core2 Quad CPU 2.4 GHz, 1 CPU used Experiments City: 500x500 meter, 4000x4000 pixels, 548 convex polygons

Explicit Corridor Map: experiments Performance Setup NVIDIA GeForce 8800 GTX graphics card Intel Core2 Quad CPU 2.4 GHz, 1 CPU used Experiments City: 500x500 meter, 4000x4000 pixels, 548 convex polygons ECM v3.31 generates an Explicit Corridor Map. (c) Roland Geraerts. Loaded input file [F1]: data/city.pri No output written to an .ecm file. Info Explicit Corridor Map Nr primitives : 552 Nr voronoi vertices : 1474 Nr voronoi edges : 1653 Nr closest point pairs: 6392 Time (ms) : 293.721 time: 0.3s

Explicit Corridor Map: experiments Supports large environments E.g. 1 km2 Millimeter precision However, there must be at least two pixels in between two obstacles to discover an edge

Explicit Corridor Map: recent work Extension to 2.5D (multi-layered) environments Technique Result (46 ms) Multi-layered environment Partial medial axes for Li and Lj Connection scene Updated medial axes for Li and Lj

Explicit Corridor Map: recent work Handling dynamic changes Technique for adding a point/line Result (1 – 2.7 ms per update) A Finding closest site Continue in 1 dir. w1 has been reached Updated VD (point) Updated VD (line)

Compare with the old approach Disadvantages Implicit Corridor Map More than linear storage (due to discrete sample points) Non-exact representation Additional parameters required for local sampling density

Explicit Corridor Map: some thoughts Open questions Can we make a dynamic version of the ECM? Dimensionality Can we generalize the ECM data structure to 2.5D? How should we add height information? How can we handle these extensions? Terrains (elevation) Different topological spaces Different terrain types (grass, road, pavement) How should we handle holes and enable jumping? Examples of different topological spaces (plane, sphere, cylinder, torus, Möbius strip, Klein bottle)

The Corridor Map Method Construction phase (offline) Build Explicit Corridor Map Build kd-tree that stores the ECM Query phase (on-line) Construct indicative route CMM: Medial axis

The Corridor Map Method Construction phase (offline) Build Explicit Corridor Map Build kd-tree that stores the ECM Query phase (on-line) Construct indicative route CMM: Medial axis Compute a corridor Compute a path Distinguish three scales 1. Macro (corridor) 2. Meso (indicative route) 3. Micro (local behavior)

The Corridor Map Method Query phase (on-line) Retract the start and goal to the medial axis Query the kd-tree Connect the start and goal to the Corridor Map Compute the shortest backbone path (using A*) Explicit Corridor Map Query Corridor with its backbone path

The Corridor Map Method Query phase (on-line) Compute the path While the corridor determines the character’s global path, forces determine its local path The force F(x)=Fa(x)+Fo(x) causes the character to accelerate, pulling it toward the goal. The variable x is the character’s position Using Newton's Second Law, we have F = Ma, where M = mass = 1 and a = acceleration Hence, the force F can be expressed as: Combining these expressions gives us: Fa(x): attraction force Fo(x): other forces A smooth path

The Corridor Map Method Query phase (on-line) Compute the path: forces The attraction force steers the character toward the goal Fa(x) = , where f controls the magnitude a(x) = attraction point: the furthest point on the backbone path whose disk encloses the character. α(x) x goal Note on old approach This is an discrete corridor instead of continuous explicit corridor. x: position of the character Fa(x): attraction force Fo(x): other forces R[t]: radius of the disk with center a(x) R: radius of the character D: distance between the character and the center

The Corridor Map Method Query phase (on-line) Compute the path: forces The boundary force keeps the character inside the corridor This force is hidden inside the attraction force: (r=character’s radius) f=0, when the character is positioned at its attraction point (i.e. d=0) f=∞, when the character touches the disk’s boundary α(x) x goal R[t] d Note on old approach This is an discrete corridor instead of continuous explicit corridor. x: position of the character Fa(x): attraction force Fo(x): other forces R[t]: radius of the disk with center a(x) R: radius of the character D: distance between the character and the center IRM: Indicative Route Method; see http://www.cs.uu.nl/~roland/motion_planning/irm.html

The Corridor Map Method Query phase (on-line) Compute the path Solving the equation gives us the character’s positions Cannot be done analytically revert to a numerical approximation Fa(x): attraction force Fo(x): other forces A smooth path

The Corridor Map Method Choice of forces Combining these forces and using disks was a bad choice This is solved by the IRM, which uses Explicit Corridors Comparison of their vector fields Old definition of Corridor (=Implicit corridor) Sequence of largest empty disks centered around the backbone path Disadvantages Hard to compute an appropriate boundary force Expensive/difficult to compute the shortest path the path with a certain minimum amount of clearance Reason No explicit description of the corridor’s boundary Vector field: CMM force Vector field: IRM force

The Corridor Map Method: Examples Query phase (on-line) Compute the path: forces Adding/changing forces leads to other “behavior” Smooth path Short path Obstacle avoidance Obstacle avoidance (Helbing model) + path variation = crowd? Coherent groups Path variation Camera path

The Corridor Map Method: Examples Query phase (on-line) Compute the path: forces Adding/changing forces leads to other “behavior” Stealth-based path planning See http://www.cs.uu.nl/~roland/motion_planning/stealth_corridor_map/index.html for more information.

Exploiting Explicit Corridors The Corridor’s boundaries are given explicitly Construction Convenient representation Small storage: linear in the number of samples (i.e. events) Computation of closest points in O(1) time (on average) Allows computing shortest minimum-clearance paths Allows computing shortest minimum-clearance paths in linear time in the number of event points!

Explicit Corridors: Obtaining clearance Minimum clearance in explicit corridors For each closest point cp, move cp toward its center point c The displacement equals the desired clearance clmin Insert event point(s) if clmin > distance(c, cp) c cp Explicit Corridor Shrunk corridors Shrinking a corridor

Explicit Corridors: Shortest paths Computing the shortest path Construct a triangulation 2ith triangle: (li , ri , li+1) ; 2i+1th triangle: (ri , li+1 , ri+1) If the start [goal] is not included, add triangle (s, l1 , r1 ) [(ln , rn ,g)] Compute the shortest path Funnel algorithm [Guibas et al. 1987] li+1 ri+1 g li ri s Explicit Corridor Triangulation Shortest path

Explicit Corridors: Shortest paths Sketch of the Funnel algorithm Funnel Tail: computed shortest path from start to apex Fan: 2 outward convex chains plus one diagonal The fan keeps track of all possible shortest paths Algorithm Add diagonals iteratively while updating the funnel Algorithm is linear in the number of diagonals (or events) start tail apex fan diagonal goal

Explicit Corridors: Shortest paths Computing the shortest minimum clearance path Shrink the corridor Construction time: linear in the number of event points Compute the shortest path Adjust Funnel algorithm to deal with circular arcs Left/right closest points Triangulation Shortest path

Compute a smooth path: Indicative Route Method Improving the CMM: IRM Compute a smooth path: Indicative Route Method Compute the shortest minimum-clearance path Define the attraction force Pulls the character toward the goal Define the boundary force Keeps the character inside the corridor Time-integrate the forces Yields a smooth (C1-continous) path

The Query Phase: Experiments Performance Setup Intel Core2 Quad CPU 2.4 GHz, 1 CPU Experiments City: 500x500 meter, 1.000 random queries Results (average query time)

The Query Phase: Experiments Performance Setup Intel Core2 Quad CPU 2.4 GHz, 1 CPU Experiments City: 500x500 meter, 1 query Results (query time) 2.8 ms ECM (0.3s) Explicit corridor Shrunk corridor Triangulation Shortest path Smooth path

Integration in Second Life Implementation in Second Life Virtual World Bitmap Interface Camera path Path planning on server: http request

Conclusion Advantages Open problems Fast and flexible planner creates visually convincing paths Computation of smooth, short minimum clearance paths The algorithms run in linear time and are fast The algorithms are simple Open problems Automatic annotation of the navigation mesh Handling 3D spaces Handling extensions Handling character behavior E.g. shopping and beach behavior Interaction between different entities (human, car, bicycle)