19 YARP_LOG_COMPONENT(ControlBoard_nwc_yarpParamsCOMPONENT,
"yarp.device.ControlBoard_nwc_yarp")
30 std::vector<std::string> params;
31 params.push_back(
"remote");
32 params.push_back(
"local");
33 params.push_back(
"writeStrict");
34 params.push_back(
"carrier");
35 params.push_back(
"carrier_cmd");
36 params.push_back(
"timeout");
37 params.push_back(
"use_streaming");
38 params.push_back(
"local_qos::enable");
39 params.push_back(
"local_qos::thread_priority");
40 params.push_back(
"local_qos::thread_policy");
41 params.push_back(
"local_qos::packet_priority");
42 params.push_back(
"remote_qos::enable");
43 params.push_back(
"remote_qos::thread_priority");
44 params.push_back(
"remote_qos::thread_policy");
45 params.push_back(
"remote_qos::packet_priority");
46 params.push_back(
"diagnostic");
53 if (paramName ==
"remote")
58 if (paramName ==
"local")
63 if (paramName ==
"writeStrict")
68 if (paramName ==
"carrier")
73 if (paramName ==
"carrier_cmd")
78 if (paramName ==
"timeout")
83 if (paramName ==
"use_streaming")
86 else paramValue =
"false";
89 if (paramName ==
"local_qos::enable")
92 else paramValue =
"false";
95 if (paramName ==
"local_qos::thread_priority")
100 if (paramName ==
"local_qos::thread_policy")
105 if (paramName ==
"local_qos::packet_priority")
110 if (paramName ==
"remote_qos::enable")
113 else paramValue =
"false";
116 if (paramName ==
"remote_qos::thread_priority")
121 if (paramName ==
"remote_qos::thread_policy")
126 if (paramName ==
"remote_qos::packet_priority")
131 if (paramName ==
"diagnostic")
134 else paramValue =
"false";
138 yError() <<
"parameter '" << paramName <<
"' was not found";
157 if (config.
check(
"help"))
166 if (config.
check(
"remote"))
169 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'remote' using value:" <<
m_remote;
173 yCError(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Mandatory parameter 'remote' not found!";
174 yCError(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Description of the parameter: Prefix of the port to which to connect.";
177 prop_check.
unput(
"remote");
182 if (config.
check(
"local"))
185 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'local' using value:" <<
m_local;
189 yCError(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Mandatory parameter 'local' not found!";
190 yCError(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Description of the parameter: Port prefix of the port opened by this device.";
193 prop_check.
unput(
"local");
198 if (config.
check(
"writeStrict"))
201 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'writeStrict' using value:" <<
m_writeStrict;
205 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'writeStrict' using DEFAULT value:" <<
m_writeStrict;
207 prop_check.
unput(
"writeStrict");
212 if (config.
check(
"carrier"))
215 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'carrier' using value:" <<
m_carrier;
219 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'carrier' using DEFAULT value:" <<
m_carrier;
221 prop_check.
unput(
"carrier");
226 if (config.
check(
"carrier_cmd"))
229 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'carrier_cmd' using value:" <<
m_carrier_cmd;
233 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'carrier_cmd' using DEFAULT value:" <<
m_carrier_cmd;
235 prop_check.
unput(
"carrier_cmd");
240 if (config.
check(
"timeout"))
243 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'timeout' using value:" <<
m_timeout;
247 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'timeout' using DEFAULT value:" <<
m_timeout;
249 prop_check.
unput(
"timeout");
254 if (config.
check(
"use_streaming"))
257 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'use_streaming' using value:" <<
m_use_streaming;
261 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'use_streaming' using DEFAULT value:" <<
m_use_streaming;
263 prop_check.
unput(
"use_streaming");
269 sectionp = config.
findGroup(
"local_qos");
270 if (sectionp.
check(
"enable"))
277 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'local_qos::enable' using DEFAULT value:" <<
m_local_qos_enable;
279 prop_check.
unput(
"local_qos::enable");
285 sectionp = config.
findGroup(
"local_qos");
286 if (sectionp.
check(
"thread_priority"))
295 prop_check.
unput(
"local_qos::thread_priority");
301 sectionp = config.
findGroup(
"local_qos");
302 if (sectionp.
check(
"thread_policy"))
311 prop_check.
unput(
"local_qos::thread_policy");
317 sectionp = config.
findGroup(
"local_qos");
318 if (sectionp.
check(
"packet_priority"))
327 prop_check.
unput(
"local_qos::packet_priority");
333 sectionp = config.
findGroup(
"remote_qos");
334 if (sectionp.
check(
"enable"))
341 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'remote_qos::enable' using DEFAULT value:" <<
m_remote_qos_enable;
343 prop_check.
unput(
"remote_qos::enable");
349 sectionp = config.
findGroup(
"remote_qos");
350 if (sectionp.
check(
"thread_priority"))
359 prop_check.
unput(
"remote_qos::thread_priority");
365 sectionp = config.
findGroup(
"remote_qos");
366 if (sectionp.
check(
"thread_policy"))
375 prop_check.
unput(
"remote_qos::thread_policy");
381 sectionp = config.
findGroup(
"remote_qos");
382 if (sectionp.
check(
"packet_priority"))
391 prop_check.
unput(
"remote_qos::packet_priority");
396 if (config.
check(
"diagnostic"))
399 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'diagnostic' using value:" <<
m_diagnostic;
403 yCInfo(ControlBoard_nwc_yarpParamsCOMPONENT) <<
"Parameter 'diagnostic' using DEFAULT value:" <<
m_diagnostic;
405 prop_check.
unput(
"diagnostic");
440 doc = doc + std::string(
"\n=============================================\n");
441 doc = doc + std::string(
"This is the help for device: ControlBoard_nwc_yarp\n");
442 doc = doc + std::string(
"\n");
443 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
444 doc = doc + std::string(
"'remote': Prefix of the port to which to connect.\n");
445 doc = doc + std::string(
"'local': Port prefix of the port opened by this device.\n");
446 doc = doc + std::string(
"'writeStrict': It can be 'on' or 'off'\n");
447 doc = doc + std::string(
"'carrier': carrier used for receiving streamed robot state\n");
448 doc = doc + std::string(
"'carrier_cmd': carrier used for sending streamed commands\n");
449 doc = doc + std::string(
"'timeout': timeout for the input port which receives the streamed robot state\n");
450 doc = doc + std::string(
"'use_streaming': enable/disables the use of streaming commands. If disabled, rpc is used instead\n");
451 doc = doc + std::string(
"'local_qos::enable': Enable the usage of local Qos\n");
452 doc = doc + std::string(
"'local_qos::thread_priority': Local Qos. See https://yarp.it/latest/channelprioritization.html\n");
453 doc = doc + std::string(
"'local_qos::thread_policy': Local Qos. See https://yarp.it/latest/channelprioritization.html\n");
454 doc = doc + std::string(
"'local_qos::packet_priority': Local Qos. See https://yarp.it/latest/channelprioritization.html\n");
455 doc = doc + std::string(
"'remote_qos::enable': Enable the usage of remote Qos\n");
456 doc = doc + std::string(
"'remote_qos::thread_priority': Remote Qos. See https://yarp.it/latest/channelprioritization.html\n");
457 doc = doc + std::string(
"'remote_qos::thread_policy': Remote Qos. See https://yarp.it/latest/channelprioritization.html.\n");
458 doc = doc + std::string(
"'remote_qos::packet_priority': Remote Qos. See https://yarp.it/latest/channelprioritization.html.\n");
459 doc = doc + std::string(
"'diagnostic': For development purpose only\n");
460 doc = doc + std::string(
"\n");
461 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
462 doc = doc +
" yarpdev --device controlBoard_nwc_yarp --remote <mandatory_value> --local <mandatory_value> --writeStrict <optional_value> --carrier fast_tcp --carrier_cmd fast_tcp --timeout 0.5 --use_streaming true --local_qos::enable false --local_qos::thread_priority 0 --local_qos::thread_policy 0 --local_qos::packet_priority <optional_value> --remote_qos::enable false --remote_qos::thread_priority 0 --remote_qos::thread_policy 0 --remote_qos::packet_priority <optional_value> --diagnostic false\n";
463 doc = doc + std::string(
"Using only mandatory params:\n");
464 doc = doc +
" yarpdev --device controlBoard_nwc_yarp --remote <mandatory_value> --local <mandatory_value>\n";
465 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string m_local_qos_packet_priority
std::string m_carrier_cmd
std::string m_writeStrict
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
std::string m_remote_qos_packet_priority
std::string m_provided_configuration
ControlBoard_nwc_yarp_ParamsParser()
int m_remote_qos_thread_priority
int m_local_qos_thread_priority
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
int m_local_qos_thread_policy
std::string getConfiguration() const override
Return the configuration of the device.
int m_remote_qos_thread_policy
A simple collection of objects that can be described and transmitted in a portable way.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
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.
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
virtual std::int64_t asInt64() const
Get 64-bit integer value.
virtual bool asBool() const
Get boolean value.
virtual std::string asString() const
Get string value.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)