本文整理汇总了C++中CoordinatesExtractor2::getYaw方法的典型用法代码示例。如果您正苦于以下问题:C++ CoordinatesExtractor2::getYaw方法的具体用法?C++ CoordinatesExtractor2::getYaw怎么用?C++ CoordinatesExtractor2::getYaw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CoordinatesExtractor2
的用法示例。
在下文中一共展示了CoordinatesExtractor2::getYaw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeContinuosDataFile
void writeContinuosDataFile()
{
ofstream outputfile;
outputfile.open("data.dat");
outputfile << "Yaw: " << toDegrees(headEyeCoords.getYaw()) << endl <<"Pitch: " << toDegrees(headEyeCoords.getPitch()) << endl;
outputfile << "EyeLeft: " << eyeLeft.transpose() << endl;
outputfile << "EyeRight: " << eyeRight.transpose() << endl << endl;
outputfile << "Factors:" << endl;
for (map<string,double>::iterator iter=factors.begin(); iter!=factors.end(); ++iter)
{
outputfile << "\t\t" << iter->first << "= " << iter->second << endl;
}
outputfile << "Trials done: " << trialNumber << endl;
if (trialNumber!=0)
outputfile << "Last response (right=0, left=1): " << response << endl;
outputfile.clear();
outputfile.seekp(0,ios::beg);
}
示例2: drawInfo
void drawInfo()
{
if ( !infoDrawn )
return;
GLText text;
text.init(SCREEN_WIDTH, SCREEN_HEIGHT,glWhite);
text.enterTextInputMode();
string strfactors;
for ( map<string,double>::iterator iter = factors.begin(); iter!=factors.end(); ++iter)
{
text.draw( (iter->first) + "= " + util::stringify<int>( (int )(iter->second)) );
}
switch ( headCalibrationDone )
{
case 0:
{
if ( allVisibleHead )
text.draw("OK! Press SPACEBAR");
else
text.draw("---");
}
break;
case 1:
case 2:
{
text.draw( "EL " + stringify<int>(eyeLeft.x() ) + " " + stringify<int>(eyeLeft.y() ) + " " + stringify<int>(eyeLeft.z()) );
text.draw( "ER " + stringify<int>(eyeRight.x() ) + " " + stringify<int>(eyeRight.y() ) + " " + stringify<int>(eyeRight.z()) );
text.draw("EC " + stringify<int>(cyclopeanEye.x())+" " + stringify<int>(cyclopeanEye.y())+" " + stringify<int>(cyclopeanEye.z()));
text.draw("Dist " + stringify<int>(cyclopeanEye.z()-focalDistance+60.0));
text.draw(" ");
text.draw( "PITCH " + stringify<int>(toDegrees(headEyeCoords.getPitch())));
text.draw( "YAW " + stringify<int>(toDegrees(headEyeCoords.getYaw())));
text.draw( "ROLL " + stringify<int>(toDegrees(headEyeCoords.getRoll())));
}
break;
}
text.leaveTextInputMode();
}
示例3: idle
void idle()
{
if (trialNumber >= maxTotalTrials )
exit(0);
double elapsedFrameTime = totalTimer.getTimeIntervalInMilliSec();
optotrak.updateMarkers(elapsedFrameTime);
markers = optotrak.getAllMarkers();
headEyeCoords.update(markers[1],markers[2],markers[3],TIMER_MS);
allVisiblePatch = markers[1].isVisible() && markers[2].isVisible()
&& markers[3].isVisible();
allVisibleHead = markers[17].isVisible() && markers[18].isVisible() && allVisibleHead;
eyeLeft = headEyeCoords.getLeftEye().p;
eyeRight = headEyeCoords.getRightEye().p;
cyclopeanEye = (eyeLeft+eyeRight)/2.0;
projPointEyeRight = getEyeProjectionPoint();
checkBounds(nOscillationsFixation,
eyeRight.x(),
trialMode,
headCalibrationDone,
minOscTime,
maxOscTime,
maxXOscillation,
translationTimer,
beepOk,
tweeter,
woofer,tweeter);
if ( trialMode == STIMULUSMODE )
deltaT+=TIMER_MS;
else
deltaT=0;
if (headCalibrationDone == 3 && trialMode != PROBEMODE )
{
// Questo rende conto del fatto che lo stimolo appare solo quando l'occhio è quasi in centro
int actualTrialMode = trialMode;
if ( trialMode == STIMULUSMODE && ( eyeRight.x()) > centerTolerance )
actualTrialMode=FIXATIONMODE;
markersFile << fixed << trialNumber << " " << actualTrialMode << " " ;
markersFile << fixed << setprecision(3) << eyeRight.transpose() << " " << eyeLeft.transpose() << " " << toDegrees(headEyeCoords.getPitch()) << " " << toDegrees(headEyeCoords.getYaw()) << " " << toDegrees(headEyeCoords.getRoll()) << " " ;
markersFile << fixed << setprecision(0)<<
factors["OmegaY"] << " " <<
factors["Binocular"] << " " <<
factors["Tilt"] << " " <<
factors["Slant"] << " " <<
totalTimer.getElapsedTimeInMilliSec() << endl;
//objectPassiveTransformation.setIdentity();
if ( actualTrialMode == STIMULUSMODE )
{
objectPassiveTransformation = getPassiveMatrix();
matrixFile << setw(6) << left <<
trialNumber << " " ;
for ( int i=0; i<3; i++)
matrixFile << objectPassiveTransformation.matrix().row(i) << " " ;
matrixFile << endl;
}
if ( actualTrialMode == STIMULUSMODE )
{
vector< Vector3d> projPoints = stimDrawer.projectStimulusPoints(objectActiveTransformation,headEyeCoords.getRigidStart().getFullTransformation(),cam,focalDistance,screen,Vector3d(0,0,0),false,false);
MatrixXd a1toa6 = stimDrawer.computeOpticFlow(projPoints, focalDistance, elapsedFrameTime/1000);
flowsFile << trialNumber << " " << a1toa6.transpose() << endl;
}
}
writeContinuosDataFile();
}