YARP  2.3.70.1
Yet Another Robot Platform
yarp-config: the yarp-config tool
Author
Elena Ceseracciu and Lorenzo Natale

The utility yarp-config inspects the system and reports information about installed configuration and data files. In addition, it supports the process of customizing data files by copying them from installation to the user private directories (we call this importing).

Some commands related to YARP configuration files are:

  • yarp-config --version report version information
  • yarp-config --namespace report file that caches the current YARP namespace
  • yarp-config --nameserver report file that caches nameserver contact information

As for data file customization, this tool allows managing context and robot files (as explained in YARP data directories). This tool knows from the ResourceFinder where all files are located and where to put them given the system and user's environment. The main sub-commands are ''context'' to handle files in context directories and ''robot'' to handle robot directories.

  yarp-config context --list

Shows all the contexts visible to the ResourceFinder, in the order of precedence . To limit the list to the contexts found in the installed locations you can add:

  yarp-config context --list --installed

To import contexts to the home directory:

  yarp-config context --import <context-name>
  yarp-config context --import <context-name> file1 file2
  yarp-config context --import-all

The first two commands affects individual contexts, and allow one to import a whole context (first command) or only some specific files (second one); the third command affects all contexts (not recommended). After you finish importing a context, you can go to your local private directory (in Linux usually: $HOME/.local/share/yarp/contexts/) and edit it. To remove any local changes and restore the default files, one can do:

  yarp-config context --remove <context-name>

The utility works similarly for robot specific files:

  yarp-config robot --list
  yarp-config robot --import <robot-name>
  yarp-config robot --import <robot-name> file1 file2
  yarp-config robot --remove <robot-name>

In any case:

  yarp-config help

provides an explanation of the commands supported by the yarp-config tool.

An Example

Suppose you have installed both YARP and the example provided in <YARP_SOURCE_CODE>/examples/resourceFinder and described in How to install files for the ResourceFinder .

Type:

  yarp-config context --list

The result should be something like:

 **LOCAL USER DATA:
 * Directory : /home/nat/.local/share/yarp/contexts
 **SYSADMIN DATA:
 **INSTALLED DATA:
 * Directory : /usr/local/share/yarp/contexts
 randomMotion
 yarpscope

This shows us that:

  • The local user directory /home/nat.local/share/yarp/contexts is empty, i.e. no contexts have been imported
  • The shared installation directory for YARP /usr/local/share/yarp/contexts contains two contexts: randomMotion and yarpscope

To be able to modify a contexts, for example to customize one parameter, you have to first import it in the user directory. Suppose for example you want to customize the context ''randomMotion'':

  yarp-config context --import randomMotion

This is the output you should get:

 Copied context randomMotion from
 /usr/local/share/yarp/contexts/randomMotion to
 /home/nat/.local/share/yarp/contexts/randomMotion

 Current locations for this context:
 /home/nat/.local/share/yarp/contexts/randomMotion
 /usr/local/share/iCub/contexts/randomMotion

Now type:

  yarp-config context --list

To verify that ''randomMotion'' is indeed now present in /home/nat/.local/share/yarp/contexts

This means that files from ''randomMotion'' in /home/nat/.local/share/yarp/contexts/ will take precedence over the ones in /usr/local/share/yarp/contexts. This is indeed what we wanted since the latter contains the default values we are going to modify to customize the behavior of the module.

To undo you can remove the context:

  yarp-config context --remove randomMotion