当前位置: 首页>>代码示例>>C++>>正文


C++ Serial::sendApi方法代码示例

本文整理汇总了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);
		}
开发者ID:Hefestos,项目名称:cup2015,代码行数:67,代码来源:Main(teste-biel).cpp


注:本文中的Serial::sendApi方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。