diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7fc0b5d1..de5dc391 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,8 @@ function(add_onto_library TARGET)
message(FATAL_ERROR "Expected source file list after target name")
endif()
add_library(${TARGET} ${ARGN})
- target_include_directories(${TARGET} PUBLIC include)
+ target_include_directories(${TARGET} PUBLIC $ You have below the archives of the major versions of Ontologenius: X / XX / 2024 31 / 01 / 2024Download
V0.4.0
-
Create your executable
Public Functions
std::string commit(int32_t timeout = -1) bool commit(const std::string& commit_name, int32_t timeout = -1)
+ bool checkout(const std::string& commit_name, int32_t timeout = -1)
+ registerFeederNotificationCallback(const std::function<void(const std::string&)>& callback)
@@ -276,6 +278,14 @@ registerReasonersNotificationCallback(const std::function<void(const std::string&)>& callback) boolReturns false if the function returns on a timeout.
This function can only be used on a copied ontology.
+Register a callback function to get notifications from the feeder.
+The parameter callback is the callback function taking a string.
+ +Register a callback function to get notifications from the reasoners.
+The parameter callback is the callback function taking a string.
+ diff --git a/docs/cpp_Tutorials/Tutorials.html b/docs/cpp_Tutorials/Tutorials.html index 87a25b1a..7d33f149 100644 --- a/docs/cpp_Tutorials/Tutorials.html +++ b/docs/cpp_Tutorials/Tutorials.html @@ -118,7 +118,7 @@Ontologenius comes with a series of tutorials to help new users become familiar with the use of - Ontologenius. These different tutorials cover the different features offered by Ontologenius and + Ontologenius both in ROS1 and ROS2. These different tutorials cover the different features offered by Ontologenius and give some ideas for use through tutorials built around mini-projects. Of course, these tutorials show simple use cases to allow beginners to better understand Ontologenius particularities. It is up to you to go further to discover all the possibilities offered by this software.
diff --git a/docs/cpp_Tutorials/tutorial1/FindTheIntruder.html b/docs/cpp_Tutorials/tutorial1/FindTheIntruder.html index a2063b24..446de6cd 100644 --- a/docs/cpp_Tutorials/tutorial1/FindTheIntruder.html +++ b/docs/cpp_Tutorials/tutorial1/FindTheIntruder.html @@ -4,10 +4,12 @@This function, therefore, applies the getUp method to each word found in the "words" vector and it returns a vector for which each cell corresponds to the vector returned by getUp.
We also notice that we are going to look for the getUp function among the individuals because we know that the input words will be only individuals.
@@ -170,29 +172,72 @@In order to see the effect of this function, we will add the following lines in our main function, just after the call to the "say" function.
We can now recompile our project and launch it!
-In another terminal we will publish a few words to see the result:
-At the end of our program, you should have this:
@@ -216,43 +261,43 @@Add the call to this function in the main function just after the getWordsInheritance call.
Compile this and run the program, then in another terminal re-query the programs on the words: - bob alice and kevin.
+ bob, alice, and kevin.This time, you should have this:
Compile this and run the program, then in another terminal re-query the programs on the words: - bob alice and kevin.
+ bob, alice, and kevin.This time, you should have this:
terminal 1:
-terminal 2:
-However, Ontologenius has three launch parameters and by doing so we take the default @@ -169,40 +210,182 @@
Now that we've seen the parameters, let's look at the launch files that are available and that we can re-use.
For our application, we do not need the GUI so we will ontologenius.launch or ontologenius_empty.launch. +
For our application, we do not need the GUI so we will use ontologenius or ontologenius_empty. Indeed, we can use one or the other because we will in all cases redefine our own parameters.
Let's create our own launch file that will launch our application as well as ontologenius with our parameters:
-Let's call this file intruder.launch and put it in our package in the folder launch.
+Let's call this file intruder.launch and put it in our package in the folder launch.
+Let's call this file intruder.xml and put it in our package in the folder launch.
+Let's call this file intruder.py and put it in our package in the folder launch.
+Let's call this file intruder.yaml and put it in our package in the folder launch.
+We can see that we used the ontologenius.launch file by redefining the internal file +
We can see that we used an ontologenius launch file by redefining the internal file to not use it and putting the ontological file of this tutorial as an input file.
The ontolgy is given here, but you can also create your own ontology with protégé. Just think about exporting your ontology in XML / RDF format.
+You have no more things to do. This block is only for ROS2 users. + Take a break and just think about them struggling with ROS2. +
+Edit your CMakeLists.txt file with the following. It will just install every launch files put in the launch folder.
+ +Do not forget to compile in order to install everything!
+ +I believe we are ready to launch our program:
-If all went well, you should have at the bottom of your terminal a section of which summarizes @@ -213,16 +396,56 @@
So let's check if our topic works well with the following publications:
-Then ask to start the reasoning:
-You should have the following output that corresponds to the summary and loopback of the program.
diff --git a/docs/cpp_Tutorials/tutorial1/ManageTheMultilingual.html b/docs/cpp_Tutorials/tutorial1/ManageTheMultilingual.html index bbdd1259..e870b55f 100644 --- a/docs/cpp_Tutorials/tutorial1/ManageTheMultilingual.html +++ b/docs/cpp_Tutorials/tutorial1/ManageTheMultilingual.html @@ -4,10 +4,12 @@We will therefore modify our callback function to realize the natural language transition to an identifier.
-The find function is applied to individuals because we want individuals to input.
-We can test our program again with the words: "green cup", "blue cup" and "green book". We thus @@ -209,9 +261,9 @@
The only thing we have to change is the display line as follows:
The result of our program becomes:
@@ -226,15 +278,110 @@We will now modify our launch file to put the working language in french.
-Well, that's it, our program will now work in French. You can test it with the words @@ -255,14 +402,14 @@
To go further, you can add the ability to change the working language with the setLang() function.
You can also change the display texts according to the language used by retrieving the language currently used with the getLang() function.
To obtain the identifier of a word in natural language, we used the function find, but ontologenius provides other functions to obtain an identifier from natural language. diff --git a/docs/cpp_Tutorials/tutorial1/MostRelevantIntruder.html b/docs/cpp_Tutorials/tutorial1/MostRelevantIntruder.html index e203c407..3a52d155 100644 --- a/docs/cpp_Tutorials/tutorial1/MostRelevantIntruder.html +++ b/docs/cpp_Tutorials/tutorial1/MostRelevantIntruder.html @@ -162,37 +162,37 @@
So we notice that we are going to look for the object classes of the ontology manipulator instead of the object individuals.
The getUp function is available for individuals, classes, and properties while the getDown function is only available for classes and properties.
We can call our refining function in our main function just after the function to find intruders
Re-interrogating our program with the words pr2, kevin, and bob, we now have the following result:
diff --git a/docs/cpp_Tutorials/tutorial1/settingUpTheProgram.html b/docs/cpp_Tutorials/tutorial1/settingUpTheProgram.html index adfa0d66..17f28fe1 100644 --- a/docs/cpp_Tutorials/tutorial1/settingUpTheProgram.html +++ b/docs/cpp_Tutorials/tutorial1/settingUpTheProgram.html @@ -4,10 +4,12 @@In this part, we will code the bases of our program from which we will be able to write the more algorithmic part. Before that, I invite you to create a new package that we will call "ontologenius_tutorial" - and which will contain only one source file that we will name "main.cpp". To be sure that your + and which will contain only one source file that we will name "intruder.cpp". To be sure that your new package will be well configured to use Ontologenius, we advise you to follow this guide. We will just rename our executable "intruder" because it is much more logical than "my_exe".
-Now we are ready! Let's open our main file and start coding:
-Take a break here, we have already written a lot. We will go over all this in detail to better @@ -206,15 +286,40 @@
First of all, we have all the inclusions we need, like iostream to display messages on the screen, then vectors and strings to get vectors and strings ...
-ros/ros.h is a convenience include that includes all the headers necessary to use the most common - public pieces of the ROS system.
-ros/ros.h is a convenience include that includes all the headers necessary to use the most common public pieces of the ROS system.
+ +ros/ros.h is a convenience include that includes all the headers necessary to use the most common public pieces of the ROS system.
+ +This includes the std_msgs/String message, which resides in the std_msgs ROS package. We use + +
This includes the ROS String message, which resides in the std_msgs ROS package. We use it to create a topic on which we will send the words from which our program will have to find the intruder.
As explained above, the ontology manipulator contains several objects to abstract ROS services. The set of services work in a connected mode which allows to greatly save in execution time but @@ -238,31 +343,51 @@
This vector will allow us to store the different words on which we will perform our search for the intruder.
This is our synchronization variable. This variable will be false as long as we continue to collect words and we will put it in the true state as long as we wish to start the search for the intruder.
Here, the say function is actually just an on-screen display, but you can customize it to use a TTS for example.
Here, the summarize function concatenates several words in a single string. We created this function just to make our main function more readable.
-Here we have the callback function of our input topic. This topic thus receives strings which will be the words from which our program will have to find the intruder. Inside the function, we can see that we use the word "start" as a synchronization word that will launch our reasoning. @@ -273,122 +398,285 @@
We have everything we need to start writing the main function to retrieve the list of words
to work on and start the reasoning although we do not have it yet.
Now, let's break the code down.
-Initialize ROS and Create a handle to this process' node.
+Initialize ROS.
-We finally come back to using ontologenius! We create here our first manipulator ontology, what a great day ... This manipulator is unique to fully enjoy the benefits of connected services.
We do not forget to initialize the pointer on the manipulator by providing the address.
-The close function link all the concepts loaded from files and the Internet. Before closing an ontology, exploration requests are not allowed.
-For the moment, we are going to consider that the ontological file we are going to work on is provided in the ontologenius launcher. We will configure it in the next part of the tutorial. It is also possible to load files directly from the program (as above) but in doing so it makes our code less reusable.
-We initialise our subscriber to the topic "intruder/input". We also - link this topic to our callback function.
- -We initialise our subscriber to the topic "intruder/input". We also link this topic to our callback function.
+ +First we create a class which inherits from Node and initialize this later. This node is not mandatory to use Ontologenius in c++ but we need it for the ROS subscriber.
+We initialise our subscriber to the topic "intruder/input". We also link this topic to our callback function.
+ +We instantiate our subscription node and put in in an executor to be able to use the spin_once function later.
+ +Just our almost infinite loop. Escaping with a Ctrl + C.
-We initialize the synchronization variable and inform the user that the program is ready to listen to the words.
-ros::spinOnce() is there to allow us to receive messages and r.sleep() avoids unnecessary use of the processor.
+We only wait for the synchronisation...
-ros::spinOnce() is there to allow us to receive messages via the subject and r.sleep() - avoids unnecessary use of the processor.
-We recall the words on which we will make the reasoning. It is just as a result of this that we will implement our reasoning.
-Our loop is over, we can erase the words we used and start over!
Now, you just have to compile that before going on to the following:
-Do not forget that this command must be done in your catkin workspace
+Do not forget that this command must be done in your workspace