summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/ia/ia.h
blob: 5ca90927c7a321a921743d5cc46fedb2cdb8b73d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef ia_h
#define ia_h
// ia.h
// buzz - Programme du robot Efrei Robotique I1-I2 2003
// Copyright (C) 2003 Nicolas Schodet
#include "date/date.h"
#include "automate/grafcet.h"
#include "busp/busp.h"
#include "camera/camera.h"
#include "date/date.h"
#include "motor/motor.h"
#include "vision/image.h"
#include "vision/thresholds.h"

class Ia
{
    // Objets du robot.
    Date m_date;
    Busp m_busp;
    Motor m_motor;
    Image *m_image;
    Thresholds *m_thresholds;
    Camera *m_camera;
    Grafcet *m_grafcet;
    // Logique de recherche de palet.
    bool m_paletFound;
    double m_paletAngle, m_paletDistance;
    // Instance unique.
    static Ia *m_instance;
    // Variables de l'ia.
    int m_var[8];
    // Tempos de l'ia.
    int m_tempo[8];
  public:
    // Constructeur.
    Ia (const char *strat);
    // Destructeur.
    ~Ia (void);
    // Renvoie une r�f�rence vers l'instance unique.
    Ia &getInstance (void) { return *m_instance; }
    // Cherche un palet.
    bool seekPalet (void);
    // A-t-on trouv� un palet.
    bool paletFound (void) { return m_paletFound; }
    // Va vers le palet pr�c�dement trouv�.
    void goPalet (void);
    // Variable de l'ia.
    int getVar (int var);
    void setVar (int var, int val);
    // Tempos de l'ia.
    void resetTempo (int tempo);
    int getTempo (int tempo);
};

#endif // ia_h