24#include <qmessagebox.h>
37 for (
int p=0;
p<8; ++
p)
41 for (
int l=0; l<8; ++l)
50 robot=QString(config.find(
"robot").asString().c_str());
96 for (
int p=0;
p<8; ++
p)
115 qDebug(
"BVH::token(): no more tokens at index %d",
tokenPos);
125 qDebug(
"BVH::expect_token(): Bad file: %s missing\n", name.toLatin1().data());
133 QString fileName(config.findPath(
"geometry").c_str());
134 QFile geometryFile(fileName);
135 if(!geometryFile.open(QIODevice::ReadOnly))
137 QMessageBox::critical(0,QObject::tr(
"File not found"),QObject::tr(
"BVH File not found: %1").arg(fileName.toLatin1().data()));
141 inputFile=QString(geometryFile.readAll());
142 geometryFile.close();
185 QString sType=
token();
186 if (sType==
"}")
return NULL;
190 static const int BVH_ROOT=1,BVH_JOINT=2,BVH_END=3;
192 if (sType==
"ROOT") nType=BVH_ROOT;
193 else if (sType==
"JOINT") nType=BVH_JOINT;
194 else if (sType==
"END") nType=BVH_END;
197 qDebug(
"BVH::bvhReadNode(): Bad animation file: unknown node type: '%s'\n",sType.toLatin1().data());
203 QString sName=
token();
209 QString ftPortName=
"";
216 QString partName=
token();
217 if (partName==
"torso")
219 else if (partName==
"head")
221 else if (partName==
"left_arm")
223 else if (partName==
"right_arm")
225 else if (partName==
"left_leg")
227 else if (partName==
"right_leg")
229 skinLink=
token().toInt();
235 QString name=
token();
236 double a=
token().toDouble();
237 double b=
token().toDouble();
238 double c=
token().toDouble();
239 double d=
token().toDouble();
240 double e=
token().toDouble();
241 double f=
token().toDouble();
242 QString aux = QString(
"covers/%1").arg(name);
243 QString
file = QString(
"%1").arg(config.findPath((
const char *)(aux.toLatin1().data())).c_str());
245 printf(
"\n%s\n\n",
file.toLatin1().data());
250 if (tag==
"FORCE_TORQUE")
260 int id=
token().toInt();
262 double Px=
token().toDouble();
263 double Py=
token().toDouble();
264 double Pz=
token().toDouble();
272 double Rz=
token().toDouble();
273 double Ry=
token().toDouble();
274 double Rx=
token().toDouble();
275 double Px=
token().toDouble();
276 double Py=
token().toDouble();
277 double Pz=
token().toDouble();
283 int a=
token().toInt();
284 double b=
token().toDouble();
285 double c=
token().toDouble();
286 double d=
token().toDouble();
287 double e=
token().toDouble();
302 double a=
token().toDouble();
303 double b=
token().toDouble();
304 double c=
token().toDouble();
305 double d=
token().toDouble();
311 double a=
token().toDouble();
312 double b=
token().toDouble();
313 double c=
token().toDouble();
314 double d=
token().toDouble();
317 else if (tag==
"LEFTHAND")
319 int a=
token().toInt();
320 double b=
token().toDouble();
321 double c=
token().toDouble();
322 double d=
token().toDouble();
323 double e=
token().toDouble();
326 else if (tag==
"RIGHTHAND")
328 int a=
token().toInt();
329 double b=
token().toDouble();
330 double c=
token().toDouble();
331 double d=
token().toDouble();
332 double e=
token().toDouble();
335 else if (tag==
"INERTIAL")
337 double a=
token().toDouble();
338 double b=
token().toDouble();
339 double c=
token().toDouble();
340 double d=
token().toDouble();
348 mAB[skinPart][skinLink]=node;
void addChild(BVHNode *pChild)
BVHNode * bvhRead(yarp::os::ResourceFinder &config)
BVH(ObjectsManager *objManager=NULL)
ObjectsManager * mObjectsManager
yarp::os::BufferedPort< yarp::sig::Vector > portEncRightLeg
yarp::os::BufferedPort< yarp::sig::Vector > portEncTorso
yarp::os::BufferedPort< yarp::sig::Vector > portEncHead
yarp::os::BufferedPort< yarp::sig::Vector > portEncRightArm
bool expect_token(const QString &expect)
yarp::os::BufferedPort< yarp::sig::Vector > portEncBase
bool Create(yarp::os::ResourceFinder &config)
yarp::os::BufferedPort< yarp::sig::Vector > portEncLeftLeg
yarp::os::BufferedPort< yarp::sig::Vector > portEncLeftArm
QStringList bvhChannelName
BVHNode * bvhReadNode(yarp::os::ResourceFinder &config)
void setAddressBook(BVHNode ***ab)
QStringList tokenize(QString in, char sep)