... | ... | @@ -167,13 +167,13 @@ ros2 pkg create air_lab3 --build-type ament_cmake --dependencies rclcpp rclcpp_a |
|
|
|
|
|
## TST executor service server
|
|
|
|
|
|
We will create a TST executor that is started with a service server. In that node you need to define a service called `execute_tst` when it is called, it loads a TST description from a file (one of the json file) and start executing it.
|
|
|
We will create a service server whose goal is to load a TST description from a file (one of the JSON file) and execute it. In the remainer of the lab we will help you implent that service call, in this section, we will start by just seting up an empty service.
|
|
|
|
|
|
You should start by reading and understanding the official tutorials for [Python](https://docs.ros.org/en/galactic/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Service-And-Client.html) or [C++](https://docs.ros.org/en/galactic/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client.html).
|
|
|
|
|
|
You should follow an incremental approach:
|
|
|
|
|
|
* Copy/paste the service server example from the respective tutorials into your `lab3_node.py` or `lab3_node.cpp`.
|
|
|
* Copy/paste the service server example from the respective tutorials into your `lab3_node.py` or `lab3_node.cpp`. *We do not need a client, in this lab, we will use the command line to call the service*.
|
|
|
* Make sure you understand what is happening, if you have doubts, ask questions to your lab assistant.
|
|
|
* You won't be able to run the tutorial. So you can start modifying to replace the service call with `execute_tst` and the type `air_lab_interfaces/srv/ExecuteTst`.
|
|
|
* Once you have modified it, you can test your calling your service with:
|
... | ... | |