%% Set and Get Parameter Value
% Create the parameter tree. A ROS network must be available using rosinit.

rosinit
ptree = rosparam;

%
% Set a parameter value. You can also use the simplified version without a parameter tree:
% rosparam set 'DoubleParam' 1.0

set(ptree,'DoubleParam',1.0)

%
% Get the parameter value.

get(ptree,'DoubleParam')

%
% Alternatively, use the simplified versions without using the parameter tree.

rosparam set 'DoubleParam' 2.0
rosparam get 'DoubleParam'

%
% Disconnect from ROS network.

rosshutdown

%
% Copyright 2019 The MathWorks, Inc.
%