19 YARP_LOG_COMPONENT(FakeDepthCameraDriverParamsCOMPONENT,
"yarp.device.FakeDepthCameraDriver")
30 std::vector<std::string> params;
31 params.push_back(
"rgb_h");
32 params.push_back(
"rgb_w");
33 params.push_back(
"dep_h");
34 params.push_back(
"dep_w");
35 params.push_back(
"accuracy");
36 params.push_back(
"rgb_Vfov");
37 params.push_back(
"rgb_Hfov");
38 params.push_back(
"dep_Vfov");
39 params.push_back(
"dep_Hfov");
40 params.push_back(
"dep_near");
41 params.push_back(
"dep_far");
48 if (paramName ==
"rgb_h")
50 paramValue = std::to_string(
m_rgb_h);
53 if (paramName ==
"rgb_w")
55 paramValue = std::to_string(
m_rgb_w);
58 if (paramName ==
"dep_h")
60 paramValue = std::to_string(
m_dep_h);
63 if (paramName ==
"dep_w")
65 paramValue = std::to_string(
m_dep_w);
68 if (paramName ==
"accuracy")
73 if (paramName ==
"rgb_Vfov")
78 if (paramName ==
"rgb_Hfov")
83 if (paramName ==
"dep_Vfov")
88 if (paramName ==
"dep_Hfov")
93 if (paramName ==
"dep_near")
98 if (paramName ==
"dep_far")
104 yError() <<
"parameter '" << paramName <<
"' was not found";
123 if (config.
check(
"help"))
132 if (config.
check(
"rgb_h"))
135 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_h' using value:" <<
m_rgb_h;
139 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_h' using DEFAULT value:" <<
m_rgb_h;
141 prop_check.
unput(
"rgb_h");
146 if (config.
check(
"rgb_w"))
149 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_w' using value:" <<
m_rgb_w;
153 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_w' using DEFAULT value:" <<
m_rgb_w;
155 prop_check.
unput(
"rgb_w");
160 if (config.
check(
"dep_h"))
163 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_h' using value:" <<
m_dep_h;
167 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_h' using DEFAULT value:" <<
m_dep_h;
169 prop_check.
unput(
"dep_h");
174 if (config.
check(
"dep_w"))
177 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_w' using value:" <<
m_dep_w;
181 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_w' using DEFAULT value:" <<
m_dep_w;
183 prop_check.
unput(
"dep_w");
188 if (config.
check(
"accuracy"))
191 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'accuracy' using value:" <<
m_accuracy;
195 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'accuracy' using DEFAULT value:" <<
m_accuracy;
197 prop_check.
unput(
"accuracy");
202 if (config.
check(
"rgb_Vfov"))
205 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_Vfov' using value:" <<
m_rgb_Vfov;
209 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_Vfov' using DEFAULT value:" <<
m_rgb_Vfov;
211 prop_check.
unput(
"rgb_Vfov");
216 if (config.
check(
"rgb_Hfov"))
219 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_Hfov' using value:" <<
m_rgb_Hfov;
223 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_Hfov' using DEFAULT value:" <<
m_rgb_Hfov;
225 prop_check.
unput(
"rgb_Hfov");
230 if (config.
check(
"dep_Vfov"))
233 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_Vfov' using value:" <<
m_dep_Vfov;
237 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_Vfov' using DEFAULT value:" <<
m_dep_Vfov;
239 prop_check.
unput(
"dep_Vfov");
244 if (config.
check(
"dep_Hfov"))
247 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_Hfov' using value:" <<
m_dep_Hfov;
251 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_Hfov' using DEFAULT value:" <<
m_dep_Hfov;
253 prop_check.
unput(
"dep_Hfov");
258 if (config.
check(
"dep_near"))
261 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_near' using value:" <<
m_dep_near;
265 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_near' using DEFAULT value:" <<
m_dep_near;
267 prop_check.
unput(
"dep_near");
272 if (config.
check(
"dep_far"))
275 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_far' using value:" <<
m_dep_far;
279 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_far' using DEFAULT value:" <<
m_dep_far;
281 prop_check.
unput(
"dep_far");
316 doc = doc + std::string(
"\n=============================================\n");
317 doc = doc + std::string(
"This is the help for device: FakeDepthCameraDriver\n");
318 doc = doc + std::string(
"\n");
319 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
320 doc = doc + std::string(
"'rgb_h': rgb_h\n");
321 doc = doc + std::string(
"'rgb_w': rgb_w\n");
322 doc = doc + std::string(
"'dep_h': dep_h\n");
323 doc = doc + std::string(
"'dep_w': dep_w\n");
324 doc = doc + std::string(
"'accuracy': accuracy\n");
325 doc = doc + std::string(
"'rgb_Vfov': rgb_Vfov\n");
326 doc = doc + std::string(
"'rgb_Hfov': rgb_Hfov\n");
327 doc = doc + std::string(
"'dep_Vfov': dep_Vfov\n");
328 doc = doc + std::string(
"'dep_Hfov': dep_Hfov\n");
329 doc = doc + std::string(
"'dep_near': dep_near\n");
330 doc = doc + std::string(
"'dep_far': dep_far\n");
331 doc = doc + std::string(
"\n");
332 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
333 doc = doc +
" yarpdev --device fakeDepthCamera --rgb_h 480.0 --rgb_w 640.0 --dep_h 480.0 --dep_w 640.0 --accuracy 0.001 --rgb_Vfov 50.0 --rgb_Hfov 36.0 --dep_Vfov 50.0 --dep_Hfov 36.0 --dep_near 0.2 --dep_far 6.0\n";
334 doc = doc + std::string(
"Using only mandatory params:\n");
335 doc = doc +
" yarpdev --device fakeDepthCamera\n";
336 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string m_provided_configuration
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
FakeDepthCameraDriver_ParamsParser()
std::string getConfiguration() const override
Return the configuration of the device.
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.
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
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,...)