24 const std::string &_context)
28 yarp::os::ResourceFinder skinRF;
29 skinRF.setDefaultContext(_context.c_str());
30 skinRF.setDefaultConfigFile(_from.c_str());
31 skinRF.configure(0,NULL);
33 yarp::os::Bottle &skinConf = skinRF.findGroup(
"SKIN_EVENTS");
35 if(!skinConf.isNull())
37 yInfo(
"[iCubSkin] SKIN_EVENTS section found");
39 yarp::os::Bottle* skinPartList;
40 if(skinConf.check(
"skinParts"))
42 skinPartList = skinConf.find(
"skinParts").asList();
46 yError(
"[iCubSkin] No skinParts field found!");
50 yarp::os::Bottle *taxelPosFiles;
51 if(skinConf.check(
"taxelPositionFiles"))
53 taxelPosFiles = skinConf.find(
"taxelPositionFiles").asList();
57 yError(
"[iCubSkin] No taxelPositionFiles field found!");
61 for (
int i = 0; i < skinPartList->size(); ++i)
63 std::string taxelPosFile = taxelPosFiles->get(i).asString().c_str();
64 std::string filePath = skinRF.findFile(taxelPosFile.c_str());
67 yInfo(
"[iCubSkin] filePath [%i] %s\n",i,filePath.c_str());
69 if (
p.setTaxelPosesFromFile(filePath))
78 yError(
"[iCubSkin] No skin configuration files found.");
84 yError(
"[iCubSkin] No valid ini file found. Skin is empty!");
93 yDebug(
"********************\n");
94 yDebug(
"iCubSkin size %zi",
skin.size());
95 for (
size_t i = 0; i <
skin.size(); ++i)
99 yDebug(
"********************\n");
bool configureSkinFromFile(const std::string &_from="skinManAll.ini", const std::string &_context="skinGui")
Configures the class with an .ini file.
void print(int verbosity=0)
Print Method.
iCubSkin()
Default constructor.
std::vector< skinPart > skin
Class that encloses everything relate to a skinPart.