19 YARP_LOG_COMPONENT(RemoteControlBoardParamsCOMPONENT,
"yarp.device.RemoteControlBoard")
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(
"timeout");
36 params.push_back(
"local_qos::enable");
37 params.push_back(
"local_qos::thread_priority");
38 params.push_back(
"local_qos::thread_policy");
39 params.push_back(
"local_qos::packet_priority");
40 params.push_back(
"remote_qos::enable");
41 params.push_back(
"remote_qos::thread_priority");
42 params.push_back(
"remote_qos::thread_policy");
43 params.push_back(
"remote_qos::packet_priority");
44 params.push_back(
"ignoreProtocolCheck");
45 params.push_back(
"diagnostic");
53 if (config.
check(
"help"))
58 std::string config_string = config.
toString();
62 if (config.
check(
"remote"))
65 yCInfo(RemoteControlBoardParamsCOMPONENT) <<
"Parameter 'remote' using value:" <<
m_remote;
69 yCError(RemoteControlBoardParamsCOMPONENT) <<
"Mandatory parameter 'remote' not found!";
70 yCError(RemoteControlBoardParamsCOMPONENT) <<
"Description of the parameter: Prefix of the port to which to connect.";
73 prop_check.
unput(
"remote");
78 if (config.
check(
"local"))
81 yCInfo(RemoteControlBoardParamsCOMPONENT) <<
"Parameter 'local' using value:" <<
m_local;
85 yCError(RemoteControlBoardParamsCOMPONENT) <<
"Mandatory parameter 'local' not found!";
86 yCError(RemoteControlBoardParamsCOMPONENT) <<
"Description of the parameter: Port prefix of the port opened by this device.";
89 prop_check.
unput(
"local");
94 if (config.
check(
"writeStrict"))
97 yCInfo(RemoteControlBoardParamsCOMPONENT) <<
"Parameter 'writeStrict' using value:" <<
m_writeStrict;
101 yCInfo(RemoteControlBoardParamsCOMPONENT) <<
"Parameter 'writeStrict' using DEFAULT value:" <<
m_writeStrict;
103 prop_check.
unput(
"writeStrict");
108 if (config.
check(
"carrier"))
111 yCInfo(RemoteControlBoardParamsCOMPONENT) <<
"Parameter 'carrier' using value:" <<
m_carrier;
115 yCInfo(RemoteControlBoardParamsCOMPONENT) <<
"Parameter 'carrier' using DEFAULT value:" <<
m_carrier;
117 prop_check.
unput(
"carrier");
122 if (config.
check(
"timeout"))
125 yCInfo(RemoteControlBoardParamsCOMPONENT) <<
"Parameter 'timeout' using value:" <<
m_timeout;
129 yCInfo(RemoteControlBoardParamsCOMPONENT) <<
"Parameter 'timeout' using DEFAULT value:" <<
m_timeout;
131 prop_check.
unput(
"timeout");
137 sectionp = config.
findGroup(
"local_qos");
138 if (sectionp.
check(
"enable"))
145 yCInfo(RemoteControlBoardParamsCOMPONENT) <<
"Parameter 'local_qos::enable' using DEFAULT value:" <<
m_local_qos_enable;
147 prop_check.
unput(
"local_qos::enable");
153 sectionp = config.
findGroup(
"local_qos");
154 if (sectionp.
check(
"thread_priority"))
163 prop_check.
unput(
"local_qos::thread_priority");
169 sectionp = config.
findGroup(
"local_qos");
170 if (sectionp.
check(
"thread_policy"))
179 prop_check.
unput(
"local_qos::thread_policy");
185 sectionp = config.
findGroup(
"local_qos");
186 if (sectionp.
check(
"packet_priority"))
195 prop_check.
unput(
"local_qos::packet_priority");
201 sectionp = config.
findGroup(
"remote_qos");
202 if (sectionp.
check(
"enable"))
209 yCInfo(RemoteControlBoardParamsCOMPONENT) <<
"Parameter 'remote_qos::enable' using DEFAULT value:" <<
m_remote_qos_enable;
211 prop_check.
unput(
"remote_qos::enable");
217 sectionp = config.
findGroup(
"remote_qos");
218 if (sectionp.
check(
"thread_priority"))
227 prop_check.
unput(
"remote_qos::thread_priority");
233 sectionp = config.
findGroup(
"remote_qos");
234 if (sectionp.
check(
"thread_policy"))
243 prop_check.
unput(
"remote_qos::thread_policy");
249 sectionp = config.
findGroup(
"remote_qos");
250 if (sectionp.
check(
"packet_priority"))
259 prop_check.
unput(
"remote_qos::packet_priority");
264 if (config.
check(
"ignoreProtocolCheck"))
273 prop_check.
unput(
"ignoreProtocolCheck");
278 if (config.
check(
"diagnostic"))
281 yCInfo(RemoteControlBoardParamsCOMPONENT) <<
"Parameter 'diagnostic' using value:" <<
m_diagnostic;
285 yCInfo(RemoteControlBoardParamsCOMPONENT) <<
"Parameter 'diagnostic' using DEFAULT value:" <<
m_diagnostic;
287 prop_check.
unput(
"diagnostic");
322 doc = doc + std::string(
"\n=============================================\n");
323 doc = doc + std::string(
"This is the help for device: RemoteControlBoard\n");
324 doc = doc + std::string(
"\n");
325 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
326 doc = doc + std::string(
"'remote': Prefix of the port to which to connect.\n");
327 doc = doc + std::string(
"'local': Port prefix of the port opened by this device.\n");
328 doc = doc + std::string(
"'writeStrict': It can be 'on' or 'off'\n");
329 doc = doc + std::string(
"'carrier': carrier used for streaming robot state\n");
330 doc = doc + std::string(
"'timeout': timeout for the input port which receives the streamed robot state\n");
331 doc = doc + std::string(
"'local_qos::enable': Enable the usage of local Qos\n");
332 doc = doc + std::string(
"'local_qos::thread_priority': Local Qos. See https://yarp.it/latest/channelprioritization.html\n");
333 doc = doc + std::string(
"'local_qos::thread_policy': Local Qos. See https://yarp.it/latest/channelprioritization.html\n");
334 doc = doc + std::string(
"'local_qos::packet_priority': Local Qos. See https://yarp.it/latest/channelprioritization.html\n");
335 doc = doc + std::string(
"'remote_qos::enable': Enable the usage of remote Qos\n");
336 doc = doc + std::string(
"'remote_qos::thread_priority': Remote Qos. See https://yarp.it/latest/channelprioritization.html\n");
337 doc = doc + std::string(
"'remote_qos::thread_policy': Remote Qos. See https://yarp.it/latest/channelprioritization.html.\n");
338 doc = doc + std::string(
"'remote_qos::packet_priority': Remote Qos. See https://yarp.it/latest/channelprioritization.html.\n");
339 doc = doc + std::string(
"'ignoreProtocolCheck': For development purpose only\n");
340 doc = doc + std::string(
"'diagnostic': For development purpose only\n");
341 doc = doc + std::string(
"\n");
342 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
343 doc = doc +
" yarpdev --device remote_controlboard --remote <mandatory_value> --local <mandatory_value> --writeStrict <optional_value> --carrier udp --timeout 0.5 --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> --ignoreProtocolCheck false --diagnostic false\n";
344 doc = doc + std::string(
"Using only mandatory params:\n");
345 doc = doc +
" yarpdev --device remote_controlboard --remote <mandatory_value> --local <mandatory_value>\n";
346 doc = doc + std::string(
"=============================================\n\n");
return doc;
int m_local_qos_thread_priority
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
bool m_ignoreProtocolCheck
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
int m_remote_qos_thread_priority
RemoteControlBoard_ParamsParser()
int m_remote_qos_thread_policy
int m_local_qos_thread_policy
std::string m_remote_qos_packet_priority
std::string m_writeStrict
std::string m_local_qos_packet_priority
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,...)