Workshop 1: Crowd Simulation Software & Collision Avoidance

Slides:



Advertisements
Similar presentations
Controlling Individual Agents in High Density Crowd Simulation N. Pelechano, J.M. Allbeck and N.I. Badler (2007)
Advertisements

Data Mining Methodology 1. Why have a Methodology  Don’t want to learn things that aren’t true May not represent any underlying reality ○ Spurious correlation.
Way to go: A framework for multi-level planning in games Norman Jaklin Wouter van Toll Roland Geraerts Department of Information and Computing Sciences.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Reciprocal Velocity Obstacles for Real-Time Multi-Agent Navigation Jur van den Berg Ming Lin Dinesh Manocha.
Jur van den Berg, Stephen J. Guy, Ming Lin, Dinesh Manocha University of North Carolina at Chapel Hill Optimal Reciprocal Collision Avoidance (ORCA)
Robotics Simulator Intelligent Systems Lab. What is it ? Software framework - Simulating Robotics Algorithms.
Presenter: Robin van Olst. Avneesh SudRussell Gayle Erik Andersen Stephen GuyMing Lin Dinesh Manocha.
Reinforcement Learning Rafy Michaeli Assaf Naor Supervisor: Yaakov Engel Visit project’s home page at: FOR.
SE320: Introduction to Computer Games Week 8: Game Programming Gazihan Alankus.
Crowd Simulations Guest Instructor - Stephen J. Guy.
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.
Process Flowsheet Generation & Design Through a Group Contribution Approach Lo ï c d ’ Anterroches CAPEC Friday Morning Seminar, Spring 2005.
Using the Corridor Map Method for Path Planning for a Large Number of Characters Roland Geraerts, Arno Kamphuis, Ioannis Karamouzas, Mark Overmars MIG’08.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
Ioannis Karamouzas, Roland Geraerts and A. Frank van der Stappen Space-time Group Motion Planning.
Learning to perceive how hand-written digits were drawn Geoffrey Hinton Canadian Institute for Advanced Research and University of Toronto.
Adrian Treuille, Seth Cooper, Zoran Popović 2006 Walter Kerrebijn
Learning to Navigate Through Crowded Environments Peter Henry 1, Christian Vollmer 2, Brian Ferris 1, Dieter Fox 1 Tuesday, May 4, University of.
Outline The role of information What is information? Different types of information Controlling information.
CSC321 Introduction to Neural Networks and Machine Learning Lecture 3: Learning in multi-layer networks Geoffrey Hinton.
Hengchin Yeh, Sean Curtis, Sachin Patil, Jur van den Berg, Dinesh Manocha, Ming Lin University of North Carolina at Chapel Hill ACM 2008 Walter Kerrebijn.
Wouter G. van Toll Atlas F. Cook IV Roland Geraerts Realistic Crowd Simulation with Density-Based Path Planning ICT.OPEN / ASCI October 22nd, 2012.
City College of New York 1 John (Jizhong) Xiao Department of Electrical Engineering City College of New York Mobile Robot Control G3300:
Roland Geraerts and Erik Schager CASA 2010 Stealth-Based Path Planning using Corridor Maps.
Prediction of Interconnect Net-Degree Distribution Based on Rent’s Rule Tao Wan and Malgorzata Chrzanowska- Jeske Department of Electrical and Computer.
Another Example: Circle Detection
PSY 626: Bayesian Statistics for Psychological Science
Process Overview.
EEC-693/793 Applied Computer Vision with Depth Cameras
Introduction: Computer programming
Memory Management.
Deep Feedforward Networks
Software Metrics 1.
Game Architecture Rabin is a good overview of everything to do with Games A lot of these slides come from the 1st edition CS 4455.
EEC-693/793 Applied Computer Vision with Depth Cameras
A Study of Group-Tree Matching in Large Scale Group Communications
CS b659: Intelligent Robotics
CS 332: Algorithms Hash Tables David Luebke /19/2018.
Towards Secure Programs: How to Write Unreadable Programs
CJT 765: Structural Equation Modeling
EEC-693/793 Applied Computer Vision with Depth Cameras
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
Optimizing Malloc and Free
PSY 626: Bayesian Statistics for Psychological Science
Crowd Simulation (INFOMCRWS) - Course Introduction
Crowd Simulation (INFOMCRWS) - Introduction to Crowd Simulation
A Comparative Study of Navigation Meshes
Roland Geraerts and Mark Overmars CASA’08
Navigation In Dynamic Environment
Crowd Simulation (INFOMCRWS) - UU Crowd Simulation Software
Workshop II UU Crowd Simulation Framework
Objective of This Course
Crowd Simulation (INFOMCRWS) - A* Search
The Role of Prototyping
Find API Usage Patterns
GENERAL VIEW OF KRATOS MULTIPHYSICS
CIS 488/588 Bruce R. Maxim UM-Dearborn
Professor John Canny Spring 2004 March 5
Algorithms and Problem Solving
MORE ON ARCHITECTURES The main reasons for using an architecture are maintainability and performance. We want to structure the software into reasonably.
Workshop: A* Search.
Tonga Institute of Higher Education IT 141: Information Systems
EEC-693/793 Applied Computer Vision with Depth Cameras
Tonga Institute of Higher Education IT 141: Information Systems
Professor John Canny Spring 2003 March 12
More ideas for research projects
Presentation transcript:

