25 #include <yarp/os/Network.h>
26 #include <yarp/os/Port.h>
27 #include <yarp/os/Bottle.h>
28 #include <yarp/os/Time.h>
30 #include <yarp/sig/Vector.h>
37 using namespace yarp::os;
43 #include <yarp/os/ResourceFinder.h>
62 bool Create(yarp::os::ResourceFinder& config);
69 yarp::sig::Vector *enc =NULL;
70 yarp::sig::Vector *encV=NULL;
72 if (portEncBase.getInputCount()>0)
76 while (enc=portEncBase.read(
false)) encV=enc;
78 if (encV)
for (
int i=0; i<6; ++i) dEncBase[i]=(*encV)[i];
83 if (portEncTorso.getInputCount()>0)
87 while (enc=portEncTorso.read(
false)) encV=enc;
89 if (encV)
for (
int i=0; i<nJTorso; ++i) dEncTorso[i]=(*encV)[i];
92 if (portEncHead.getInputCount()>0)
96 while (enc=portEncHead.read(
false)) encV=enc;
100 for (
int i=0; i<nJHead; ++i) dEncHead[i]=(*encV)[i];
102 double dLeftEye =dEncHead[4]-0.5*dEncHead[5];
103 double dRightEye=dEncHead[4]+0.5*dEncHead[5];
105 dEncHead[4]=dLeftEye;
106 dEncHead[5]=dRightEye;
110 if (portEncLeftArm.getInputCount()>0)
114 while (enc=portEncLeftArm.read(
false)) encV=enc;
116 if (encV)
for (
int i=0; i<nJLeftArm; ++i) dEncLeftArm[i]=(*encV)[i];
119 if (portEncRightArm.getInputCount()>0)
123 while (enc=portEncRightArm.read(
false)) encV=enc;
125 if (encV)
for (
int i=0; i<nJRightArm; ++i) dEncRightArm[i]=(*encV)[i];
128 if (portEncLeftLeg.getInputCount()>0)
132 while (enc=portEncLeftLeg.read(
false)) encV=enc;
134 if (encV)
for (
int i=0; i<nJLeftLeg; ++i) dEncLeftLeg[i]=(*encV)[i];
137 if (portEncRightLeg.getInputCount()>0)
141 while (enc=portEncRightLeg.read(
false)) encV=enc;
143 if (encV)
for (
int i=0; i<nJRightLeg; ++i) dEncRightLeg[i]=(*encV)[i];
146 glShadeModel(GL_SMOOTH);
147 GLfloat ambientA[]={0.9,0.667,0.561,1};
148 GLfloat diffuseA[]={0.9,0.667,0.561,0};
149 GLfloat specularA[]={0.6,0.6,0.6,0.0};
150 GLfloat shininessA=100.0;
151 glMaterialfv(GL_FRONT,GL_AMBIENT,ambientA);
152 glMaterialfv(GL_FRONT,GL_DIFFUSE,diffuseA);
153 glMaterialfv(GL_FRONT,GL_SPECULAR,specularA);
154 glMaterialf(GL_FRONT,GL_SHININESS,shininessA);
155 glEnable(GL_LIGHTING);
159 glEnable(GL_COLOR_MATERIAL);
160 glEnable(GL_LINE_SMOOTH);
166 double dScale=0.075*dAvatarScale;
167 glScaled(dScale,dScale,dScale);
170 glTranslated(0.0,3.5,0.0);
172 pRoot->draw(dEncBuffer,NULL);
182 bool expect_token(
const QString& expect);
185 BVHNode* bvhRead(yarp::os::ResourceFinder& config);
186 BVHNode* bvhReadNode(yarp::os::ResourceFinder& config);
202 int nJTorso,nJHead,nJLeftArm,nJRightArm,nJLeftLeg,nJRightLeg,
nJBase;
212 double dEncBuffer[59];
213 double *dEncTorso,*dEncHead,*dEncLeftArm,*dEncRightArm,*dEncLeftLeg,*dEncRightLeg,*
dEncBase;
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
yarp::os::BufferedPort< yarp::sig::Vector > portEncBase
yarp::os::BufferedPort< yarp::sig::Vector > portEncLeftLeg
yarp::os::BufferedPort< yarp::sig::Vector > portEncLeftArm
QStringList bvhChannelName