summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/see/ovision.hh
blob: 8ecc23013b9999cc9d598b029b86f50c9bee74a5 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// robert - programme du robot 2005 
// 
// Copyright (C) 2005 Olivier Gaillard
//
// Robot APB Team/Efrei 2005.
//        Web: http://assos.efrei.fr/robot/
//      Email: robot AT efrei DOT fr
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#ifndef ovision_h
#define ovision_h

#include "oconfig.hh"
#include "segmTable.hh"
#include "segmLearn.hh"
#include "group.hh"
#include "magnifier.hh"
#include "colorTable.hh"
#include "space.hh"
//#include "map.hh"
//#include "socket/socketClient.hh"
#include "video4linux/video4linux.hh"
#include "image/image.hh"


class OVision
{
    OConfig *oconfig_;
    Img *img_;
    ColorTable *colorTab_;
    SegmLearn *segm_;
    Eraser *eraser_;
    Group *group_;
    Magnifier *mag_;
    Space *space_;
    //    Map *map_;
    //    SocketClient *socket_;
    Video4Linux *v4l_;
    /// Nombre d'images d�j� trait�es
    int step_;
    ///
    Group::ZoneType aim_;
  public:
    /// Constructeur
    OVision (bool useSocket = false);
    /// Destructeur
    ~OVision (void);
    /// Iniialisatoin de toutes les classes
    void init (const Group::ZoneType aim);
    /// Prends une image avec la cam�ra
    void takeShoot ();
    /// Analyse une image
    void update ();
    /// Envoie l'image par socket
    void sendImg ();
    /// Affiche d'info sur l'update
    void showInfo (const Zone &zone) const;
    /// Renvoie la liste des quilles 
    std::vector<Zone>& OVision::getSkittles () const;
    /// Renvoie le pointeur sur Video4Linux
    Video4Linux &getVideo4Linux () const;
    /// Renvoie la position de la quille dans le r�f�rentiel robot
    /// Donne l'angle du robot par rapport � la balle + distance
    void getLoc (Zone &zone, int &x, int &y, double &angle, int &dist);
    void readColorSkittle (ObjectColor &o);

};

#endif // ovision_h