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");
42 params.push_back(
"test_distance_constant");
49 if (paramName ==
"rgb_h")
51 paramValue = std::to_string(
m_rgb_h);
54 if (paramName ==
"rgb_w")
56 paramValue = std::to_string(
m_rgb_w);
59 if (paramName ==
"dep_h")
61 paramValue = std::to_string(
m_dep_h);
64 if (paramName ==
"dep_w")
66 paramValue = std::to_string(
m_dep_w);
69 if (paramName ==
"accuracy")
74 if (paramName ==
"rgb_Vfov")
79 if (paramName ==
"rgb_Hfov")
84 if (paramName ==
"dep_Vfov")
89 if (paramName ==
"dep_Hfov")
94 if (paramName ==
"dep_near")
99 if (paramName ==
"dep_far")
104 if (paramName ==
"test_distance_constant")
110 yError() <<
"parameter '" << paramName <<
"' was not found";
129 if (config.
check(
"help"))
138 if (config.
check(
"rgb_h"))
141 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_h' using value:" <<
m_rgb_h;
145 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_h' using DEFAULT value:" <<
m_rgb_h;
147 prop_check.
unput(
"rgb_h");
152 if (config.
check(
"rgb_w"))
155 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_w' using value:" <<
m_rgb_w;
159 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_w' using DEFAULT value:" <<
m_rgb_w;
161 prop_check.
unput(
"rgb_w");
166 if (config.
check(
"dep_h"))
169 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_h' using value:" <<
m_dep_h;
173 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_h' using DEFAULT value:" <<
m_dep_h;
175 prop_check.
unput(
"dep_h");
180 if (config.
check(
"dep_w"))
183 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_w' using value:" <<
m_dep_w;
187 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_w' using DEFAULT value:" <<
m_dep_w;
189 prop_check.
unput(
"dep_w");
194 if (config.
check(
"accuracy"))
197 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'accuracy' using value:" <<
m_accuracy;
201 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'accuracy' using DEFAULT value:" <<
m_accuracy;
203 prop_check.
unput(
"accuracy");
208 if (config.
check(
"rgb_Vfov"))
211 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_Vfov' using value:" <<
m_rgb_Vfov;
215 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_Vfov' using DEFAULT value:" <<
m_rgb_Vfov;
217 prop_check.
unput(
"rgb_Vfov");
222 if (config.
check(
"rgb_Hfov"))
225 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_Hfov' using value:" <<
m_rgb_Hfov;
229 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'rgb_Hfov' using DEFAULT value:" <<
m_rgb_Hfov;
231 prop_check.
unput(
"rgb_Hfov");
236 if (config.
check(
"dep_Vfov"))
239 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_Vfov' using value:" <<
m_dep_Vfov;
243 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_Vfov' using DEFAULT value:" <<
m_dep_Vfov;
245 prop_check.
unput(
"dep_Vfov");
250 if (config.
check(
"dep_Hfov"))
253 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_Hfov' using value:" <<
m_dep_Hfov;
257 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_Hfov' using DEFAULT value:" <<
m_dep_Hfov;
259 prop_check.
unput(
"dep_Hfov");
264 if (config.
check(
"dep_near"))
267 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_near' using value:" <<
m_dep_near;
271 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_near' using DEFAULT value:" <<
m_dep_near;
273 prop_check.
unput(
"dep_near");
278 if (config.
check(
"dep_far"))
281 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_far' using value:" <<
m_dep_far;
285 yCInfo(FakeDepthCameraDriverParamsCOMPONENT) <<
"Parameter 'dep_far' using DEFAULT value:" <<
m_dep_far;
287 prop_check.
unput(
"dep_far");
292 if (config.
check(
"test_distance_constant"))
301 prop_check.
unput(
"test_distance_constant");
336 doc = doc + std::string(
"\n=============================================\n");
337 doc = doc + std::string(
"This is the help for device: FakeDepthCameraDriver\n");
338 doc = doc + std::string(
"\n");
339 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
340 doc = doc + std::string(
"'rgb_h': rgb_h\n");
341 doc = doc + std::string(
"'rgb_w': rgb_w\n");
342 doc = doc + std::string(
"'dep_h': dep_h\n");
343 doc = doc + std::string(
"'dep_w': dep_w\n");
344 doc = doc + std::string(
"'accuracy': accuracy\n");
345 doc = doc + std::string(
"'rgb_Vfov': rgb_Vfov\n");
346 doc = doc + std::string(
"'rgb_Hfov': rgb_Hfov\n");
347 doc = doc + std::string(
"'dep_Vfov': dep_Vfov\n");
348 doc = doc + std::string(
"'dep_Hfov': dep_Hfov\n");
349 doc = doc + std::string(
"'dep_near': dep_near\n");
350 doc = doc + std::string(
"'dep_far': dep_far\n");
351 doc = doc + std::string(
"'test_distance_constant': if set != 0, it will set all the pixels of the generated depth to constant distance of x meters\n");
352 doc = doc + std::string(
"\n");
353 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
354 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 --test_distance_constant 2.0\n";
355 doc = doc + std::string(
"Using only mandatory params:\n");
356 doc = doc +
" yarpdev --device fakeDepthCamera\n";
357 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.
double m_test_distance_constant
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,...)