summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/motor/motor.hh
diff options
context:
space:
mode:
Diffstat (limited to '2005/i/robert/src/motor/motor.hh')
-rw-r--r--2005/i/robert/src/motor/motor.hh32
1 files changed, 29 insertions, 3 deletions
diff --git a/2005/i/robert/src/motor/motor.hh b/2005/i/robert/src/motor/motor.hh
index 22298e0..f81af49 100644
--- a/2005/i/robert/src/motor/motor.hh
+++ b/2005/i/robert/src/motor/motor.hh
@@ -26,14 +26,21 @@
// }}}
#include "config/config.hh"
+#include "asserv/asserv.hh"
/// Gère les moteurs de déplacement du robot
-class Motor
+class Motor : public Asserv::Receiver
{
private:
+ /// Communication avec l'asservissement
+ Asserv asserv_;
+ /// position
double posX_;
double posY_;
+ double posA_;
double speed_;
+ /// Etat des commandes
+ bool idle_;
public:
/// Constructeur
@@ -46,8 +53,10 @@ class Motor
double getX(void);
/// Renvoie la position Y
double getY(void);
+ /// Renvoie l'angle A
+ double getA(void);
/// Ammène le robot à la position x,y
- void goTo(double x, double y);
+ void goTo(double x, double y, double a);
/// Recale le robot
void recalage(void);
/// Règle la vitesse des moteurs
@@ -57,6 +66,23 @@ class Motor
/// Execute un déplacement linéaire
void linearMove(double d);
/// Execute une rotation(argument en radian)
- void rotation(double a);
+ void rotation(double newA);
+ /// Syncronisation
+ bool sync(void);
+ /// déclaration des fonctions de receiver
+ void receiveCounter (double lMotor, double rMotor);
+ void receivePosX (double xPos);
+ void receivePosY (double yPos);
+ void receivePosA (double aPos);
+ void receiveSpeedStat (int leftError, int leftInt, int rightError,
+ int rightInt);
+ void receivePwm (double leftPwm, double rightPwm);
+ void receiveTiming (int motorTimer4,
+ int motorTimer3, int motorTimer2,
+ int motorTimer1, int motorTimer0);
+ void receiveInPort (int port);
+ void receiveSharp (int sharp1, int sharp2, int sharp3);
+ void receiveTazState(int state, int subState); // XXX Vérifier les formats
+ void done (void);
};
#endif // motor.hh