30 std::vector<std::string> params;
31 params.push_back(
"test");
32 params.push_back(
"rpc_test_port");
33 params.push_back(
"localization_port");
34 params.push_back(
"localization_server");
35 params.push_back(
"localization_client");
36 params.push_back(
"localization_device");
37 params.push_back(
"MAP_MODE::map_file");
38 params.push_back(
"MAP_MODE::map_context");
39 params.push_back(
"clip_max");
40 params.push_back(
"clip_min");
41 params.push_back(
"GENERAL::period");
42 params.push_back(
"CONSTANT_MODE::const_distance");
49 if (paramName ==
"test")
54 if (paramName ==
"rpc_test_port")
59 if (paramName ==
"localization_port")
64 if (paramName ==
"localization_server")
69 if (paramName ==
"localization_client")
74 if (paramName ==
"localization_device")
79 if (paramName ==
"MAP_MODE::map_file")
84 if (paramName ==
"MAP_MODE::map_context")
89 if (paramName ==
"clip_max")
94 if (paramName ==
"clip_min")
99 if (paramName ==
"GENERAL::period")
104 if (paramName ==
"CONSTANT_MODE::const_distance")
110 yError() <<
"parameter '" << paramName <<
"' was not found";
129 if (config.
check(
"help"))
138 if (config.
check(
"test"))
141 yCInfo(FakeLaserParamsCOMPONENT) <<
"Parameter 'test' using value:" <<
m_test;
145 yCError(FakeLaserParamsCOMPONENT) <<
"Mandatory parameter 'test' not found!";
146 yCError(FakeLaserParamsCOMPONENT) <<
"Description of the parameter: Choose the modality";
149 prop_check.
unput(
"test");
154 if (config.
check(
"rpc_test_port"))
161 yCInfo(FakeLaserParamsCOMPONENT) <<
"Parameter 'rpc_test_port' using DEFAULT value:" <<
m_rpc_test_port;
163 prop_check.
unput(
"rpc_test_port");
168 if (config.
check(
"localization_port"))
177 prop_check.
unput(
"localization_port");
182 if (config.
check(
"localization_server"))
191 prop_check.
unput(
"localization_server");
196 if (config.
check(
"localization_client"))
205 prop_check.
unput(
"localization_client");
210 if (config.
check(
"localization_device"))
219 prop_check.
unput(
"localization_device");
226 if (sectionp.
check(
"map_file"))
235 prop_check.
unput(
"MAP_MODE::map_file");
242 if (sectionp.
check(
"map_context"))
251 prop_check.
unput(
"MAP_MODE::map_context");
256 if (config.
check(
"clip_max"))
259 yCInfo(FakeLaserParamsCOMPONENT) <<
"Parameter 'clip_max' using value:" <<
m_clip_max;
263 yCInfo(FakeLaserParamsCOMPONENT) <<
"Parameter 'clip_max' using DEFAULT value:" <<
m_clip_max;
265 prop_check.
unput(
"clip_max");
270 if (config.
check(
"clip_min"))
273 yCInfo(FakeLaserParamsCOMPONENT) <<
"Parameter 'clip_min' using value:" <<
m_clip_min;
277 yCInfo(FakeLaserParamsCOMPONENT) <<
"Parameter 'clip_min' using DEFAULT value:" <<
m_clip_min;
279 prop_check.
unput(
"clip_min");
286 if (sectionp.
check(
"period"))
293 yCInfo(FakeLaserParamsCOMPONENT) <<
"Parameter 'GENERAL::period' using DEFAULT value:" <<
m_GENERAL_period;
295 prop_check.
unput(
"GENERAL::period");
301 sectionp = config.
findGroup(
"CONSTANT_MODE");
302 if (sectionp.
check(
"const_distance"))
311 prop_check.
unput(
"CONSTANT_MODE::const_distance");
346 doc = doc + std::string(
"\n=============================================\n");
347 doc = doc + std::string(
"This is the help for device: FakeLaser\n");
348 doc = doc + std::string(
"\n");
349 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
350 doc = doc + std::string(
"'test': Choose the modality\n");
351 doc = doc + std::string(
"'rpc_test_port': Full name of the rpc port on which user can send different test commands\n");
352 doc = doc + std::string(
"'localization_port': Full name of the port to which device connects to receive the localization data\n");
353 doc = doc + std::string(
"'localization_server': Full name of the port to which device connects to receive the localization data\n");
354 doc = doc + std::string(
"'localization_client': Full name of the local transformClient opened by the device\n");
355 doc = doc + std::string(
"'localization_device': Type of localization device, e.g. localization2DClient, localization2D_nwc_yarp\n");
356 doc = doc + std::string(
"'MAP_MODE::map_file': Full path to a .map file\n");
357 doc = doc + std::string(
"'MAP_MODE::map_context': Full path to a .map file\n");
358 doc = doc + std::string(
"'clip_max': Maximum detectable distance for an obstacle\n");
359 doc = doc + std::string(
"'clip_min': Minimum detectable distance for an obstacle\n");
360 doc = doc + std::string(
"'GENERAL::period': Thread period\n");
361 doc = doc + std::string(
"'CONSTANT_MODE::const_distance': Default const distance for mode use_constant\n");
362 doc = doc + std::string(
"\n");
363 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
364 doc = doc +
" yarpdev --device fakeLaser --test use_pattern --rpc_test_port /fakeLaser/rpc:i --localization_port /fakeLaser/location:i --localization_server /localizationServer --localization_client /fakeLaser/localizationClient --localization_device localization2DClient --MAP_MODE::map_file <optional_value> --MAP_MODE::map_context <optional_value> --clip_max 3.5 --clip_min 0.1 --GENERAL::period 0.02 --CONSTANT_MODE::const_distance 1\n";
365 doc = doc + std::string(
"Using only mandatory params:\n");
366 doc = doc +
" yarpdev --device fakeLaser --test use_pattern\n";
367 doc = doc + std::string(
"=============================================\n\n");
return doc;
double m_CONSTANT_MODE_const_distance
std::string m_localization_device
std::string m_MAP_MODE_map_file
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::string m_rpc_test_port
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
std::string m_provided_configuration
std::string m_localization_port
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
std::string m_localization_client
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
std::string m_localization_server
std::string getConfiguration() const override
Return the configuration of the device.
std::string m_MAP_MODE_map_context
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 yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
virtual std::string asString() const
Get string value.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)