{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "view-in-github",
"tags": [
"no-tex"
]
},
"source": [
""
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"id": "JoW4C_OkOMhe",
"tags": [
"remove-cell"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"%pip install -U -q gtbook\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"id": "10-snNDwOSuC",
"tags": [
"remove-cell"
]
},
"outputs": [],
"source": [
"import gtsam\n",
"\n",
"from gtbook import display\n",
"from gtbook.discrete import Variables\n",
"from gtbook import vacuum # various definitions for this chapter\n",
"\n",
"VARIABLES = Variables()\n",
"def pretty(obj):\n",
" return display.pretty(obj, VARIABLES)\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "nAvx4-UCNzt2"
},
"source": [
"```{index} state; discrete state\n",
"```\n",
"\n",
"# Modeling the State of the Vacuum Cleaning Robot\n",
"\n",
"> We introduce discrete states as an abstraction of navigating through continuous spaces.\n",
"\n",
"
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this section, we describe the state space for our vacuum cleaning robot.\n",
"Like the trash sorting robot, the vacuum cleaning robot has a discrete state space. However, unlike the trash sorting robot, the state at the current time depends on the state at the previous time. To model this, we introduce the notion of a **discrete-time system**, which we will use extensively throughout this book. In the next section we will then see how we can use actions to (more or less) control the state of the robot over time.\n",
"\n",
"To make our vacuum-cleaning robot example a bit more realistic, we will also make it clear that transitions between arbitrary states are not possible: teleportation for mobile robots has unfortunately not been invented yet! We will use a *graph* to encode this aspect of the the state space for the vacuum cleaning robot, which establishes a deep connection with the notion of graph search in classical AI. In Section 3.5 we will not use graph search but a probabilistic version of it to plan in such state spaces."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "nAvx4-UCNzt2"
},
"source": [
"## Defining the Robot's State\n",
"\n",
"> Just rooms, states are...\n",
"\n",
"The representation of a robot's state should include all information that is necessary for the robot to act effectively in its environment to achieve its goals. For a vacuum cleaning robot, this might include the exact location of the robot (e.g., x-y coordinates in a map of the house),\n",
"the heading direction of the robot,\n",
"whether the floor is carpeted,\n",
"or the location of any pets or children that might be moving throughout the house.\n",
"\n",
"In this chapter, we will abstract away many of these details by making the following\n",
"assumptions:\n",
"- The robot can move in any direction, which means that its heading angle is not important.\n",
"- The robot is equipped with low-level navigation software that will allow it to move from one room to another, through doorways, etc. (though not with 100% reliability).\n",
"- The robot is equipped with path planning software to clean the floor in a particular room (e.g., execute random\n",
"motions, or follow a boustrophedon path).\n",
"- The robot is equipped with collision-avoidance software, so that it need not worry about the presence of obstacles (e.g., furniture, small dogs, or children).\n",
"\n",
"Taken together, these assumptions allow us to abstract away all of the geometry of the vacuum cleaning problem,\n",
"and to *define the state of the robot as the room* of the house in which it is located."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As a running example, we will consider a simple house floor plan that\n",
"includes five rooms: the living room, a kitchen, an office, a hallway, and the dining room.\n",
"The floor plan is illustrated \n",
"below, in Figure 3.1.\n",
"\n",
"
\n",
"
P(X1):
\n", "X1 | value |
---|---|
Living Room | 0 |
Kitchen | 0 |
Office | 1 |
Hallway | 0 |
Dining Room | 0 |