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");
49 if (config.
check(
"help"))
54 std::string config_string = config.
toString();
58 if (config.
check(
"test"))
61 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'test' using value:" <<
m_test;
65 yCError(FakeLaserWithMotorParamsCOMPONENT) <<
"Mandatory parameter 'test' not found!";
66 yCError(FakeLaserWithMotorParamsCOMPONENT) <<
"Description of the parameter: Choose the modality";
69 prop_check.
unput(
"test");
74 if (config.
check(
"localization_port"))
83 prop_check.
unput(
"localization_port");
88 if (config.
check(
"localization_server"))
97 prop_check.
unput(
"localization_server");
102 if (config.
check(
"localization_client"))
111 prop_check.
unput(
"localization_client");
116 if (config.
check(
"localization_device"))
125 prop_check.
unput(
"localization_device");
132 if (sectionp.
check(
"map_file"))
139 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'MAP_MODE::map_file' using DEFAULT value:" <<
m_MAP_MODE_map_file;
141 prop_check.
unput(
"MAP_MODE::map_file");
148 if (sectionp.
check(
"map_context"))
157 prop_check.
unput(
"MAP_MODE::map_context");
162 if (config.
check(
"clip_max"))
165 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'clip_max' using value:" <<
m_clip_max;
169 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'clip_max' using DEFAULT value:" <<
m_clip_max;
171 prop_check.
unput(
"clip_max");
176 if (config.
check(
"clip_min"))
179 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'clip_min' using value:" <<
m_clip_min;
183 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'clip_min' using DEFAULT value:" <<
m_clip_min;
185 prop_check.
unput(
"clip_min");
192 if (sectionp.
check(
"period"))
195 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'GENERAL::period' using value:" <<
m_GENERAL_period;
199 yCInfo(FakeLaserWithMotorParamsCOMPONENT) <<
"Parameter 'GENERAL::period' using DEFAULT value:" <<
m_GENERAL_period;
201 prop_check.
unput(
"GENERAL::period");
207 sectionp = config.
findGroup(
"CONSTANT_MODE");
208 if (sectionp.
check(
"const_distance"))
217 prop_check.
unput(
"CONSTANT_MODE::const_distance");
252 doc = doc + std::string(
"\n=============================================\n");
253 doc = doc + std::string(
"This is the help for device: FakeLaserWithMotor\n");
254 doc = doc + std::string(
"\n");
255 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
256 doc = doc + std::string(
"'test': Choose the modality\n");
257 doc = doc + std::string(
"'localization_port': Full name of the port to which device connects to receive the localization data\n");
258 doc = doc + std::string(
"'localization_server': Full name of the port to which device connects to receive the localization data\n");
259 doc = doc + std::string(
"'localization_client': Full name of the local transformClient opened by the device\n");
260 doc = doc + std::string(
"'localization_device': Type of localization device, e.g. localization2DClient, localization2D_nwc_yarp\n");
261 doc = doc + std::string(
"'MAP_MODE::map_file': Full path to a .map file\n");
262 doc = doc + std::string(
"'MAP_MODE::map_context': Full path to a .map file\n");
263 doc = doc + std::string(
"'clip_max': Maximum detectable distance for an obstacle\n");
264 doc = doc + std::string(
"'clip_min': Minimum detectable distance for an obstacle\n");
265 doc = doc + std::string(
"'GENERAL::period': Thread period\n");
266 doc = doc + std::string(
"'CONSTANT_MODE::const_distance': Default const distance for mode use_constant\n");
267 doc = doc + std::string(
"\n");
268 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
269 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";
270 doc = doc + std::string(
"Using only mandatory params:\n");
271 doc = doc +
" yarpdev --device fakeLaserWithMotor --test use_pattern\n";
272 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string m_MAP_MODE_map_file
std::string m_localization_server
std::string m_localization_device
std::string m_MAP_MODE_map_context
FakeLaserWithMotor_ParamsParser()
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,...)