Set Up Your Environnement
To set up your environment, we will first create a new package that represents your application.
The package.xml in format 3 should look like as follow and does not need to be modified:
<package format="3">
<name>my_pkg</name>
...
<buildtool_depend>catkin</buildtool_depend>
<depend>ontologenius</depend>
<depend>rospy</depend>
<depend>roscpp</depend>
...
</package>
<package format="3">
<name>my_pkg</name>
...
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>ontologenius</depend>
...
<exoprt>
<build_type>ament_cmake</build_type>
</exoprt>
</package>
<package format="3">
<name>my_pkg</name>
...
<depend>ontologenius</depend>
...
<exoprt>
<build_type>ament_python</build_type>
</exoprt>
</package>
The CMakeLists.txt should look like this:
We will require a minimal version of Ontologenius (optional) and include the ontologenius API.
The CMakeLists.txt should look like this:
We will require a minimal version of Ontologenius (optional) and export the dependency.
In Python you shoudl have a setup.py file and a setup.cfg but we will not modify them.
Create your executable
Now we can create our executable that will use ontologenius.
In this part, we will not write our program but we will only configure the CMakeLists.txt file to compile our file by linking it to ontologenius. To do this, create your main file that we call main.cpp and simply add the following lines:
In this part, we will not write our program but we will only configure the CMakeLists.txt file to compile our file by linking it to ontologenius. To do this, create your main file that we call main.cpp and simply add the following lines:
In this part, we will not write our program but we will only configure the setup.py file to declare our new node. To do this, create your node file, in a folder named as your package, that we call my_node.py and simply complete the setup file with the following lines:
entry_points={
'console_scripts': [
'my_node = my_pkg.my_node:main'
],
},
You are now ready to write your program!
To see how to use ontologenius with its C++ or Python API, continue with the tutorial.