コード例 #1
0
ファイル: SCOR.cpp プロジェクト: Arossius/SCOR
void Complet()
{

	Communication_Thread comTH;
	comTH.Launch();

	Ordre_Thread ordreTH;
	ordreTH.Launch();

	FieldViewer fieldViewer;
	fieldViewer.Launch();

	IAModule_Thread iamoduleTH;
	iamoduleTH.Launch();

	Robot_Thread robotTH;
	robotTH.Launch();



	string a("aaa");
	while (a != "exit")
	{

		cout << "a" <<endl;
		cin >> a;
		cout << "a" <<endl;
		Msg_Robot_IA msg;

		if (a == "exit")
			break;

	}



	cout << "c'est fini" << endl;


}
コード例 #2
0
int main(int argc, char * argv[]) {

    Communication_Thread comTH;
    comTH.Launch();

    Ordre_Thread ordreTH;
    ordreTH.Launch();

    FieldAnalyse fieldAnalyse;
    fieldAnalyse.Launch();

    IAModule_Thread iamoduleTH;
    iamoduleTH.Launch();

    Robot_Thread robotTH;
    robotTH.Launch();



    string a("aaa");
    while (a != "q")
    {

        std::cout << "tapez 'q' pour quitter" <<endl;
        cin >> a;

        if (a == "q")
            break;

    }



    cout << "c'est fini" << endl;


    return 0;
}
コード例 #3
0
ファイル: SCOR.cpp プロジェクト: Arossius/SCOR
void testIA_Ordre_Com()
{
	robot1.angle = 0;
	robot1.pos_x = 0;
	robot1.pos_y = 0;

	robot2.angle = 180;
	robot2.pos_x = 480;
	robot2.pos_y = 0;

	mq_attr att;
	att.mq_maxmsg = 10;
	att.mq_msgsize = sizeof(Msg_Robot_IA);

	mqd_t bal_robot_ia = mq_open(BAL_ROBOT_IA, O_WRONLY | O_CREAT, S_IRWXU, &att);


	Communication_Thread comTH;
	comTH.Launch();

	Ordre_Thread ordreTH;
	ordreTH.Launch();

	IAModule_Thread iamoduleTH;
	iamoduleTH.Launch();

	Robot_Thread robotTH;
	robotTH.Launch();



	string a("aaa");
	while (a != "exit")
	{

		cout << "a" <<endl;
		cin >> a;
		cout << "a" <<endl;
		Msg_Robot_IA msg;

		if (a == "exit")
			break;

		msg.balle.pos_x = 120;
		msg.balle.pos_y = 80;
		msg.balle.vit_x = 0;
		msg.balle.vit_y = 10;


		msg.robot1.pos_x = 0;
		msg.robot1.pos_y = 0;
		msg.robot1.angle = 0;

		msg.robot2.pos_x = 480;
		msg.robot2.pos_y = 0;
		msg.robot2.angle = -90;


		cout << "mq_send" <<endl;
		int i = mq_send(bal_robot_ia, (char*)&msg, sizeof(Msg_Robot_IA), 0);
		cout << "i=" << i << endl;


		sleep(15);

		msg.balle.pos_x = LARGEUR_TERRAIN/8;
		msg.balle.pos_y = LONGUEUR_TERRAIN/4;
		msg.balle.vit_x = 0;
		msg.balle.vit_y = 0;


		msg.robot1 = INIT_ROBOT1;

		msg.robot2.pos_x = 480;
		msg.robot2.pos_y = 0;
		msg.robot2.angle = -90;


		cout << "mq_send" <<endl;
		i = mq_send(bal_robot_ia, (char*)&msg, sizeof(Msg_Robot_IA), 0);
		cout << "i=" << i << endl;

	}



	mq_close(bal_robot_ia);
	mq_unlink(BAL_ROBOT_IA);
	cout << "c'est fini" << endl;


}
コード例 #4
0
ファイル: Robot_Thread.cpp プロジェクト: Arossius/SCOR
void* Robot_Thread::exec(void* robot_thread)
{
	Robot_Thread* thread = (Robot_Thread*)robot_thread;
	thread->run();
	return 0;
}