sot-doc  1.1.0
Documentation entry point for the Stack-Of-Tasks
doc/SettingYourEnvironment.md
1 # Setting up your environment {#d_setting_up_environment}
2 
3 \section setting_up_env_var_intro Introduction
4 
5 In order to make the SoT working all the environment variables in section \ref setting_up_env_variables need to be setup appropriatly.
6 They need to be *all* coherent.
7 
8 More precisely the order of the paths in the variables specify the order to search for libraries and plugins.
9 They are important because a computer might have different (and often conflicting) libraries version.
10 They need to be consistent together.
11 
12 A script to realize the setup and to be set in your .bashrc file is given in \ref setting_up_env_shell_file
13 
14 \section setting_up_env_variables Important environment variables
15 
16 This will set the following environment variables according to the argument.
17 All of the variables are important and need to be setup correctly.
18 As an example it we assume that you want to specify your environnement towards /opt/openrobots:
19 
20  * CMAKE_PREFIX_PATH <br>
21  This variable specifies the directory where cmake is searching for libraries CMake target. It is also use by ROS to search for executables.
22  For /opt/openrobots as the first directory to search it should be:
23 
24  CMAKE_PREFIX_PATH=/opt/openrobots:/whatever_was_before
25 
26 
27  * LD_LIBRARY_PATH <br>
28  Path to libraries.
29 
30  LD_LIBRARY_PATH=/opt/openrobots/lib:/opt/openrobots/lib/dynamic-graph-plugins:/whatever_was_before
31 
32  * PATH <br>
33  Path of the binaries.
34 
35  PATH=/opt/openrobots/bin:/whatever_was_before
36 
37  * PKG_CONFIG_PATH <br>
38  Paths to find the .pc files describing compilation flags and libraries. This is currently being deprecated for CMake export rules.
39 
40  PKG_CONFIG_PATH=/opt/openrobots/lib/pkgconfig:/whatever_was_before
41 
42  * PYTHON_PATH <br>
43  Paths to find python modules. SoT install modules in site-packages directory (Python convention) instead of dist-packges (Ubuntu convention).
44 
45  PYTHON_PATH=/opt/openrobots/lib/site-package
46 
47  * ROS_PACKAGE_PATH <br>
48  Path where ROS packages are installed
49 
50  ROS_PACKAGE_PATH=/opt/openrobots/share:/whatever_was_before
51 
52  * ROBOTPKG_BASE <br>
53  Path where robotpkg is installed. This is not useful if you are not installing robotpkg from source
54 
55 
56 \section setting_up_env_shell_file Shell file
57 To setup the environment variables you can use the script
58 [setup-sot.sh](https://github.com/stack-of-tasks/sot-doc/blob/master/bash/setup-sot.sh) which can be download using:
59 
60  wget https://raw.githubusercontent.com/stack-of-tasks/sot-doc/master/bash/setup-sot.sh
61 
62 \section setting_up_env_conf Modification of your configuration
63 
64 To use it with the binary packages installed in /opt/openrobots:
65 
66  source setup-sot.sh -p /opt/openrobots -r
67 
68 Once you typed this command you can check that the previous variables have the string "/opt/openrobots".
69 The order set the priority.
70 
71 The directory /opt/openrobots will have the highest priority with respect to all the precited variables.
72 This equivalent to workspace chaining in ROS.
73 
74 It is recommended to handle this with aliases in your .bashrc file.
75 You can for instance add the following line to your .bash_aliases
76 
77  alias sop="source setup-sot.sh -p /opt/openrobots -r"