19 YARP_LOG_COMPONENT(Localization2D_nws_yarpParamsCOMPONENT,
"yarp.device.Localization2D_nws_yarp")
30 std::vector<std::string> params;
31 params.push_back(
"GENERAL::period");
32 params.push_back(
"GENERAL::retrieve_position_periodically");
33 params.push_back(
"GENERAL::name");
34 params.push_back(
"GENERAL::publish_odometry");
35 params.push_back(
"GENERAL::publish_location");
42 if (paramName ==
"GENERAL::period")
47 if (paramName ==
"GENERAL::retrieve_position_periodically")
50 else paramValue =
"false";
53 if (paramName ==
"GENERAL::name")
58 if (paramName ==
"GENERAL::publish_odometry")
61 else paramValue =
"false";
64 if (paramName ==
"GENERAL::publish_location")
67 else paramValue =
"false";
71 yError() <<
"parameter '" << paramName <<
"' was not found";
90 if (config.
check(
"help"))
101 if (sectionp.
check(
"period"))
104 yCInfo(Localization2D_nws_yarpParamsCOMPONENT) <<
"Parameter 'GENERAL::period' using value:" <<
m_GENERAL_period;
108 yCInfo(Localization2D_nws_yarpParamsCOMPONENT) <<
"Parameter 'GENERAL::period' using DEFAULT value:" <<
m_GENERAL_period;
110 prop_check.
unput(
"GENERAL::period");
117 if (sectionp.
check(
"retrieve_position_periodically"))
126 prop_check.
unput(
"GENERAL::retrieve_position_periodically");
133 if (sectionp.
check(
"name"))
136 yCInfo(Localization2D_nws_yarpParamsCOMPONENT) <<
"Parameter 'GENERAL::name' using value:" <<
m_GENERAL_name;
140 yCInfo(Localization2D_nws_yarpParamsCOMPONENT) <<
"Parameter 'GENERAL::name' using DEFAULT value:" <<
m_GENERAL_name;
142 prop_check.
unput(
"GENERAL::name");
149 if (sectionp.
check(
"publish_odometry"))
158 prop_check.
unput(
"GENERAL::publish_odometry");
165 if (sectionp.
check(
"publish_location"))
174 prop_check.
unput(
"GENERAL::publish_location");
209 doc = doc + std::string(
"\n=============================================\n");
210 doc = doc + std::string(
"This is the help for device: Localization2D_nws_yarp\n");
211 doc = doc + std::string(
"\n");
212 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
213 doc = doc + std::string(
"'GENERAL::period': The period of the working thread\n");
214 doc = doc + std::string(
"'GENERAL::retrieve_position_periodically': If true, the subdevice is asked periodically to retrieve the current location. Otherwise the current location is obtained asynchronously when a getCurrentPosition() command is issued.\n");
215 doc = doc + std::string(
"'GENERAL::name': The name of the server, used as a prefix for the opened ports\n");
216 doc = doc + std::string(
"'GENERAL::publish_odometry': Periodically publish odometry data over the network\n");
217 doc = doc + std::string(
"'GENERAL::publish_location': PEriodically publish location data over the network\n");
218 doc = doc + std::string(
"\n");
219 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
220 doc = doc +
" yarpdev --device localization2D_nws_yarp --GENERAL::period 0.01 --GENERAL::retrieve_position_periodically true --GENERAL::name /localization2D_nws_yarp --GENERAL::publish_odometry true --GENERAL::publish_location true\n";
221 doc = doc + std::string(
"Using only mandatory params:\n");
222 doc = doc +
" yarpdev --device localization2D_nws_yarp\n";
223 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
std::string getConfiguration() const override
Return the configuration of the device.
bool m_GENERAL_publish_odometry
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
bool m_GENERAL_retrieve_position_periodically
Localization2D_nws_yarp_ParamsParser()
std::string m_provided_configuration
bool m_GENERAL_publish_location
std::string m_GENERAL_name
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
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 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 bool asBool() const
Get boolean value.
virtual std::string asString() const
Get string value.
#define yCInfo(component,...)
#define YARP_LOG_COMPONENT(name,...)