30 std::vector<std::string> params;
31 params.push_back(
"period");
32 params.push_back(
"localImagePort");
33 params.push_back(
"localDepthPort");
34 params.push_back(
"remoteImagePort");
35 params.push_back(
"remoteDepthPort");
36 params.push_back(
"localRpcPort");
37 params.push_back(
"remoteRpcPort");
38 params.push_back(
"ImageCarrier");
39 params.push_back(
"DepthCarrier");
46 if (paramName ==
"period")
48 paramValue = std::to_string(
m_period);
51 if (paramName ==
"localImagePort")
56 if (paramName ==
"localDepthPort")
61 if (paramName ==
"remoteImagePort")
66 if (paramName ==
"remoteDepthPort")
71 if (paramName ==
"localRpcPort")
76 if (paramName ==
"remoteRpcPort")
81 if (paramName ==
"ImageCarrier")
86 if (paramName ==
"DepthCarrier")
92 yError() <<
"parameter '" << paramName <<
"' was not found";
111 if (config.
check(
"help"))
120 if (config.
check(
"period"))
123 yCInfo(RGBDSensorClientParamsCOMPONENT) <<
"Parameter 'period' using value:" <<
m_period;
127 yCInfo(RGBDSensorClientParamsCOMPONENT) <<
"Parameter 'period' using DEFAULT value:" <<
m_period;
129 prop_check.
unput(
"period");
134 if (config.
check(
"localImagePort"))
141 yCError(RGBDSensorClientParamsCOMPONENT) <<
"Mandatory parameter 'localImagePort' not found!";
142 yCError(RGBDSensorClientParamsCOMPONENT) <<
"Description of the parameter: Full name of the local image streaming port to open";
145 prop_check.
unput(
"localImagePort");
150 if (config.
check(
"localDepthPort"))
157 yCError(RGBDSensorClientParamsCOMPONENT) <<
"Mandatory parameter 'localDepthPort' not found!";
158 yCError(RGBDSensorClientParamsCOMPONENT) <<
"Description of the parameter: Full name of the local depth streaming port to open";
161 prop_check.
unput(
"localDepthPort");
166 if (config.
check(
"remoteImagePort"))
173 yCError(RGBDSensorClientParamsCOMPONENT) <<
"Mandatory parameter 'remoteImagePort' not found!";
174 yCError(RGBDSensorClientParamsCOMPONENT) <<
"Description of the parameter: Full name of the remote image port to connect to";
177 prop_check.
unput(
"remoteImagePort");
182 if (config.
check(
"remoteDepthPort"))
189 yCError(RGBDSensorClientParamsCOMPONENT) <<
"Mandatory parameter 'remoteDepthPort' not found!";
190 yCError(RGBDSensorClientParamsCOMPONENT) <<
"Description of the parameter: Full name of the remote depth port to connect to";
193 prop_check.
unput(
"remoteDepthPort");
198 if (config.
check(
"localRpcPort"))
201 yCInfo(RGBDSensorClientParamsCOMPONENT) <<
"Parameter 'localRpcPort' using value:" <<
m_localRpcPort;
205 yCError(RGBDSensorClientParamsCOMPONENT) <<
"Mandatory parameter 'localRpcPort' not found!";
206 yCError(RGBDSensorClientParamsCOMPONENT) <<
"Description of the parameter: Full name of the local rpc port to open";
209 prop_check.
unput(
"localRpcPort");
214 if (config.
check(
"remoteRpcPort"))
217 yCInfo(RGBDSensorClientParamsCOMPONENT) <<
"Parameter 'remoteRpcPort' using value:" <<
m_remoteRpcPort;
221 yCError(RGBDSensorClientParamsCOMPONENT) <<
"Mandatory parameter 'remoteRpcPort' not found!";
222 yCError(RGBDSensorClientParamsCOMPONENT) <<
"Description of the parameter: Full name of the remote rpc port to connect to";
225 prop_check.
unput(
"remoteRpcPort");
230 if (config.
check(
"ImageCarrier"))
233 yCInfo(RGBDSensorClientParamsCOMPONENT) <<
"Parameter 'ImageCarrier' using value:" <<
m_ImageCarrier;
237 yCInfo(RGBDSensorClientParamsCOMPONENT) <<
"Parameter 'ImageCarrier' using DEFAULT value:" <<
m_ImageCarrier;
239 prop_check.
unput(
"ImageCarrier");
244 if (config.
check(
"DepthCarrier"))
247 yCInfo(RGBDSensorClientParamsCOMPONENT) <<
"Parameter 'DepthCarrier' using value:" <<
m_DepthCarrier;
251 yCInfo(RGBDSensorClientParamsCOMPONENT) <<
"Parameter 'DepthCarrier' using DEFAULT value:" <<
m_DepthCarrier;
253 prop_check.
unput(
"DepthCarrier");
288 doc = doc + std::string(
"\n=============================================\n");
289 doc = doc + std::string(
"This is the help for device: RGBDSensorClient\n");
290 doc = doc + std::string(
"\n");
291 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
292 doc = doc + std::string(
"'period': refresh period (in s) of the broadcasted values through yarp ports\n");
293 doc = doc + std::string(
"'localImagePort': Full name of the local image streaming port to open\n");
294 doc = doc + std::string(
"'localDepthPort': Full name of the local depth streaming port to open\n");
295 doc = doc + std::string(
"'remoteImagePort': Full name of the remote image port to connect to\n");
296 doc = doc + std::string(
"'remoteDepthPort': Full name of the remote depth port to connect to\n");
297 doc = doc + std::string(
"'localRpcPort': Full name of the local rpc port to open\n");
298 doc = doc + std::string(
"'remoteRpcPort': Full name of the remote rpc port to connect to\n");
299 doc = doc + std::string(
"'ImageCarrier': Carrier for the image stream\n");
300 doc = doc + std::string(
"'DepthCarrier': Carrier for the depth stream\n");
301 doc = doc + std::string(
"\n");
302 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
303 doc = doc +
" yarpdev --device RGBDSensorClient --period 0.03 --localImagePort /RGBD_nwc/Image:o --localDepthPort /RGBD_nwc/Depth:o --remoteImagePort /RGBD_nws/Image:o --remoteDepthPort /RGBD_nws/Depth:i --localRpcPort /RGBD_nwc/rpc:o --remoteRpcPort /RGBD_nws/rpc:i --ImageCarrier udp --DepthCarrier udp\n";
304 doc = doc + std::string(
"Using only mandatory params:\n");
305 doc = doc +
" yarpdev --device RGBDSensorClient --localImagePort /RGBD_nwc/Image:o --localDepthPort /RGBD_nwc/Depth:o --remoteImagePort /RGBD_nws/Image:o --remoteDepthPort /RGBD_nws/Depth:i --localRpcPort /RGBD_nwc/rpc:o --remoteRpcPort /RGBD_nws/rpc:i\n";
306 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string getConfiguration() const override
Return the configuration of the device.
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
std::string m_localRpcPort
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::string m_DepthCarrier
std::string m_remoteDepthPort
std::string m_provided_configuration
std::string m_localImagePort
std::string m_remoteRpcPort
std::string m_localDepthPort
RGBDSensorClient_ParamsParser()
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
std::string m_remoteImagePort
std::string m_ImageCarrier
A class for storing options and configuration information.
void unput(const std::string &key)
Remove the association from the given key to a value, if present.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)