30 std::vector<std::string> params;
31 params.push_back(
"comport");
32 params.push_back(
"baudrate");
33 params.push_back(
"i2c");
34 params.push_back(
"period");
35 params.push_back(
"sensor_name");
36 params.push_back(
"frame_name");
37 params.push_back(
"channels");
44 if (paramName ==
"comport")
49 if (paramName ==
"baudrate")
54 if (paramName ==
"i2c")
59 if (paramName ==
"period")
61 paramValue = std::to_string(
m_period);
64 if (paramName ==
"sensor_name")
69 if (paramName ==
"frame_name")
74 if (paramName ==
"channels")
80 yError() <<
"parameter '" << paramName <<
"' was not found";
99 if (config.
check(
"help"))
108 if (config.
check(
"comport"))
111 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'comport' using value:" <<
m_comport;
115 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'comport' using DEFAULT value:" <<
m_comport;
117 prop_check.
unput(
"comport");
122 if (config.
check(
"baudrate"))
125 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'baudrate' using value:" <<
m_baudrate;
129 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'baudrate' using DEFAULT value:" <<
m_baudrate;
131 prop_check.
unput(
"baudrate");
136 if (config.
check(
"i2c"))
139 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'i2c' using value:" <<
m_i2c;
143 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'i2c' using DEFAULT value:" <<
m_i2c;
145 prop_check.
unput(
"i2c");
150 if (config.
check(
"period"))
153 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'period' using value:" <<
m_period;
157 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'period' using DEFAULT value:" <<
m_period;
159 prop_check.
unput(
"period");
164 if (config.
check(
"sensor_name"))
167 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'sensor_name' using value:" <<
m_sensor_name;
171 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'sensor_name' using DEFAULT value:" <<
m_sensor_name;
173 prop_check.
unput(
"sensor_name");
178 if (config.
check(
"frame_name"))
181 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'frame_name' using value:" <<
m_frame_name;
185 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'frame_name' using DEFAULT value:" <<
m_frame_name;
187 prop_check.
unput(
"frame_name");
192 if (config.
check(
"channels"))
195 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'channels' using value:" <<
m_channels;
199 yCInfo(BoschIMUParamsCOMPONENT) <<
"Parameter 'channels' using DEFAULT value:" <<
m_channels;
201 prop_check.
unput(
"channels");
236 doc = doc + std::string(
"\n=============================================\n");
237 doc = doc + std::string(
"This is the help for device: BoschIMU\n");
238 doc = doc + std::string(
"\n");
239 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
240 doc = doc + std::string(
"'comport': full name of device file\n");
241 doc = doc + std::string(
"'baudrate': baudrate setting of COM port\n");
242 doc = doc + std::string(
"'i2c': full name of device file\n");
243 doc = doc + std::string(
"'period': period of the thread\n");
244 doc = doc + std::string(
"'sensor_name': full name of the device\n");
245 doc = doc + std::string(
"'frame_name': full name of the sensor frame in which the measurements are expressed\n");
246 doc = doc + std::string(
"'channels': number of channels in the output port. Default 12. If 16, also includes quaternion data\n");
247 doc = doc + std::string(
"\n");
248 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
249 doc = doc +
" yarpdev --device imuBosch_BNO055 --comport <optional_value> --baudrate 115200 --i2c <optional_value> --period 10 --sensor_name sensor_imu_bosch_bno055 --frame_name sensor_imu_bosch_bno055 --channels 12\n";
250 doc = doc + std::string(
"Using only mandatory params:\n");
251 doc = doc +
" yarpdev --device imuBosch_BNO055\n";
252 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string m_provided_configuration
std::string m_sensor_name
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::string getConfiguration() const override
Return the configuration of the device.
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
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,...)