30 std::vector<std::string> params;
31 params.push_back(
"background");
32 params.push_back(
"target");
33 params.push_back(
"noise");
34 params.push_back(
"sx");
35 params.push_back(
"sy");
36 params.push_back(
"lifetime");
43 if (paramName ==
"background")
48 if (paramName ==
"target")
53 if (paramName ==
"noise")
55 paramValue = std::to_string(
m_noise);
60 paramValue = std::to_string(
m_sx);
65 paramValue = std::to_string(
m_sy);
68 if (paramName ==
"lifetime")
74 yError() <<
"parameter '" << paramName <<
"' was not found";
93 if (config.
check(
"help"))
102 if (config.
check(
"background"))
105 yCInfo(FakeBotParamsCOMPONENT) <<
"Parameter 'background' using value:" <<
m_background;
109 yCInfo(FakeBotParamsCOMPONENT) <<
"Parameter 'background' using DEFAULT value:" <<
m_background;
111 prop_check.
unput(
"background");
116 if (config.
check(
"target"))
119 yCInfo(FakeBotParamsCOMPONENT) <<
"Parameter 'target' using value:" <<
m_target;
123 yCInfo(FakeBotParamsCOMPONENT) <<
"Parameter 'target' using DEFAULT value:" <<
m_target;
125 prop_check.
unput(
"target");
130 if (config.
check(
"noise"))
133 yCInfo(FakeBotParamsCOMPONENT) <<
"Parameter 'noise' using value:" <<
m_noise;
137 yCInfo(FakeBotParamsCOMPONENT) <<
"Parameter 'noise' using DEFAULT value:" <<
m_noise;
139 prop_check.
unput(
"noise");
144 if (config.
check(
"sx"))
146 m_sx = config.
find(
"sx").asFloat64();
147 yCInfo(FakeBotParamsCOMPONENT) <<
"Parameter 'sx' using value:" <<
m_sx;
151 yCInfo(FakeBotParamsCOMPONENT) <<
"Parameter 'sx' using DEFAULT value:" <<
m_sx;
153 prop_check.
unput(
"sx");
158 if (config.
check(
"sy"))
160 m_sy = config.
find(
"sy").asFloat64();
161 yCInfo(FakeBotParamsCOMPONENT) <<
"Parameter 'sy' using value:" <<
m_sy;
165 yCInfo(FakeBotParamsCOMPONENT) <<
"Parameter 'sy' using DEFAULT value:" <<
m_sy;
167 prop_check.
unput(
"sy");
172 if (config.
check(
"lifetime"))
175 yCInfo(FakeBotParamsCOMPONENT) <<
"Parameter 'lifetime' using value:" <<
m_lifetime;
179 yCInfo(FakeBotParamsCOMPONENT) <<
"Parameter 'lifetime' using DEFAULT value:" <<
m_lifetime;
181 prop_check.
unput(
"lifetime");
216 doc = doc + std::string(
"\n=============================================\n");
217 doc = doc + std::string(
"This is the help for device: FakeBot\n");
218 doc = doc + std::string(
"\n");
219 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
220 doc = doc + std::string(
"'background': background image to use\n");
221 doc = doc + std::string(
"'target': target image to use\n");
222 doc = doc + std::string(
"'noise': pixel noise level\n");
223 doc = doc + std::string(
"'sx': scaling for x coordinate\n");
224 doc = doc + std::string(
"'sy': scaling for y coordinate\n");
225 doc = doc + std::string(
"'lifetime': device should exist for this length of time\n");
226 doc = doc + std::string(
"\n");
227 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
228 doc = doc +
" yarpdev --device fakebot --background textures/back.ppm --target textures/fore.ppm --noise 0.05 --sx 1.0 --sy 1.0 --lifetime -1.0\n";
229 doc = doc + std::string(
"Using only mandatory params:\n");
230 doc = doc +
" yarpdev --device fakebot\n";
231 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
std::string getConfiguration() const override
Return the configuration of the device.
std::string m_provided_configuration
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
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 YARP_LOG_COMPONENT(name,...)