forked from robotology/yarp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmd_yarp-config.dox
133 lines (91 loc) · 4.4 KB
/
cmd_yarp-config.dox
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
* Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT)
* CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
*
*/
/**
\page yarp-config yarp-config: the yarp-config tool
\ingroup yarp_tools
\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 \e importing).
Some commands related to YARP configuration files are:
\li `yarp-config --version` report version information
\li `yarp-config --namespace` report file that caches the current YARP namespace
\li `yarp-config --nameserver` report file that caches nameserver contact information
As for data file customization, this tool allows managing \e context and \e robot files (as explained in \ref yarp_data_dirs). 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.
\verbatim
yarp-config context --list
\endverbatim
Shows all the contexts visible to the ResourceFinder, <EM> in the order of precedence </EM>. To limit the list to the contexts found in the installed locations you can add:
\verbatim
yarp-config context --list --installed
\endverbatim
To import contexts to the home directory:
\verbatim
yarp-config context --import <context-name>
yarp-config context --import <context-name> file1 file2
yarp-config context --import-all
\endverbatim
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:
\verbatim
yarp-config context --remove <context-name>
\endverbatim
The utility works similarly for robot specific files:
\verbatim
yarp-config robot --list
yarp-config robot --import <robot-name>
yarp-config robot --import <robot-name> file1 file2
yarp-config robot --remove <robot-name>
\endverbatim
In any case:
\verbatim
yarp-config help
\endverbatim
provides an explanation of the commands supported by the yarp-config tool.
\section yarp-config-example An Example
Suppose you have installed both YARP and the example provided in <YARP_SOURCE_CODE>/examples/resourceFinder and described in \ref yarp_resource_finder_installation .
Type:
\verbatim
yarp-config context --list
\endverbatim
The result should be something like:
\verbatim
**LOCAL USER DATA:
* Directory : /home/nat/.local/share/yarp/contexts
**SYSADMIN DATA:
**INSTALLED DATA:
* Directory : /usr/local/share/yarp/contexts
randomMotion
yarpscope
\endverbatim
This shows us that:
\li The local user directory /home/nat.local/share/yarp/contexts is empty, i.e. no contexts have been imported
\li 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'':
\verbatim
yarp-config context --import randomMotion
\endverbatim
This is the output you should get:
\verbatim
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
\endverbatim
Now type:
\verbatim
yarp-config context --list
\endverbatim
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:
\verbatim
yarp-config context --remove randomMotion
\endverbatim
*
*/