Workshop 1: Crowd Simulation Software & Collision Avoidance Wouter van Toll Path Planning course September 17, 2015

Workshop 1: Crowd Simulation Software & Collision Avoidance Goal of this workshop Theory Understand the various crowd simulation levels Gain insights in collision avoidance Think about (CA) experiments Practice Reduce your fear of C++ Know how our framework is structured Prepare for Assignment 2 December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Outline Introduction Framework demo Collision avoidance Create a basic model Advanced models + demo A bit on C++ Framework implementation Assignment 2 Compare collision avoidance methods December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Crowd simulation framework Introduction December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Crowd simulation framework December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance 4: Global path planning We use the Explicit Corridor Map Compact navigation mesh Supports any character radius Multi-layered environments Dynamic updates Other options could also work As long as the result is an indicative route December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance 3: Path following Indicative Route Method (IRM, 2009) Input: indicative route, non-smooth indication of the path In each simulation step, compute an attraction point Leads to a preferred velocity for the next level MIRAN (#7): improvement by Jaklin et al. (2013) Supports weighted regions Better smoothness/shortcut control December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Main idea Let the character roughly move in its preferred direction... ...while avoiding collisions with others Many ways to do this Lots of (ongoing) research How to evaluate? Big focus of the course More after the demo! December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance The ECM framework in action Demo December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Level 2 of the crowd simulation framework Collision avoidance December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Main task A character has a preferred velocity Choose a (preferably similar) velocity that avoids collisions Trade-off between quality and efficiency? We want to simulate lots of characters in real-time We have to approximate using assumptions General assumptions Detached from global planning Characters are disks (?) ... December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

What makes a method good? You’ve seen games with CA errors Which factors do you think are important? Character’s properties: velocity, size, psychological parameters, personal space, collision shape, … Obstacles in the environment Knowledge about movements of other characters Heterogeneous characters Social rules, group behavior Collision handling Smoothness Coordination between characters/groups ... December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Try it: 2 characters Given: 2 characters C1 and C2 Radius C1.r and C2.r Position C1.pos and C2.pos Current velocity C1.v and C2.v Preferred velocity C1.vpref and C2.vpref Think of an algorithm that avoids a collision Which main approach do you choose? Work in pairs (without colliding) December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Try it: n characters Given: n characters { C0 ... Cn-1 } Radius Ci.r Position Ci.pos Current velocity Ci.v Preferred velocity Ci.vpref Think of an algorithm such that C0 avoids all others Which main approach do you choose? December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Existing directions Force-based (Helbing #9, Reynolds #8) F = collision forces + social forces + attraction forces + ... dv/dt = F/m dp/dt = v Velocity-based (van den Berg #12, Karamouzas #13) Characters actively choose a new v Assumed to be “solving all problems” Hybrid (Moussaïd #34) Characters actively choose a desired velocity vdes Forces can still be added, e.g. in case of collisions dv/dt = F/m + (vdes - v) / τ December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Circle Demo December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Verdict Based on this demo: what do you think? Karamouzas is more predictive Moussaïd has better collision handling Karamouzas can converge without finishing ORCA is theoretically perfect, but may not be natural A general conclusion? Metrics: How do you measure “goodness”? Scenarios: Different environments, crowd sizes, ... Papers #30 and #31 on validation Validation is getting bigger “How can I be sure that your method is realistic?” December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Metrics and Scenarios What metrics could be used to compare CA algorithms? Path length Time to reach the goal Total rotation Total acceleration/deceleration Number/length of collisions ... Ideal: measure similarity to human behavior? December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Metrics and Scenarios What scenarios could be used to compare CA algorithms? Two opposing characters (position swap) Two opposing flows Overtaking characters Circle, square: variable size, number of characters Randomly distributed characters Narrow passages? Obstacles? ... But even with the right metrics and scenarios... ...“paper vs. implementation” December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Paper vs. Implementation December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Paper vs. Implementation It’s hard to judge a method in practice Not all parameter settings are well described Lots of details are up to the programmer Some necessary hacks are not mentioned Small changes can have huge impacts It helps if the software is available Then at least there’s one “ultimate” version Does it match the paper? Does it fit into your software? December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Or actually multiple bytes A bit on c++ December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Framework implementation Crowd simulation in the ECM Framework Framework implementation December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Software overview Libraries for different components ECM, environment, simulation, geometry, visualization, ... External libraries: Boost, OpenGL Demo projects Demo_ECMGenerator and Demo_ECMSimulation DLL Easy to link to other software, e.g. Unity Documentation: Doxygen Code comments generate nice HTML pages Version control: Mercurial December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Single simulation step Core of the crowd simulation engine performStep(Δt) Increase total time by Δt For each character: path following Update pointers along indicative route (if any) Compute new attraction point, preferred velocity For each character: collision avoidance Compute new velocity vNew Smoothen vNew (optional) Compute collision forces F (optional) For each character Update velocity: v := vNew + Δt · F/mass Update position: p := p + Δt · v Update nearest-neighbor data structure Why separate loops? Order of characters does not matter Characters are independent, each loop can be parallellized December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Game loop Update the simulation per time step: performStep(Δt) Possible approach: do as many steps as possible Use time between frames as step size Use FPS to measure efficiency Is this a good idea? We use a fixed time step (0.1 s) Use computation time to measure efficiency (e.g. % of step time) Behavior does not depend on the framerate Fast-forward by calling performStep() more/less often You really don’t need a higher simulation framerate Visual framerate can be much higher (Not in our demo) December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Class example: path planning Similar for PathFollowing and CollisionAvoidance PathFollowingMethod: compute new attraction point Children: IRM and MIRAN CollisionAvoidanceMethod: compute a good new velocity Children: VelocityBased, VisionBased, RVO PathPlanningMethod - Type - const Environment* PathPlanningResult* planPath(const Character&) PathPlanningResult - IndicativeRoute - vector<int> ecmVertices - TimedPath PP_GridBased PP_ECMBased Corridor computeECMRoute(Character&) IndicativeRoute computeIR(Character&, const Corridor&) A* on the ECM  corridor Different ways to extract IR from a corridor PP_ECM_MedialAxis PP_ECM_ShortPath ... December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

CollisionAvoidanceManager Design patterns General OO programming tricks You may already be using them without knowing it Singleton: class that can have only 1 instance I use them for managers of implementations Chooses the correct CAMethod per character Manager is an unofficial & disliked pattern What does it “manage”? Many design patterns exist Someone will always know better Find a balance, do what you think is useful CollisionAvoidanceManager - vector<CAMethod*> void updateVelocity(Character&) December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Adding RVO2 to the framework Assignment 2 December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Assignment 2 details Compare CA algorithms in our framework Velocity-based (Karamouzas et al.) Vision-based (Moussaïd et al.) ORCA (van den Berg et al.) Choose wisely Which scenarios do you use? Which metrics do you use? Try different parameter settings Draw careful conclusions Watch out for “paper vs. implementation” Bonus points? Add other CA algorithms December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Assignment 2 details Contact Roland for obtaining the code Account for our Mercurial server The code changes quite often Contact me for code questions/remarks Read the documentation first ;) December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Goal revisited Theory Understand the various crowd simulation levels Gain insights in collision avoidance Think about (CA) experiments Practice Reduce your fear of C++ Know how our framework is structured Prepare for Assignment 2 December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance

Workshop 1: Crowd Simulation Software & Collision Avoidance Questions? Wouter van Toll W.G.vanToll@uu.nl BBG 4.17 (next to Roland) December 7, 2018 Workshop 1: Crowd Simulation Software & Collision Avoidance