del

Delete a ROS parameter

Description

example

del(ptree,paramname) deletes a parameter with name paramname from the parameter tree, ptree. The parameter is also deleted from the ROS parameter server. If the specified paramname does not exist, the function displays an error.

del(ptree,namespace) deletes from the parameter tree all parameter values under the specified namespace.

Examples

collapse all

Connect to the ROS network. Create a parameter tree and a 'MyParam' parameter. Check that the parameter exists.

rosinit
Initializing ROS master on http://bat1073807glnxa64:43209/.
Initializing global node /matlab_global_node_61346 with NodeURI http://bat1073807glnxa64:46611/
ptree = rosparam;
set(ptree,'MyParam','test')
has(ptree,'MyParam')
ans = logical
   1

Delete the parameter. Verify it was deleted. Shut down the ROS network.

del(ptree,'MyParam')
has(ptree,'MyParam')
ans = logical
   0

rosshutdown
Shutting down global node /matlab_global_node_61346 with NodeURI http://bat1073807glnxa64:46611/
Shutting down ROS master on http://bat1073807glnxa64:43209/.

Input Arguments

collapse all

Parameter tree, specified as a ParameterTree object handle. Create this object using the rosparam function.

ROS parameter name, specified as a string scalar or character vector. This string must match the parameter name exactly.

ROS parameter namespace, specified as a string scalar or character vector. All parameter names starting with this string are listed when calling rosparam("list",namespace).

See Also

| |

Introduced in R2019b