Catch Me If You Can Group 20 B 鍾政達 B 陳建男 B 何雨帆
Rules of the Game Two agents playing human and ghost respectively Two agents playing human and ghost respectively The ghost agent’s goal is to catch the human agent The ghost agent’s goal is to catch the human agent The human agent’s goal is to avoid being caught by the ghost in a round The human agent’s goal is to avoid being caught by the ghost in a round
The Environment The map will be an 39x39 bitmap input The map will be an 39x39 bitmap input Human is in the lower right corner at the beginning Human is in the lower right corner at the beginning Ghost is in the upper left corner at the beginning Ghost is in the upper left corner at the beginning
The Strategy: Human (Ver.1) Construct a heuristic to define the “degree of danger” of each node Construct a heuristic to define the “degree of danger” of each node When ghost appears, plan an escaping route base on the heuristic When ghost appears, plan an escaping route base on the heuristic After we reached the goal, if the ghost is not in sight, keep rotating and scan After we reached the goal, if the ghost is not in sight, keep rotating and scan
State Diagram (Ver.1) Ghost Insight Route PlanningRotating Scan Goal ReachedWalking
The Heuristic Function Heuristic(x, y) = DegreeOfDanger(x, y) = DegreeOfDanger(x, y) = Combine((DistanceToGhost(x, y), = Combine((DistanceToGhost(x, y), Compact (x, y))
Definition of Compactness Check the 7x7 array centered by (x, y) Sum up the number of those bits that are black (obstacle)
Map of Compactness
Combination of Distance & Compactness Naïve way Danger = Compact – k * Distance Our way 400 – Compact Compact Danger = ─────── + ───── 10 * Distance 4 What is this!?
Why Bother? Compact + Near Compact + Near Empty + Near Empty + Near Compact + Far Compact + Far Empty + Far Empty + Far * The ranges between these four statuses should equal to each other
Refinement 1: Rotating State Full speed of ghost & human are similar Turning becomes a deterministic point Human should avoid turning as much as it can The “Rotating Scan” state becomes a vulnerable point!
Refinement 2: Keep Walking The sight of pioneer 3DX robot is narrow It is likely that the ghost is chasing us but we dose not notice Staying at the same point do no good Keep walking!
Moving Method Avoid Collision Adjust Velocity No Rotate + Keep Walking = Drift
Drift: No Rotate Search 10 nodes away from our current position base on the direction on the map Check if there are any obsticles between the node and us Pick the farrest node as the “short goal” and go staight toward it
Drift: No Rotate
Why 10 Nodes?
Drift: Keep Walking Update the short goal by watch dog (we may never reach the short goal) Change the speed of both wheels to adjust the direction while forwarding
State Diagram (Ver.2) Goal Reached On Its Way To the Goal Build up the Ghost Map Ghost Insight Plan Route Build up the Compactness Map Build up the NextGoal Map
Refinement 3: Ghost Insight If the ghost is too close to us Rotate becomes time wasting Two kinds of “Ghost Insight”: Near & Far Changes the direction while moving!
Ghost Insight & Near Dash Route 1 Dash Route 2
State Diagram (Final Version) Goal Reached On Its Way To the Goal Build up the Ghost Map Ghost Insight Plan Route Build up the CompactMap Build up the NextGoalMap DashGhost: Far Ghost: Near
The End Thanks for your attention