Difference between revisions of "Yarp-config"

From Wiki for iCub and Friends
Jump to: navigation, search
(Example)
m
Line 1: Line 1:
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'').
+
''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.
 
This tool knows from the ResourceFinder where all files are located and where to put them given the system and user's environment.
Line 66: Line 66:
 
This shows us that:
 
This shows us that:
  
* The local user directory /home/nat.local/share/yarp/contexts is empty, i.e. no contexts have been imported
+
* 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 one context: yarpscope
 
* 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
 
* The shared installation directory for iCub /usr/local/share/iCub/contexts contains several contexts
Line 93: Line 93:
  
 
   yarp-config context --remove cartesianSolver
 
   yarp-config context --remove cartesianSolver
 +
 +
= Robot configuration (on the PC104) =
 +
 +
The following rules apply to a robot with standard laptop installation. 
 +
when you start robotInterface (or iCubInterface) on the PC104, robot configuration files are searched in the following order:
 +
* in the current directory .
 +
* in the local user directory /home/icub/.local/share/yarp/robot/<robot_name>
 +
* in the build directory /usr/local/src/robot/icub-main/build-pc104/share/<robot_name>

Revision as of 15:35, 10 June 2014

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. no contexts have 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 from cartesianSolver in /home/nat/.local/share/yarp/contexts/ will take precedence over the ones in /usr/local/share/iCub/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 cartesianSolver

Robot configuration (on the PC104)

The following rules apply to a robot with standard laptop installation. when you start robotInterface (or iCubInterface) on the PC104, robot configuration files are searched in the following order:

* in the current directory .
* in the local user directory /home/icub/.local/share/yarp/robot/<robot_name>
* in the build directory /usr/local/src/robot/icub-main/build-pc104/share/<robot_name>