2018-04-04 16:17:13 +02:00
|
|
|
/*
|
|
|
|
* Fonctions de calcul de la position du robot
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __POSITION_H_
|
|
|
|
#define __POSITION_H_
|
|
|
|
|
|
|
|
#include "CF.h"
|
|
|
|
#include <pthread.h>
|
|
|
|
|
2018-05-06 12:50:03 +02:00
|
|
|
// #define INVERSE_L_CODER
|
|
|
|
#define INVERSE_R_CODER
|
2018-04-04 16:17:13 +02:00
|
|
|
|
2018-04-29 09:38:49 +02:00
|
|
|
// Structures
|
2018-04-04 16:17:13 +02:00
|
|
|
struct __attribute__ ((packed)) position {
|
|
|
|
float x;
|
|
|
|
float y;
|
|
|
|
float o;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Fonctions
|
|
|
|
void configurePosition();
|
|
|
|
void deconfigurePosition();
|
2018-05-02 08:26:35 +02:00
|
|
|
void getCoders(long* l, long* r);
|
2018-05-06 18:35:26 +02:00
|
|
|
unsigned int getPositionNewer(struct position* pos, unsigned int lastCalc);
|
|
|
|
unsigned int getPosition(struct position* pos);
|
|
|
|
void setPosition(struct position* pos);
|
|
|
|
void resetPosition();
|
2018-04-04 16:17:13 +02:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|