... | ... | @@ -86,8 +86,8 @@ In [Lab 3](lab3), you have created a TST executor that move the robot to explore |
|
|
In `lab3_node`:
|
|
|
|
|
|
* Create a new TST Executor for `record-semantic`, it takes as parameters
|
|
|
** `topic` the name of the topic
|
|
|
** `graphname` the name of the graph used to save the data
|
|
|
- `topic` the name of the topic
|
|
|
- `graphname` the name of the graph used to save the data
|
|
|
* Listen for new observations on the given topic
|
|
|
* Check in the graph specified with `graphname` if the observations are already inserted (using a query). For instance the following query can be used, it should return a single element (you need to replace `someid` and `someclasss` with the correct values from the message):
|
|
|
```sparql
|
... | ... | @@ -97,10 +97,10 @@ PREFIX properties: <http://www.ida.liu.se/~TDDE05/properties> |
|
|
SELECT ?x ?y FROM 'salientpoints' WHERE { <someid> a <someklass> ;
|
|
|
properties:location [ gis:x ?x; gis:y ?y ] . }
|
|
|
```
|
|
|
** Make sure to keep `<` and `>` they indicate a URI in the query, without them the query is invalid and will not be executed, so you can replace `<someid>` by `<somethingelse>` but not `somethingelse`.
|
|
|
** Replace `salientpoints` with the TST parameter for `graphname`.
|
|
|
** This query need to be executed with a service call to `/kDBServerNodelet/sparql_query`. You can check the official tutorial 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) to learn how to make a service call.
|
|
|
** In the call to `/kDBServerNodelet/sparql_query`, the fields `bindings` and `service` are unused for this lab and can be set to an empty string.
|
|
|
- Make sure to keep `<` and `>` they indicate a URI in the query, without them the query is invalid and will not be executed, so you can replace `<someid>` by `<somethingelse>` but not `somethingelse`.
|
|
|
- Replace `salientpoints` with the TST parameter for `graphname`.
|
|
|
- This query need to be executed with a service call to `/kDBServerNodelet/sparql_query`. You can check the official tutorial 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) to learn how to make a service call.
|
|
|
- In the call to `/kDBServerNodelet/sparql_query`, the fields `bindings` and `service` are unused for this lab and can be set to an empty string.
|
|
|
* If the object has not been observed yet in the database. Add new observation using the insert triples service call (replace 'salientpoints' with the TST parameter for `graphname`).
|
|
|
* In C++, add `air_simple_sim_msgs` as a dependency in `CMakeLists.txt`, using `find_package` and setting the correct dependencies for your executable.
|
|
|
|