Sentry
In this page we will describe our approach in solving following sentry behaviour problems:
Our sentry agent collects information (i.e., percepts) about the environment through three different sensors. They are:
At any moment during its operation, the sentry is in one of three states. These states are:
The Motion Controller interprets these sensory inputs. The following table describes how the sensory inputs are interpreted as one of the above mentioned events.
The Motion Controller is a Finite State Machine. Based on its current state and the event that had just taken place the Motion Controller performs an action and either remains in the same state or moves into a different state. Following table summarizes this.
Following is a simplified Finite State Machine (Mealy machine to be particular) diagram for the Motion Controller.
The Motion Controller is also controlled by a timer. The sentry performs one of the actions uninterrupted for one second and at the
same time collects sensory inputs. The sentry then invokes the Motion Controller to decide which action to perform next.
- patroling the predefined environment,
- detecting an intruder while patrolling, and
- following an intruder from a safe distance.
Our sentry agent collects information (i.e., percepts) about the environment through three different sensors. They are:
- passive infra-red,
- sonar (ultrasonic range finder to be specific), and
- virtual wall.
- presence of an intruder using a PIR sensor,
- location (distance and angle) of an intruder using a sonar and a Roomba Discovery, and
- presence of a virtual wall using IR sensor found inside a Roomba Discovery.
- patrol in the safe empty rectangular area delimited by virtual walls,
- detect the presence of an intruder,
- find the distance between the agent and an intruder, and
- follow an intruder from a safe distance while remaining inside the predefined area.
At any moment during its operation, the sentry is in one of three states. These states are:
- patrolling,
- locating, and
- following.
- intruder detected,
- virtual wall was hit,
- intruder detected and virtual wall was hit simultaneously,
- intruder located (i.e., angle and distance of the intruder is found using the sonar and Roomba),
- intruder located and virtual wall was hit simultaneously,
- virtual wall was hit while following the intruder,
- intruder is stationary,
- nothing.
- PIR controller,
- sonar controller, and
- virtual wall controller.
The Motion Controller interprets these sensory inputs. The following table describes how the sensory inputs are interpreted as one of the above mentioned events.
PIR active | Virtual Wall hit | Locate cycle < MAX_LOCATE_CYCLE | Min distance < 8 meters | Event |
---|---|---|---|---|
false | false | false | false | nothing |
false | false | false | true | intruder stationary |
false | false | true | false | intruder detected |
false | false | true | true | intruder located |
false | true | false | false | virtual wall hit |
false | true | false | true | virtual wall was hit while following an intruder |
false | true | true | false | virtual wall hit while locating an intruder |
false | true | true | true | this never happens* |
true | false | false | false | intruder detected or intruder lost |
true | false | false | true | intruder located |
true | false | true | false | intruder detected |
true | false | true | true | intruder located |
true | true | false | false | virtual wall was hit while an intruder is detected |
true | true | false | true | virtual wall was hit while following an intruder |
true | true | true | false | virtual wall was hit while an intruder is being detected. |
The Motion Controller is a Finite State Machine. Based on its current state and the event that had just taken place the Motion Controller performs an action and either remains in the same state or moves into a different state. Following table summarizes this.
Current state | Event | Action | Next state |
---|---|---|---|
Patrolling | Nothing | Patrol | Patrolling |
Patrolling | Intruder detected | Locate intruder | Locating |
Patrolling | Virtual wall was hit | Move to safe location | Patrolling |
Patrolling | Virtual wall was hit and an intruder is detected | Move to safe location | Locating |
Locating | Intruder detected | Locate | Locating |
Locating | Virtual wall was hit | Move to safe location | Locating |
Locating | Intruder located | Follow | Following |
Locating | Intruder lost | Patrol | Patrolling |
Locating | Intruder located and virtual wall was hit | Move to safe location | Following |
Following | Virtual wall was hit while following an intruder | Move to safe location | Following |
Following | Intruder located | Follow | Following |
Following | Intruder lost | Locate | Locating |
Following | Intruder stationary | Follow | Following |
Following is a simplified Finite State Machine (Mealy machine to be particular) diagram for the Motion Controller.