This is a simple helper-package for loading variables from the parameter server.
The main idea is to simplify the handling of parameters, which can be set to default values. The load() function will print if a parameter is loaded from the server or if its default value is used. In each case, the final value is printed, too.
Service Name | Type | Description |
---|---|---|
"~/substitutePath" | parameter_pa/ParameterPaString | Replaces each "$(find xyz)" with the corresponding path - this is similar to calling loadPath(). |
"~/substituteRessource" | parameter_pa/ParameterPaString | Resolves ressource name - this is similar to calling loadTopic(). |
The main load() function can handle bool, int, double and string - all as single values and as vectors. Also matrices of double (float) can be loaded.
Additionaly, there are two more dedicated load functions: loadPath() and loadTopic(). Both are basically loading a simple string from the parameter server as descript above. Furthermore the strings are specificly manipulated:
Every "$(find xyz)" will be replaced with the path of package xyz.
Names are resolved with additional operators.
For these examples assume that ROS_NAMESPACE is set to "/name/space" and that the nodes' name is "parameter_pa_node"
in_string | out_string | comment |
---|---|---|
ressource | ressource | relative name |
ressource/ | ressource/ | relative name ending with slash |
ns/ressource | ns/ressource | relative name with namespace |
ns/ressource/ | ns/ressource/ | relative name with namespace ending with slash |
/ressource | /ressource | absolute name |
/ressource/ | /ressource/ | absolute name ending with slash |
/ns/ressource | /ns/ressource | absolute name with namespace |
/ns/ressource/ | /ns/ressource/ | absolute name with namespace ending with slash |
in_string | out_string | comment |
---|---|---|
~ | /name/space/parameter_pa_node | private namespace |
~/ | /name/space/parameter_pa_node/ | private namespace ending with slash |
~/ressource | /name/space/parameter_pa_node/ressource | private namespace with relative name |
~/ns/ressource/ | /name/space/parameter_pa_node/ns/ressource/ | private namespace with relative name and relative namespace ending in slash |
/abc/~/xyz | Error | no private namespace within absolute name allowed |
in_string | out_string | comment |
---|---|---|
. | /name/space | local namespace |
./ | /name/space/ | local namespace ending with slash |
./ressource/ | /name/space/ressource/ | local namespace with relative name ending in slash |
./ns/ressource | /name/space/ns/ressource | local namespace with relative name and relative namespace |
/abc/./xyz | /abc/xyz | local namespace within absolute name |
in_string | out_string | comment |
---|---|---|
.. | /name | previous namespace |
../ | /name/ | previous namespace ending with slash |
../ressource/ | /name/ressource/ | previous namespace with relative name ending in slash |
../ns/ressource | /name/ns/ressource | previous namespace with relative name and relative namespace |
/abc/def/../xyz | /abc/xyz | previous namespace within absolute name |
in_string | out_string | comment |
---|---|---|
ressource// | ressource/ | relative name ending with slash |
//ns/ressource | /ns/ressource | absolute name with namespace |
in_string | out_string |
---|---|
~/abc/.//def/../ns//ressource/ | /name/space/parameter_pa_node/abc/ns/ressource/ |
ns//.././..//ressource | /name/space/ressource |
../../../../../../ressource/ | /ressource/ |
A typical output looks like this:
Here is the related source code, which is taken from pcdfilter_pa:
https://github.com/TUC-ProAut/ros_parameter
ros-kinetic-parameter-pa
ros-melodic-parameter-pa _(upcoming)_
ros-noetic-parameter-pa _(upcoming)_
ROS-Distribution | Build-Status | Documentation |
---|---|---|
Indigo | EOL April 2019 | docs.ros.org/indigo |
Jade | EOL May 2017 | docs.ros.org/jade |
Kinetic | EOL April 2021 | docs.ros.org/kinetic |
Lunar | EOL May 2019 | docs.ros.org/lunar |
Melodic | docs.ros.org/melodic | |
Noetic | docs.ros.org/noetic |