1 / 42

AI Architecture for Racing Vehicle Control

AI Architecture for Racing Vehicle Control November 3, 2004 Upmanyu Misra Scope 8.1: Racing Vehicle Control using Insect Intelligence 8.2: Fast and Efficient Approximation of Racing Lines Downforce by Smartdog Alex Darby Alex Darby

ivanbritt
Download Presentation

AI Architecture for Racing Vehicle Control

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AI Architecture for Racing Vehicle Control November 3, 2004 Upmanyu Misra

  2. Scope • 8.1: Racing Vehicle Control using Insect Intelligence • 8.2: Fast and Efficient Approximation of Racing Lines • Downforce by Smartdog • Alex Darby

  3. Alex Darby • Joint Honors in AI, Psychology and CS from Univ. of Nottingham • Was senior developer at Smartdog, that developed PS2 futuristic racing game Downforce • Now works with FreeStyle Games Ltd.

  4. Futuristic? • Video game titles in which players take control of not-yet-invented vehicles • Different from NFS • Similar to Star Wars, anyone??

  5. Big Deal, eh? • Deformable car models • Off-the-wall additions to the F-1 racing genre • Thrust blasters • Super-engines • Insane speeds and stunts

  6. Right Intentions • Intelligent • Behavior must be intentional • Intentions ≡ Intelligence Agent’s view Player’s view

  7. Simplify F-1 Racing • Speed is highest priority • Keep on track, preferably on optimal racing curve • Easy, yet realistic braking • Easy steering • Realistic throttle control

  8. Overview MOVIE Downforce Simulation Data Representation AI Framework Track Spaces Brooks’ Subsumption Insect AI The Four main layers of Downforce AI Racing Lines DEMO DEMO

  9. Data Abstraction • Need Data Abstraction and representation - For Downforce, concept is “track space” - Track space transforms 3-D position to 2-D position

  10. Track Space

  11. Track Space • Calculating <fWidthPos, fLengthPos> requires two vector normalizations per track position • Optimized by caching most common vectors

  12. Disadvantage • Unreliable for detecting fine-grain collisions • To avoid that … we transform the whole bounding box of the car to 2-D

  13. Downforce AI • Used Rodney Brooks’ Subsumption Architecture [Brooks91] and Insect AI architecture [Porcino03] • Downforce AI is primarily reactive

  14. Brooks’ Subsumption Architecture • Intelligent behavior can be generated without explicit representations or abstract reasoning of the kind that symbolic AI proposes • Intelligence is an emergent property of certain complex systems. Each layer does its job, they don’t necessarily coordinate. But the result seems “Intelligent”

  15. Brooks’ Subsumption Arch.

  16. Insect AI • Introduced by Nick Porcino • Ch. 6.2 • It provides • Architecture • Notation • Design Methodology

  17. As smart as a Bug… • Insects demonstrate a wide variety of interesting and successful behaviors • Seek (pursuit of a target) • Flee • Steer (away/into) • Yet, their nervous systems are simple • Hence its possible to analyze, compute and create simulation of their behaviors • This is called Computational Neuroethology

  18. Downforce AI System Architecture

  19. Behaviors • Each layer is composed of smaller sub-tasks called Behaviors • Each Behavior deals with a single aspect of the task(s) that the parent layer is responsible for • The overall behavior of the layer emerges from the interaction between constituent behaviors

  20. Interaction between Layers • Three main ways of interactions • Directly override the output of another layer, • Directly affect the internal state of another layer, • One layer alters the input data of another layer to achieve its own task

  21. Output Contention System • Based on three variables • Steering • Throttle • Braking • Every layer tries to manipulate them to achieve their goal • Contention system uses explicit priority system based on order of execution of layers and state dependent rules for situations that cannot be handled otherwise

  22. Path Following Layer • Generates correct controller input for vehicle to follow a specific path at max speed • Consists of two independent behaviors • Steering control • Speed Control

  23. Independent?! • Throughout the Downforce system it is assumed that other behaviors will fulfill their responsibilities • This facilitates emergent nature reduced responsibilities reduced problem space reduced computational load per task overall reduction in execution time

  24. Steering Control • Calculates steering input that makes vehicle follow racing line • Needs to look ahead along the racing line from its current position to generate the value • Hence data needs to be represented accordingly (remember track space?) • Intelligent steering using PID controllers (Ch. 2.8 pg 171, demo on CD)

  25. Wicked Speed Control • Only responsible for regulating speed wrt path • Uses Newtonian physics equations for bodies in circular motion (remember centripetal/centrifugal forces?) to calculate max speed for any given track section • Uses FSM based around corners

  26. Corner Identification • Start – point from where the current speed becomes unfeasible • Apex – first point after the start when the change in turn radius is opposite to that of the start of the corner (where the corner begins to “open out”)

  27. Approaching a Corner • Calculate difference between the calculated max speed for the corner and the current speed • Derive the braking distance based on maximum braking (using good ol’ Newtonian eqns.) • If vehicle is outside the braking zone simply keep accelerating

  28. Round the Corner • Once the braking zone is reached, apply maximum breaking • On reaching max acceptable speed for the corner, cruise to apex • By the time apex is reached, the system will be ready with another set of behaviors (hopefully!)

  29. Tactical Racing Layer • Assesses the race conditions and changes the speed and racing line to gain racing advantage • Transforms an Expert Driver to an Expert Racer • Consists three behaviors • Optimum road position • New racing line • Collision avoidance speed control

  30. Optimum Road Positioning • Visual perception • One pair of eyes facing in each direction • One eye responds to relative speed of other cars • Other responds to their proximity • Each eye stores a one-dimensional image that represents the entire track width and has a resolution of 20 “perceptual pixels” or percepcels.

  31. Percepcels

  32. Compound Eye • Products of the proximity and relative speed is stored in an array • Finally, we add the effect of the racing line to the compound eye with a high weightage • The tuning of the parameters takes time and experimentation. Makes it essential to have a method of editing parameters at run-time, ideally real-time Scripting

  33. Collision Avoidance Speed Control • Overrides the speed control set by the PF layer to avoid collision, primarily front to back • Collision test is performed using velocities measured in the track space domain • Its further refined by calculating the relative fWidthPos component of the track space velocity wrt that of the racing line

  34. Fine Grain Avoidance Layer • Deals with potential collision situations that were missed by previous layers • Consists of two behaviors • Race Priority/Racing Etiquette • Decides which car should back down • Fine Grain Collision Avoidance (they ran out of names!) • To avoid side-on collisions by restricting throttle and steering

  35. Driving Assist Layer • Controls problems such as wheel spin and brake locks • Consists of two behaviors • Traction Control • Minimizes wheel spin/slide • The slip/spin of the wheel is normalized between their corresponding min and max • Modifies throttle speeds set by other layers • Anti-lock Braking • Same as traction control except that the brake value is scaled instead of the throttle

  36. DEMO • http://www.atomicmedia.com/autonomous/ • By Clint Hannaford • Based on Reynolds’ work on Autonomous Character Locomotion

  37. Fixing Racing Lines • They are desirable • give AI vehicles a hint of realism • helps AI vehicles to present better challenge • Record path taken by an AI vehicle driven by a competent human player • fast and efficient • cannot be used for randomly generated or player created tracks

  38. Fixing Racing Lines • Restrict random and player created tracks to being assembled from predefined segments with pre-computed racing lines • But • its not that much fun • racing line is context dependent and cannot be produced by plugging predefined sections

  39. Approximating • Ignore the physics of vehicle movement • Concentrate on minimizing curvature • Start with mid-points on the track

  40. Sources • AI Game Programming Wisdom 2 • http://www.gamespot.com/ps2/driving/downforce/index.html • Rodney A. Brooks, “A Robust Layered Control System for a Mobile Robot” • Brian Beckman, “The Physics of Racing,”www.miata.net/sport/Physics/

  41. THANKS PHEW!!!

More Related