本文整理汇总了C++中Serial::sendApi方法的典型用法代码示例。如果您正苦于以下问题:C++ Serial::sendApi方法的具体用法?C++ Serial::sendApi怎么用?C++ Serial::sendApi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Serial
的用法示例。
在下文中一共展示了Serial::sendApi方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
// Armazenamos os ganhos atuais, nos ganhos anteriores e atualizamos os ganhos atuais
Camera.players[0].old_gain[0] = Camera.players[0].gain[0];
Camera.players[0].old_gain[1] = Camera.players[0].gain[1];
Camera.players[0].old_gain[2] = Camera.players[0].gain[2];
Camera.players[0].gain[0] = param0[0];
Camera.players[0].gain[1] = param0[1];
Camera.players[0].gain[2] = param0[2];
}
}
}
}
else if (change_loop == 7)
{
cout << "Os ganhos são :" << endl;
cout << "GPL " << param0[0] << endl;
cout << "GIL " << param0[1] << endl;
cout << "GDL " << param0[2] << endl;
cout << "GPR " << param0[3] << endl;
cout << "GIR " << param0[4] << endl;
cout << "GDR " << param0[5] << endl;
}
///// -------------------------------------- TÉRMINO DA MODIFICAÇÃO BIEL -----------------------------------------------------/////
Controle_bili.rotina_controle(0, 0, &Camera, xd, yd);
newV2 = (0.000001947*pow(recievedValue, 2) - 0.004673*recievedValue + 3.495)*abs(Controle_bili.v2 * 255);
newV1 = (0.000001947*pow(recievedValue, 2) - 0.004673*recievedValue + 3.495)*abs(Controle_bili.v1 * 255);
//SP->sendApi(0, Controle_bili.o, abs(Controle_bili.v2 * 255), Controle_bili.i, abs(Controle_bili.v1 * 255));
SP->sendApi(0, Controle_bili.o, newV2, Controle_bili.i, newV1);
if (Camera.players[0].x != -1)
fprintf(gFile, "%f,%f,%f, %i, %f, %f,%f,%f,%f,%f,%f, %f\n", Controle_bili.x*1.3, Controle_bili.y*1.3, Controle_bili.theta, int(visionF - start), Controle_bili.thetad, Controle_bili.v1, Controle_bili.v2, w, xd*1.3, yd*1.3, u, Controle_bili.refaux);
//SP->sendApi(0, 1, 84, 0, 0);
//=================== DISPLAY DOS DADOS DO ROBO ============//
cout << "thetad = " << Controle_bili.thetad*180/M_PI << endl;
cout << "theta = " << Controle_bili.theta * 180 / M_PI << endl;
cout << "ang_error = " << Controle_bili.ang_error * 180 / M_PI << endl;
//cout << "ypc = " << dy0 << endl;
cout << "v1 = " << Controle_bili.v1 << endl;
cout << "v2 = " << Controle_bili.v2 << endl;
//cout << "u_p = " << Controle_bili.u_p << endl;
//======================== ENVIO DAS VELOCIDADES ====================//
if (!paused)
{
//SP->send(0, v2, v1);
//SP->send(v2, v1);
//SP->send(0, Controle00.v.x, Controle00.v.y);
// whishPath.push_back(robot(Estrategia.players[0].goal_x, Estrategia.players[0].goal_y));
//sfollowedPath.push_back(Camera.players[0]);
//SP->send(1, Controle01.v.x, Controle01.v.y);
//SP->send(2, Controle02.v.x, Controle02.v.y);
}