forked from northern-bites/nao-man
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Man.h
executable file
·126 lines (106 loc) · 3.28 KB
/
Man.h
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// This file is part of Man, a robotic perception, locomotion, and
// team strategy application created by the Northern Bites RoboCup
// team of Bowdoin College in Brunswick, Maine, for the Aldebaran
// Nao robot.
//
// Man is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Man 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 Lesser Public License for more details.
//
// You should have received a copy of the GNU General Public License
// and the GNU Lesser Public License along with Man. If not, see
// <http://www.gnu.org/licenses/>.
#ifndef _Man_h_DEFINED
#define _Man_h_DEFINED
#include <pthread.h>
#include <signal.h>
#include <boost/shared_ptr.hpp>
#include "manconfig.h"
#include "MotionEnactor.h"
#include "ImageSubscriber.h"
#include "ImageTranscriber.h"
#include "Transcriber.h"
#include "Lights.h"
#include "Common.h"
#include "Profiler.h"
#include "Sensors.h"
#include "Vision.h"
#include "Noggin.h"
#include "Comm.h"
#include "Motion.h"
#include "NaoPose.h"
#include "synchro.h"
#include "RoboGuardian.h"
#include "PyRoboGuardian.h"
#include "PySensors.h"
#include "PyLights.h"
/**
* The Naoqi module to run our main Nao robot system.
*
* @author Jeremy R. Fishman
* @author Bowdoin College Northern Bites
*/
class Man : public ImageSubscriber
{
public:
// contructors
Man(boost::shared_ptr<Sensors> _sensors,
boost::shared_ptr<Transcriber> _transcriber,
boost::shared_ptr<ImageTranscriber> _imageTranscriber,
boost::shared_ptr<MotionEnactor> _enactor,
boost::shared_ptr<Synchro> synchro,
boost::shared_ptr<Lights> _lights);
// destructor
virtual ~Man();
//
// Our methods
//
// Profiling methods
void startProfiling(int nframes) {
profiler->reset();
profiler->profileFrames(nframes);
}
void stopProfiling() {
profiler->profiling = false;
}
// start/stop called by manmodule
virtual void startSubThreads();
virtual void stopSubThreads();
private:
// run Vision and call Noggin's main loop function
void processFrame(void);
void notifyNextVisionImage();
//
// Variables
//
public:
boost::shared_ptr<Sensors> sensors;
boost::shared_ptr<Transcriber> transcriber;
boost::shared_ptr<ImageTranscriber> imageTranscriber;
boost::shared_ptr<MotionEnactor> enactor;
boost::shared_ptr<RoboGuardian> guardian;
//boost::shared_ptr<Synchro> synchro;
// Sub-module instances
// ** ORDER MATTERS HERE **
// if the modules are not instantiated in this order, some dependedcies
// (i.e. the Python modules exported) will not be available by the time
// other modules are imported
boost::shared_ptr<Profiler> profiler;
boost::shared_ptr<NaoPose> pose;
#ifdef USE_MOTION
boost::shared_ptr<Motion> motion;
#endif
boost::shared_ptr<Vision> vision;
boost::shared_ptr<Comm> comm;
#ifdef USE_NOGGIN
boost::shared_ptr<Noggin> noggin;
#endif// USE_NOGGIN
boost::shared_ptr<Lights> lights;
};
#endif