rosparam
Access ROS parameter server values
Syntax
Description
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 —
int32Boolean —
logicaldouble —
doublestring — character vector (
char)list — cell array (
cell)dictionary — structure (
struct)
Examples
Input Arguments
Output Arguments
Limitations
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— Ifpvalis"true"or"false"int32— Ifpvalis an integer, for example,5double— Ifpvalis a fractional number, for example,1.256character vector — If
pvalis any other value
Extended Capabilities
Version History
Introduced in R2019b