本文整理汇总了C++中WorkSpace::SetLabelFromRecogUnit方法的典型用法代码示例。如果您正苦于以下问题:C++ WorkSpace::SetLabelFromRecogUnit方法的具体用法?C++ WorkSpace::SetLabelFromRecogUnit怎么用?C++ WorkSpace::SetLabelFromRecogUnit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorkSpace
的用法示例。
在下文中一共展示了WorkSpace::SetLabelFromRecogUnit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generate_with_symbol_space
int generate_with_symbol_space(void)
{
Behavior *tmp_beh, *beh;
WorkSpace *work = NULL;
work = new WorkSpace();
tl_message ("Now loading motionDBs...");
work->Load ("../../script/learning_scriptfile_3");
tl_message ("Now loading recogunits...");
work->SetRecogUnits ("../../script/learning_scriptfile_3");
work->SetLabelFromRecogUnit();
work->BeforeRecognize();
work->SetDisVector();
work->SymmentrizeDisVector();
work->SpaceCreate(3);
vector<double> tmp_dis;
vector<double> tmp_cord;
int span = 20, step = 5;
Pose *pose;
cur_beh = new Behavior();
for (int i=0; i<span; i++)
{
data = TOYOTA_GetMotionCaptureData();
joint_angle = TOYOTA_TransferCaptureToJoint(data);
pose = new Pose(dof, joint_angle); // dof = number of DoF, joint_angle : sequence of double
cur_beh->AddPose(pose);
}
for (int j=0; j<1000; j++)
{
cerr << "---------------- pop" << endl;
for (int i=0; i<step; i++)
{
cur_beh->PopFrontPose();
data = TOYOTA_GetMotionCaptureData();
joint_angle = TOYOTA_TransferCaptureToJoint(data);
pose = new Pose(dof, joint_angle); // dof = number of DoF, joint_angle : sequence of double
cur_beh->AddPose(pose);
}
cerr << "---------------- CalcDis" << endl;
// その一部分の動作を空間に射影した場合の,各既知原始シンボルからの距離を計測
tmp_dis = work->CalcDistanceOfInputBehavior(cur_beh);
cerr << "---------------- GetCoordinate" << endl;
// 求めた距離に応じて,空間に射影するべき座標を算出
tmp_cord = work->GetPsymbolSpace()->CoordinateFromDistanceData(tmp_dis);
cerr << "!!!!! " << j << "th Gene Start!" << endl;
// その座標における動作を生成する.
work->BehGeneFromTransition(tmp_cord);
cerr << "!!!!! " << j << "th Gene Finish!" << endl;
tmp_beh = work->GetLastBehavior ();
for (int i=0; i<step; i++)
{
TOYOTA_ActuateRobot (tmp_beh->NthPose(i));
}
}
return TRUE;
}