Yarp-config

From Wiki for iCub and Friends
Jump to navigation Jump to search

The utility yarp-config allows to customize robot and context files, by copying the files from installation to the user private directories (we call this importing).

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 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. To limit the list to the context 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 to import a whole context (first command) or only some specific files (second one); the third command affects all contexts (not recommended).

After you finished importing a context you can go to your local private directory (in Linux usually: $HOME/.local/share/yarp/contexts/) and edit it.

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

In any case:

 yarp-config help

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

Example

Suppose you have installed both YARP and iCub.

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
yarpscope
* Directory : /usr/local/share/iCub/contexts
actionPrimitivesExample
actionsRenderingEngine
armCartesianController
boostMILExample
cameraCalibration
cartesianSolver
[..] 
takeOverTheWorld
wholeBodyDynamics

This shows us that:

  • The local user directory /home/nat.local/share/yarp/contexts is empty, i.e. non context has been imported
  • The shared installation directory for YARP /usr/local/share/yarp/contexts contains one context: yarpscope
  • The shared installation directory for iCub /usr/local/share/iCub/contexts contains several contexts

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 cartesianSolver:

 yarp-config context --import cartesianSolver

This is the output you should get:

Copied context cartesianSolver from /usr/local/share/iCub/contexts/cartesianSolver to /home/nat/.local/share/yarp/contexts/cartesianSolver .
Current locations for this context: /home/nat/.local/share/yarp/contexts/cartesianSolver /usr/local/share/iCub/contexts/cartesianSolver

Now type:

 yarp-config context --list 

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

This means that files in /home/nat/.local/share/yarp/contexts/cartesianSolver will take precedence over the ones in /usr/local/share/iCub/contexts/cartesianSolver. This is indeed what we wanted since we are going to modify them to customize the behavior of the module.

To undo you can remove the context:

 yarp-config context --remove cartesianSolver