Searching and Downloading Components
In this tutorial you will learn about Finroc components, how to search for specific functionality and how to download them into your workspace if available.
Understanding Finroc components
In Finroc, software is categorized into the components
finroc_core
The inner core of the Framework. It defines the most basic data structures and interfaces of Finroc. You will always need this part to create an application but maybe never have to deal with its internals.
finroc_plugins
Components categorized as plugins
extend the core
functionality by e.g. communication protocols or scheduling algorithms. There are also plugins that help to give an application a certain structure both code-wise and in a way that can be visualized and used to analyze or even create and alter software at runtime.
finroc_libraries
Pieces of software that cope with a certain topic an can be reused in several projects
. Just like a library in the classical meaning.
finroc_projects
A Finroc project typically leads to one or more programs forming an application. Like the control software for a specific robot. Projects therefore also contain e.g. configuration files for running or deploying of Finroc programs.
finroc_tools
Programs for daily use like a GUI Editor or a tool that allows analysis and runtime construction of Finroc programs.
rrlib
The Robotic Research Library is divided into several repositories that contain framework-independent code for specific tasks. In a well-designed application the main algorithms and data structures live in an rrlib
and hence can be easily used in software not based on Finroc (e.g. other frameworks). Finroc libraries and projects then make use of these rrlibs connecting them with framework structures.
A component that implements communication via TCP therefore has the name finroc_plugins_tcp
. Another example is a library that provides getting images from various cameras and would be called e.g. finroc_libraries_camera
. It would use an rrlib_camera
which provides the specific drivers and data structures to work with the camera independent from the framework.
Searching Finroc components: finroc_search
At this point this tutorials requires you to already have worked through Getting started.
Searching in the available components is easily done via finroc_search
. Suppose we want to create a graphical user interface (GUI) for our application. We want to see if there is a tool for that purpose and what its name is.
Now the database containing all available names, descriptions, filenames, library and program names is searched for the string gui
. From the output we get the information that there is amongst others a component called finroc_tools_gui-java
. So we will download this one in the next step.
In another - more specific - case, we are looking for a C++ header file referenced as rrlib/xml/tNode.h
that is needed to compile a certain program. From finroc_search --help
we get the information that we can search only for filenames by using the command line flag -f
.
~/finroc$ finroc_search -f rrlib/xml/tNode
Searching for files only
Reading component lists... Done.
rrlib_xml http://finroc.org/main Wrapper for libXML2 used in RRLib
OK, after reading the first part of this tutorial we could have guessed the name from the path rrlib/xml
. However, if we only got the filename tNode.h
finroc_search
still finds the correct component:
~/finroc$ finroc_search -f tNode
Searching for files only
Reading component lists... Done.
rrlib_xml http://finroc.org/main Wrapper for libXML2 used in RRLib
Downloading Finroc components: finroc_get
Downloading the source code of a specific component into our workspace is easiest done using finroc_get
. Finroc support various kinds of source control systems like e.g. subversion or mercurial. finroc_get
uses a database that contains information about the components available, files or programs that can be found there and what source control system to use and how1. Thus, it makes life easier by abstracting from the underlying technology.
In the case of the tool for graphical user interfaces we want to get finroc_tools_gui-java
:
~/finroc$ finroc_get finroc_tools_gui-java
Reading component lists... Done.
Building dependency tree... Done.
The following extra components will be installed:
finroc_plugins_tcp-java
The following new components will be installed:
finroc_plugins_tcp-java finroc_tools_gui-java
After this operation, 5.4 MiB of additional disk space will be used.
Do you want to continue? [Y/n]
As can be seen, finroc_get
knows about the dependencies of the requested component and tells us that it also must download finroc_plugins_tcp-java
. By hitting enter this can be confirmed and the download into $FINROC_HOME/sources/java/org/finroc/tools/gui
begins.
Authentication
By default finroc_get
lets the underlying scm handle all communication with the user itself. Hence, if we had not prepared our ~/.hgrc
file with some mercurial authentication data, mercurial
would ask for our credentials for each repository. finroc_get --help
tells us, that these credentials also can be provided via command line options --username
and --password
. However, to not make our password visible to others in e.g. the output of ps aux
, providing only a username makes finroc_get
ask for the password using a non-echo prompt. Then, finroc_get
forwards this authentication data to the underlying tool.
Optional dependencies
When downloading the first components in [[Getting started]] we noticed that there are optional dependencies. These are dependencies of e.g. test programs or in case of a library maybe a specific part that contains a driver for some specific manufacturer.
In most cases, these are not needed to use the main contents of the requested components. Therefore, finroc_get
lists them, asks if it should download them and defaults to no if you just hit enter. When you run finroc_get
with a component that was already downloaded without its optional dependencies, you will be asked about them again.
~/finroc$ finroc_get finroc_core
Reading component lists... Done.
Building dependency tree...
Get optional component 'rrlib_serialization'? [y/N]
Done.
Nothing new to install.
Again, finroc_get --help
tells us, that there is an option to change this behavior:
~/finroc$ finroc_get --optional no finroc_core
Reading component lists... Done.
Nothing new to install.
~/finroc$ finroc_get --optional yes -y finroc_core
Reading component lists... Done.
Building dependency tree... Done.
The following extra components will be installed:
rrlib_serialization
The following new components will be installed:
rrlib_serialization
After this operation, 628.0 KiB of additional disk space will be used.
[1/1] $FINROC_HOME/sources/cpp/rrlib/serialization
-
This needs some infrastructure on a central server like finroc.org and is covered in more detail in a later tutorial. ↩