the Robot Construction Kit
Each oroGen project can be separated in three things:
In its cross-project support, oroGen brings forward code reuse by allowing to transparently import and use types and task contexts defined by other projects.
All cross-project dependencies are managed in oroGen by using pkg-config. This means that oroGen will generate and install the pkg-config files necessary for it to work, namely one per parts of the oroGen project (typekit, task library and each deployment), and install them.
Nonetheless, it also means that these pkg-config files must be available to pkg-config when you run orogen on a new project.
pkg-config searches for package definitions the standard locations:
It also searches in the directories listed in the PKG_CONFIG_PATH environment variable. If you install your orogen projects in a non standard location, you must add this location to PKG_CONFIG_PATH. In a bash-like shell, this is done with:
One common task is to find out “what is already there ?”, “what is exactly the definition of type X ?” and so on. The oroinspect tool from orocos.rb allows you to find out.
To import and define the types defined by another project, just add the following at toplevel:
This will import the types in the current project, allowing you to use them in following task context definitions.
To import task contexts defined by another project, just add the following at toplevel:
Once it is done, you can use the imported task contexts in the local project to:
Note that oroGen will load the project’s typekit, since this typekit is required by the task library itself. You therefore don’t need to load the project’s typekit manually.
If you want to use types from a library that provides a pkg-config file, just add
where “base-types” is the name of the installed pkg-config file (see the Rock base package). The headers from that library will be made available, so you can do
where base/pose.h is a header installed by the library.
oroGen provides only support for libraries that use pkg-config.
Hence, if you do not want to use pkg-config but use types provided by a library in your task interface, you will have to modify CMakeLists.txt to look for that library, add the include and library dirs. Moreover, if needed, you will also have to modify tasks/CMakeLists.txt to link to that library.
If you do want to use the type provided by this library in your task interface, you will have to:
incdir = Set.new # Write code that detects where the library is and gets # its include dirs. Add the include dirs in "incdir" typekit(true).include_dirs |= incdir