65 for (
int t=0; t<16; ++t)
71 cardId=0x300 | (config.find(
"cardid").asInt32() << 4);
72 netId=config.find(
"CanDeviceNum").asInt32();
73 deviceName=config.find(
"CanDeviceName").asString();
74 std::string part=
"/skinGui/";
75 part.append(config.find(
"robotPart").asString());
77 int width =config.find(
"width" ).asInt32();
78 int height=config.find(
"height").asInt32();
79 bool useCalibration = config.check(
"useCalibration");
80 if (useCalibration==
true)
82 printf(
"Reading datadirectly from CAN! Calibration unsupported\n");
83 useCalibration =
false;
87 printf(
"Using raw skin values (255-0)\n");
90 yarp::os::Bottle sensorSetConfig=config.findGroup(
"SENSORS").tail();
92 for (
int t=0; t<sensorSetConfig.size(); ++t)
94 yarp::os::Bottle sensorConfig(sensorSetConfig.get(t).toString());
96 std::string type(sensorConfig.get(0).asString());
97 if (type ==
"triangle" ||
98 type ==
"fingertip" ||
99 type ==
"fingertip2L" ||
100 type ==
"cer_sh_pdl" ||
101 type ==
"fingertip2R" ||
102 type ==
"triangle_10pad" ||
106 type ==
"fingertip3R" ||
107 type ==
"fingertip3L" ||
108 type ==
"fingertip4R" ||
109 type ==
"fingertip4L" ||
110 type ==
"fingertipMID" ||
113 int id=sensorConfig.get(1).asInt32();
114 double xc=sensorConfig.get(2).asFloat64();
115 double yc=sensorConfig.get(3).asFloat64();
116 double th=sensorConfig.get(4).asFloat64();
117 double gain=sensorConfig.get(5).asFloat64();
118 int lrMirror=sensorConfig.get(6).asInt32();
119 int layoutNum=sensorConfig.get(7).asInt32();
121 printf(
"%d %f\n",
id,gain);
127 printf(
"WARNING: triangle %d already exists.\n",
id);
131 if (type==
"triangle")
135 else if (type==
"triangle_10pad")
139 else if (type==
"fingertip")
143 else if (type==
"fingertip2L")
147 else if (type==
"fingertip3L")
151 else if(type ==
"fingertip4L")
155 else if(type ==
"cer_sh_pdl")
159 else if(type ==
"fingertip2R")
163 else if(type ==
"fingertip3R")
167 else if (type ==
"fingertip4R")
171 else if (type ==
"fingertipMID")
175 else if (type ==
"quad16")
177 sensor[id]=
new Quad16(xc,yc,th,gain,layoutNum,lrMirror);
179 else if(type ==
"palmR")
181 sensor[id]=
new PalmR(xc,yc,th,gain,layoutNum,lrMirror);
183 else if(type ==
"palmL")
185 sensor[id]=
new PalmL(xc,yc,th,gain,layoutNum,lrMirror);
192 printf(
"WARNING: %d is invalid triangle Id [0:15].\n",
id);
197 printf(
"WARNING: sensor of type %s unknown, discarded.\n",type.c_str());