19 YARP_LOG_COMPONENT(FakeMotionControlMicroParamsCOMPONENT,
"yarp.device.FakeMotionControlMicro")
30 std::vector<std::string> params;
31 params.push_back(
"GENERAL::Joints");
32 params.push_back(
"GENERAL::AxisMap");
33 params.push_back(
"GENERAL::AxisName");
34 params.push_back(
"GENERAL::AxisType");
35 params.push_back(
"GENERAL::Encoder");
42 if (paramName ==
"GENERAL::Joints")
47 if (paramName ==
"GENERAL::AxisMap")
51 if (paramName ==
"GENERAL::AxisName")
55 if (paramName ==
"GENERAL::AxisType")
59 if (paramName ==
"GENERAL::Encoder")
64 yError() <<
"parameter '" << paramName <<
"' was not found";
83 if (config.
check(
"help"))
94 if (sectionp.
check(
"Joints"))
97 yCInfo(FakeMotionControlMicroParamsCOMPONENT) <<
"Parameter 'GENERAL::Joints' using value:" <<
m_GENERAL_Joints;
101 yCInfo(FakeMotionControlMicroParamsCOMPONENT) <<
"Parameter 'GENERAL::Joints' using DEFAULT value:" <<
m_GENERAL_Joints;
103 prop_check.
unput(
"GENERAL::Joints");
110 if (sectionp.
check(
"AxisMap"))
117 std::string tempBots = tempBot->
toString();
118 for (
size_t i=0; i<tempBot->
size(); i++)
125 yCError(FakeMotionControlMicroParamsCOMPONENT) <<
"parameter 'GENERAL_AxisMap' is not a properly formatted bottle";
128 yCInfo(FakeMotionControlMicroParamsCOMPONENT) <<
"Parameter 'GENERAL::AxisMap' using value:" <<
m_GENERAL_AxisMap;
132 yCInfo(FakeMotionControlMicroParamsCOMPONENT) <<
"Parameter 'GENERAL::AxisMap' using DEFAULT value:" <<
m_GENERAL_AxisMap;
134 prop_check.
unput(
"GENERAL::AxisMap");
141 if (sectionp.
check(
"AxisName"))
148 std::string tempBots = tempBot->
toString();
149 for (
size_t i=0; i<tempBot->
size(); i++)
156 yCError(FakeMotionControlMicroParamsCOMPONENT) <<
"parameter 'GENERAL_AxisName' is not a properly formatted bottle";
159 yCInfo(FakeMotionControlMicroParamsCOMPONENT) <<
"Parameter 'GENERAL::AxisName' using value:" <<
m_GENERAL_AxisName;
163 yCInfo(FakeMotionControlMicroParamsCOMPONENT) <<
"Parameter 'GENERAL::AxisName' using DEFAULT value:" <<
m_GENERAL_AxisName;
165 prop_check.
unput(
"GENERAL::AxisName");
172 if (sectionp.
check(
"AxisType"))
179 std::string tempBots = tempBot->
toString();
180 for (
size_t i=0; i<tempBot->
size(); i++)
187 yCError(FakeMotionControlMicroParamsCOMPONENT) <<
"parameter 'GENERAL_AxisType' is not a properly formatted bottle";
190 yCInfo(FakeMotionControlMicroParamsCOMPONENT) <<
"Parameter 'GENERAL::AxisType' using value:" <<
m_GENERAL_AxisType;
194 yCInfo(FakeMotionControlMicroParamsCOMPONENT) <<
"Parameter 'GENERAL::AxisType' using DEFAULT value:" <<
m_GENERAL_AxisType;
196 prop_check.
unput(
"GENERAL::AxisType");
203 if (sectionp.
check(
"Encoder"))
210 std::string tempBots = tempBot->
toString();
211 for (
size_t i=0; i<tempBot->
size(); i++)
218 yCError(FakeMotionControlMicroParamsCOMPONENT) <<
"parameter 'GENERAL_Encoder' is not a properly formatted bottle";
221 yCInfo(FakeMotionControlMicroParamsCOMPONENT) <<
"Parameter 'GENERAL::Encoder' using value:" <<
m_GENERAL_Encoder;
225 yCInfo(FakeMotionControlMicroParamsCOMPONENT) <<
"Parameter 'GENERAL::Encoder' using DEFAULT value:" <<
m_GENERAL_Encoder;
227 prop_check.
unput(
"GENERAL::Encoder");
262 doc = doc + std::string(
"\n=============================================\n");
263 doc = doc + std::string(
"This is the help for device: FakeMotionControlMicro\n");
264 doc = doc + std::string(
"\n");
265 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
266 doc = doc + std::string(
"'GENERAL::Joints': Number of degrees of freedom\n");
267 doc = doc + std::string(
"'GENERAL::AxisMap': a list of reordered indices for the axes\n");
268 doc = doc + std::string(
"'GENERAL::AxisName': a list of strings representing the axes names\n");
269 doc = doc + std::string(
"'GENERAL::AxisType': a list of strings representing the axes type (revolute/prismatic)\n");
270 doc = doc + std::string(
"'GENERAL::Encoder': a list of scales for the encoders\n");
271 doc = doc + std::string(
"\n");
272 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
273 doc = doc +
" yarpdev --device fakeMotionControlMicro --GENERAL::Joints 1 --GENERAL::AxisMap <optional_value> --GENERAL::AxisName <optional_value> --GENERAL::AxisType <optional_value> --GENERAL::Encoder <optional_value>\n";
274 doc = doc + std::string(
"Using only mandatory params:\n");
275 doc = doc +
" yarpdev --device fakeMotionControlMicro\n";
276 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string getConfiguration() const override
Return the configuration of the device.
std::vector< int > m_GENERAL_AxisMap
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::string m_provided_configuration
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
std::vector< std::string > m_GENERAL_AxisName
std::vector< std::string > m_GENERAL_AxisType
std::vector< int > m_GENERAL_Encoder
FakeMotionControlMicro_ParamsParser()
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.
size_type size() const
Gets the number of elements in the bottle.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
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 std::int64_t asInt64() const
Get 64-bit integer value.
virtual Bottle * asList() const
Get list value.
virtual std::string asString() const
Get string value.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)