|
|
# Lab 5: A basic office assistant
|
|
|
|
|
|
The goal of this lab is to provide the basic structure of the group work. In this lab you will create a basic robot that fulfill the goal of an office assistant:
|
|
|
The goal of this lab is to provide the basic structure of the group work. In this lab, you will create a basic robot that fulfills the goals of an office assistant:
|
|
|
|
|
|
* Create a `text_to_goals` node that convert a text command into a goal request. It should listen to a string and output a set of goals.
|
|
|
* Create a `text_to_goals` node that converts a text command into a goal request. It should listen to a string and output a set of goals.
|
|
|
* Create a `decision` node, it takes the set of goals and request execution of TST by the `tst_executor` of [Lab3](lab3).
|
|
|
|
|
|
You should create a new package `air_lab5`, you should check [Lab2](lab2) for how to create a package.
|
... | ... | @@ -19,13 +19,13 @@ To load that world in the simulator you should use the following command: |
|
|
ros2 launch air_bringup turtle.launch.py world:=office_1
|
|
|
```
|
|
|
|
|
|
In theory you should be exploring that environment to extract all the interesting points. And you will have to do that in the project phase, but for this lab we provide you the ground truth. You can generate a `turtle` file to insert in the database with:
|
|
|
Ideally, your robot should explore that environment to extract all the interesting points. You will have to do that in the project phase, but for this lab we provide you with the ground truth. You can generate a `turtle` file to insert the data in the database with:
|
|
|
|
|
|
```shell
|
|
|
ros2 run air_simple_sim generate_rdf office_1
|
|
|
```
|
|
|
|
|
|
You will notice that we have more classes, such as `office` or `vendingmachine`. And also, objects have `tags` which indicate the name of a person or the content of the vending machine.
|
|
|
You will notice that we have more object classes, such as `office` or `vendingmachine`. Additionally, objects have `tags` that indicate the name of a person or the content of the vending machine.
|
|
|
|
|
|
To insert the file in the database, simply run:
|
|
|
|
... | ... | @@ -36,21 +36,21 @@ format: 'ttl' |
|
|
content: '`ros2 run air_simple_sim generate_rdf office_1`'"
|
|
|
```
|
|
|
|
|
|
## Goal message
|
|
|
## Goal Message
|
|
|
|
|
|
In your `air_lab_interfaces`, you should add two new messages ``Goal` and `Goals`. They will be used to communicate goals between `text_to_goals` and `decision`. You can check the [official tutorial](https://docs.ros.org/en/galactic/Tutorials/Beginner-Client-Libraries/Custom-ROS2-Interfaces.html) to know how to create custom messages.
|
|
|
|
|
|
`Goal` should have the following fields:
|
|
|
|
|
|
* `type` (`string`) the type of goal with possible values `goto`, `bring`, `explore`...
|
|
|
* `object` (`string`) the object, can be empty. For example, for `bring` it could be coffee, sandwich...
|
|
|
* `destination` (`string`) the destination of the goal, or who to bring the `object`...
|
|
|
* `object` (`string`) the object, can be empty, or for example, for `bring` goal type it could be coffee, sandwich...
|
|
|
* `destination` (`string`) the destination of the goal, or who to bring the `object` to,...
|
|
|
|
|
|
`Goals` should have the following field:
|
|
|
|
|
|
* `goals` (list of `Goal`) a list of goals.
|
|
|
|
|
|
Do note that in this lab, we use a single `Goal` but it might be that for your project you will want to handle multiple goals.
|
|
|
Note that in this lab, we use a single `Goal` but it may be that for your project you will want to handle multiple goals.
|
|
|
|
|
|
## Text Command Node
|
|
|
|
... | ... | @@ -59,14 +59,14 @@ This node should listen to a topic called `text_command` of type `std_msgs/strin |
|
|
Examples of text commands:
|
|
|
|
|
|
* "Goto George" this should lead to a `Goal` with field `{ type: "goto", destination: "George" }`
|
|
|
* "Bring Coffee" this should lead to a `Goal` with field `{ type: "bring", object: "Coffee", destination: "User" }` in this case you can assume that user is the current position robot.
|
|
|
* "Bring Coffee" this should lead to a `Goal` with field `{ type: "bring", object: "Coffee", destination: "User" }`. In this case you can assume that user is at the current robot position.
|
|
|
* "Explore!" this should lead to a `Goal` with field `{ type: "explore" }`
|
|
|
|
|
|
You can use `ros2 topic` to publish the text command.
|
|
|
|
|
|
## Decision Node
|
|
|
|
|
|
This node should listen to the topic `goals_requests` and generate TSTs as a file (like you did in [Lab4](lab4)), then you should start the execution of the TST from your decision node. And you should query the database for destination, using the `tags`. You should look at the data that was inserted in the database, and you should extend the queries of `Lab4` to include this tag.
|
|
|
This node should listen to the topic `goals_requests` and generate TSTs as a file (like you did in [Lab4](lab4)). Then you should start the execution of the TST from your decision node. You should query the database for destination, using the `tags`. You should look at the data that was inserted in the database, and you should extend the queries of `Lab4` to include this tag.
|
|
|
|
|
|
## Demonstration
|
|
|
|
... | ... | |