19 YARP_LOG_COMPONENT(FakeLaserWithMotorParamsCOMPONENT,
"yarp.device.FakeLaserWithMotor")
30 std::vector<std::string> params;
31 params.push_back(
"test");
32 params.push_back(
"localization_port");
33 params.push_back(
"localization_server");
34 params.push_back(
"localization_client");
35 params.push_back(
"localization_device");
36 params.push_back(
"MAP_MODE::map_file");
37 params.push_back(
"MAP_MODE::map_context");
38 params.push_back(
"clip_max");
39 params.push_back(
"clip_min");
40 params.push_back(
"GENERAL::period");
41 params.push_back(
"CONSTANT_MODE::const_distance");
48 if (paramName ==
"test")
53 if (paramName ==
"localization_port")
58 if (paramName ==
"localization_server")
63 if (paramName ==
"localization_client")
68 if (paramName ==
"localization_device")
73 if (paramName ==
"MAP_MODE::map_file")
78 if (paramName ==
"MAP_MODE::map_context")
83 if (paramName ==
"clip_max")
88 if (paramName ==
"clip_min")
93 if (paramName ==
"GENERAL::period")
98 if (paramName ==
"CONSTANT_MODE::const_distance")
104 yError() <<
"parameter '" << paramName <<
"' was not found";
123 if (config.
check(
"help"))
132 if (config.
check(
"test"))
135 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'test' using value:" <<
m_test;
139 yCError(FakeLaserWithMotorParamsCOMPONENT) <<
"Mandatory parameter 'test' not found!";
140 yCError(FakeLaserWithMotorParamsCOMPONENT) <<
"Description of the parameter: Choose the modality";
143 prop_check.
unput(
"test");
148 if (config.
check(
"localization_port"))
155 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'localization_port' using DEFAULT value:" <<
m_localization_port;
157 prop_check.
unput(
"localization_port");
162 if (config.
check(
"localization_server"))
171 prop_check.
unput(
"localization_server");
176 if (config.
check(
"localization_client"))
185 prop_check.
unput(
"localization_client");
190 if (config.
check(
"localization_device"))
199 prop_check.
unput(
"localization_device");
206 if (sectionp.
check(
"map_file"))
213 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'MAP_MODE::map_file' using DEFAULT value:" <<
m_MAP_MODE_map_file;
215 prop_check.
unput(
"MAP_MODE::map_file");
222 if (sectionp.
check(
"map_context"))
231 prop_check.
unput(
"MAP_MODE::map_context");
236 if (config.
check(
"clip_max"))
239 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'clip_max' using value:" <<
m_clip_max;
243 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'clip_max' using DEFAULT value:" <<
m_clip_max;
245 prop_check.
unput(
"clip_max");
250 if (config.
check(
"clip_min"))
253 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'clip_min' using value:" <<
m_clip_min;
257 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'clip_min' using DEFAULT value:" <<
m_clip_min;
259 prop_check.
unput(
"clip_min");
266 if (sectionp.
check(
"period"))
269 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'GENERAL::period' using value:" <<
m_GENERAL_period;
273 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'GENERAL::period' using DEFAULT value:" <<
m_GENERAL_period;
275 prop_check.
unput(
"GENERAL::period");
281 sectionp = config.
findGroup(
"CONSTANT_MODE");
282 if (sectionp.
check(
"const_distance"))
291 prop_check.
unput(
"CONSTANT_MODE::const_distance");
326 doc = doc + std::string(
"\n=============================================\n");
327 doc = doc + std::string(
"This is the help for device: FakeLaserWithMotor\n");
328 doc = doc + std::string(
"\n");
329 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
330 doc = doc + std::string(
"'test': Choose the modality\n");
331 doc = doc + std::string(
"'localization_port': Full name of the port to which device connects to receive the localization data\n");
332 doc = doc + std::string(
"'localization_server': Full name of the port to which device connects to receive the localization data\n");
333 doc = doc + std::string(
"'localization_client': Full name of the local transformClient opened by the device\n");
334 doc = doc + std::string(
"'localization_device': Type of localization device, e.g. localization2DClient, localization2D_nwc_yarp\n");
335 doc = doc + std::string(
"'MAP_MODE::map_file': Full path to a .map file\n");
336 doc = doc + std::string(
"'MAP_MODE::map_context': Full path to a .map file\n");
337 doc = doc + std::string(
"'clip_max': Maximum detectable distance for an obstacle\n");
338 doc = doc + std::string(
"'clip_min': Minimum detectable distance for an obstacle\n");
339 doc = doc + std::string(
"'GENERAL::period': Thread period\n");
340 doc = doc + std::string(
"'CONSTANT_MODE::const_distance': Default const distance for mode use_constant\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 fakeLaserWithMotor --test use_pattern --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";
344 doc = doc + std::string(
"Using only mandatory params:\n");
345 doc = doc +
" yarpdev --device fakeLaserWithMotor --test use_pattern\n";
346 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string m_provided_configuration
std::string m_MAP_MODE_map_file
std::string m_localization_server
std::string getConfiguration() const override
Return the configuration of the device.
std::string m_localization_device
std::string m_MAP_MODE_map_context
FakeLaserWithMotor_ParamsParser()
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
double m_CONSTANT_MODE_const_distance
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
std::string m_localization_port
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::string m_localization_client
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,...)