Skip to content

Commit

Permalink
ajout des commandes ping et identification pour l'hokuyo
Browse files Browse the repository at this point in the history
  • Loading branch information
trecouvr committed May 16, 2012
1 parent bc13052 commit 21a4858
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 23 deletions.
10 changes: 10 additions & 0 deletions executables/hokuyo/driver/src/comThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@

#include "protocole.h"


void ping() {
cout << "pong";
}

void ident() {
cout << "hokuyo";
}
/***********************************************************************
* <h1>QH_GETDATA</h1>
* <p>Fonction retournant la postion des robots en coordonnées
Expand All @@ -32,6 +40,7 @@ void setRed(void)
application->ud->stop();
application->ud->updateParamWithColor(ROUGE);
application->ud->start();
cout << 0;
}

/***********************************************************************
Expand All @@ -44,6 +53,7 @@ void setPurple(void)
application->ud->stop();
application->ud->updateParamWithColor(BLEU);
application->ud->start();
cout << 0;
}

/***********************************************************************
Expand Down
2 changes: 2 additions & 0 deletions executables/hokuyo/driver/src/mainApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ void MainAppDriver::initComManager()
cm->addFunction(QH_GETDATA,&send);
cm->addFunction(QH_SET_REDCOLOR,&setRed);
cm->addFunction(QH_SET_PURPLECOLOR,&setPurple);
cm->addFunction(QH_PING,&ping);
cm->addFunction(QH_IDENT,&ident);
cm->setMutex(ud->getMutex()); // Partage des mutex
cm->start();
}
58 changes: 35 additions & 23 deletions protocole.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,41 @@
#define QV_GET 47


////////////////////////////////////////////////////////////////////////
//// HOKUYO
////////////////////////////////////////////////////////////////////////

/**
* Fonction retournant la postion des robots en coordonnées cartésiennes
* */
#define QH_GETDATA 1

/**
* Dit à l'hokuyo que notre robot est sur la couleur rouge
* */
#define QH_SET_REDCOLOR 2

/**
* Dit à l'hokuyo que notre robot est sur la couleur violet
* */
#define QH_SET_PURPLECOLOR 3

/**
* Ping
*/
#define QH_PING 4

/**
* Ident
*/
#define QH_IDENT 5

/**
* Signal pour stoper l'application hokuyo
* */
#define QH_KILL 9




// erreurs
Expand Down Expand Up @@ -299,29 +334,6 @@



// HOKUYO

/**
* Fonction retournant la postion des robots en coordonnées cartésiennes
* */
#define QH_GETDATA 1

/**
* Dit à l'hokuyo que notre robot est sur la couleur rouge
* */
#define QH_SET_REDCOLOR 2

/**
* Dit à l'hokuyo que notre robot est sur la couleur violet
* */
#define QH_SET_PURPLECOLOR 3

/**
* Signal pour stoper l'application hokuyo
* */
#define QH_KILL 9





Expand Down

0 comments on commit 21a4858

Please sign in to comment.