Access ROS parameter server values
returns the list of all ROS
parameter names from the ROS master. list
= rosparam("list")
Simplified form: rosparam
list
rosparam("set",
sets
a value for a specified parameter name. If the parameter name does not exist,
the function adds a new parameter in the parameter tree.pname
,pval
)
Simplified form: rosparam
set pname pval
See Limitations for limitations
on pval
.
rosparam("delete",
deletes a parameter from
the parameter tree. If the parameter does not exist, the function displays an
error.pname
)
Simplified form: rosparam
delete pname
rosparam("delete",
deletes all parameters
under the given namespace from the parameter tree. namespace
)
Simplified form: rosparam
delete namespace
creates
a parameter tree object, ptree
= rosparamptree
. After ptree
is
created, the connection to the parameter server remains persistent
until the object is deleted or the ROS master becomes unavailable.
A ROS parameter tree communicates with the ROS parameter server. The ROS parameter server can
store strings, integers, doubles, Booleans and cell arrays. The parameters are
accessible by every node in the ROS network. Use the parameters to store static
data such as configuration parameters. Use the get
,
set
, has
, search
,
and del
functions to manipulate and view parameter
values.
The following ROS data types are supported as values of parameters. For each ROS data type, the corresponding MATLAB® data type is also listed.
32-bit integer — int32
Boolean — logical
double — double
string — character vector (char
)
list — cell array (cell
)
dictionary — structure (struct
)
Unsupported Data Types: Base64-encoded binary data and iso8601 data from ROS are not supported.
Simplified Commands:
When using the simplified command rosparam set pname pval
,
the parameter value is interpreted as:
logical
— If pval
is "true"
or "false"
int32
— If pval
is
an integer, for example, 5
double
— If pval
is
a fractional number, for example, 1.256
character vector — If pval
is
any other value