00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __SpecialPercept_h_
00010 #define __SpecialPercept_h_
00011
00012
00013 #include "Tools/Streams/InOut.h"
00014 #include "Tools/Math/Pose2D.h"
00015 #include "Tools/Math/Vector2.h"
00016 #include "Tools/Math/Geometry.h"
00017 #include "Tools/ColorClasses.h"
00018
00019
00020
00021 class SpecialLandmark
00022 {
00023 public:
00024 colorClass sectors[8];
00025 Vector2<int> center;
00026 Vector2<int> size;
00027 Vector2<double> angles;
00028 };
00029
00030
00031
00032
00033 class BitePoint
00034 {
00035 public:
00036
00037 BitePoint();
00038
00039
00040 enum Position
00041 {
00042 none = -1,
00043 frontleft = 0,
00044 frontright,
00045 behindleft,
00046 behindright,
00047 master,
00048 numOfPositions
00049 };
00050
00051
00052 Position position;
00053
00054
00055 double angleTo;
00056
00057 double distanceTo;
00058
00059 Vector2<double> relPos;
00060
00061
00062
00063 double preciseShift;
00064
00065
00066 unsigned long timeWhenLastSeen;
00067
00068
00069 void addPercept(double aAngleTo, double aDistanceTo, double aPreciseShift);
00070
00071
00072 bool fresh;
00073
00074
00075 Pose2D lastOdometry;
00076
00077 };
00078
00079
00080
00081
00082
00083
00084
00085 In& operator>>(In& stream,BitePoint& bitePoint);
00086
00087
00088
00089
00090
00091
00092
00093 Out& operator<<(Out& stream, const BitePoint& bitePoint);
00094
00095
00096
00097
00098
00099
00100
00101 class OCBridge
00102 {
00103 public:
00104
00105 OCBridge();
00106
00107
00108 enum Side
00109 {
00110 none = 0,
00111 left,
00112 right,
00113 numOfSides
00114 };
00115
00116
00117 Side lastSeenSide;
00118
00119
00120 double angleTo;
00121
00122 double distanceTo;
00123
00124 Vector2<double> relPos;
00125
00126
00127 unsigned long timeWhenLastSeen;
00128
00129
00130 BitePoint bitePoint[BitePoint::numOfPositions];
00131
00132
00133 void addPercept(double aAngleTo, double aDistanceTo);
00134
00135
00136 bool fresh;
00137
00138
00139 Pose2D lastOdometry;
00140 };
00141
00142
00143
00144
00145
00146
00147
00148 In& operator>>(In& stream,OCBridge& ocBridge);
00149
00150
00151
00152
00153
00154
00155
00156 Out& operator<<(Out& stream, const OCBridge& ocBridge);
00157
00158
00159
00160
00161 class OCRedLine
00162 {
00163 public:
00164
00165 OCRedLine();
00166
00167
00168 bool seen;
00169
00170
00171
00172
00173 Vector2<int> lineStart;
00174 Vector2<int> lineEnd;
00175 Vector2<int> pointStart;
00176 Vector2<int> pointEnd;
00177 int angleInImage;
00178 unsigned long timeWhenLastSeen;
00179
00180
00181
00182 void addPercept(Vector2<int> lineStart, Vector2<int> lineEnd, Vector2<int> pointStart,Vector2<int> pointEnd,int angleInImage);
00183 };
00184
00185
00186
00187
00188
00189
00190
00191 In& operator>>(In& stream,OCRedLine& ocRedLine);
00192
00193
00194
00195
00196
00197
00198
00199 Out& operator<<(Out& stream, const OCRedLine& ocRedLine);
00200
00201
00202
00203
00204
00205
00206 class SpecialPercept
00207 {
00208 public:
00209
00210 SpecialPercept();
00211 ~SpecialPercept();
00212
00213
00214 void reset(unsigned long frameNum=0);
00215
00216
00217 enum Type
00218 {
00219 motionDetection,
00220 none,
00221 checkerboard,
00222 barCode,
00223 autoShutter,
00224 challengeOrientation,
00225 openChallengeBridge,
00226 openChallengeRedLine,
00227 imageBrightness
00228 };
00229
00230
00231 Type type;
00232
00233
00234 double pan, tilt;
00235 Vector2<long> mostMovement, leastMovement;
00236
00237
00238 Pose2D checkerPose;
00239 unsigned long frameNumber;
00240
00241
00242 int barCodeId;
00243
00244
00245 double orientation;
00246
00247 void *slamData;
00248
00249 #define MAXSEENFLAGS 100
00250 #define MAXLEARNFLAGS 100
00251 double angleOfPinkFlags[MAXSEENFLAGS];
00252 int countAngleOfPinkFlags;
00253
00254
00255 OCBridge ocBridge;
00256
00257
00258 OCRedLine ocRedLine;
00259
00260
00261 bool shutterSelected;
00262
00263 SpecialLandmark specialLandmarks[6];
00264 int numOfSpecialLandmarks;
00265
00266
00267 unsigned char estimatedImageBrightness;
00268 };
00269
00270
00271
00272
00273
00274
00275
00276 In& operator>>(In& stream,SpecialPercept& specialPercept);
00277
00278
00279
00280
00281
00282
00283
00284 Out& operator<<(Out& stream, const SpecialPercept& specialPercept);
00285
00286 #endif //__SpecialPercept_h_